问两个EJB的问题。

本人在Weblogic,MySQL下开发CMP Entity Bean,有以下两个表:
CREATE TABLE ADDRESS (
ID int NOT NULL PRIMARY KEY,
STREET varchar (40) NULL ,
CITY varchar (20) NULL ,
STATE varchar (2) NULL ,
ZIP varchar (10) NULL
);
CREATE TABLE CUSTOMER (
ID int NOT NULL PRIMARY KEY,
LAST_NAME varchar (20) NULL ,
FIRST_NAME varchar (20) NULL ,
ADDRESS_ID int NULL ,
HAS_GOOD_CREDIT int NULL
);

它们之间的对应关系为:


NAMED_SEQUENCE_TABLE
ADDRESS_SEQUENCE
10


Customer-Address

Customer-has-a-Address

ADDRESS_ID
ID




Customer-Address


Customer-has-a-Address

one

CustomerEJB


homeAddress




Address-belongs-to-Customer

one

AddressEJB



出现下面的Exception:

C:\weblogic_examples\ex06_3>java com.titan.clients.Client_63
Creating Customer 1..
Creating AddressDO data object..
Setting Address in Customer 1...
Exception in thread "main" java.rmi.RemoteException: EJB Exception: ; nested exc
eption is:
javax.ejb.TransactionRolledbackLocalException: EJB Exception:
- with nested exception:
[javax.ejb.EJBException
- with nested exception:
[java.sql.SQLException: Transaction Isolation Levels are not supported.]]
java.sql.SQLException: Transaction Isolation Levels are not supported.
<>
--------------- nested within: ------------------
javax.ejb.EJBException
- with nested exception:
[java.sql.SQLException: Transaction Isolation Levels are not supported.]
<>
--------------- nested within: ------------------
javax.ejb.TransactionRolledbackLocalException: EJB Exception:
- with nested exception:
[javax.ejb.EJBException
- with nested exception:
[java.sql.SQLException: Transaction Isolation Levels are not supported.]]
<>

C:\weblogic_examples\ex06_3>

是不是因为MySQL的原因?

还有,CMP Entity Bean的Local接口主要是用来干什么的?什么时候用?


谢谢!

看来是你应该使用mysql MAX版本

local是2.0规范中的local EJB,相对于remote EJB而言。

to be more specific, set type=innoDB in ddl
谢谢你的意见,不过我这几天有事也没有再进行测试。MySQL数据库的几种类型如TYPE=MyISAM我还真没有仔细的看过有什么不同之处呢。

> to be more specific, set type=innoDB in ddl

TYPE=MyISAM 不支持事务。mysql 最早不打算支持事务,所以库结构用 isam,现在支持事务了,库结构就得变化,但为了保持兼容,还支持 isam 类型的表。