I added the check for null pk. If pk is null, an instance of
CreateException is thrown.
alex
Monday, July 14, 2003, 7:16:38 AM, Scott Stark wrote:
SMS> Why is the JDBCStoreManager.createEntity allowing a null pk:
SMS> public Object createEntity(
SMS> Method createMethod,
SMS> Object[] args,
SMS> EntityEnterpriseContext ctx) throws CreateException
SMS> {
SMS> Object pk = createEntityCommand.execute(createMethod, args, ctx);
SMS> // mark the entity as created
SMS> entityBridge.setCreated(ctx);
SMS> return pk;
SMS> }
SMS> This guarentees a failure after the fact when the lock is attempted for the null
SMS> primary key as seen in the updated KeyGenerationUnitTestCase:
SMS> 20:10:31,272 INFO [MainDeployer] Deployed package:
SMS> file:/C:/cvs/JBoss3.2/jboss-3.2/testsuite/output/lib/cmp2-keygen.jar
SMS> 20:10:37,391 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
SMS> java.lang.IllegalArgumentException: Attempt to get lock ref with a null object
SMS> at org.jboss.ejb.BeanLockManager.getLock(BeanLockManager.java:80)
SMS> at
SMS> org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:81)
SMS> Why isn't this failure caught as the source and the create failed?
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development