Hi everybody -
 I've got a session bean that creates a new entity bean, pushes some
things around in the database, then [on purpose] throws an
EJBException to rollback the transaction. When I look at the database,
I see that all the stuff the session bean did to the database has been
[correctly] rolled back, but the entity bean that was created during
the transaction hasn't been removed from the database. Is this proper
behavior?

The session bean is stateless and declared as doing bean managed
transactions. The session bean 'requires' a transation for all method
calls. The UserTransaction.begin() method is called before creating
the entity bean. The entity bean does BMP, declares itself as
Container managed transactions, and 'supports' transactions.

I've been able to retrieve one of these entity beans, modify it's
contents, then rollback the transaction and that works perfectly.

I threw in some debugging statements, and the 'ejbRemove' method is
never called for the entity bean - shouldn't it do that after the
transaction is rolled back? I'm actually surprised it wasn't rolled
back, because I'm using the DefaultEJBDS. Should I be creating a
UserTransaction object for the entity bean and wrapping all operations
within begin() and end() calls?

Eric...

Reply via email to