Charles Anthony wrote:
Hi,No problem :-)
Someone asked for this recently, and I'm afraid I was too busy to reply.
Yes you're right. But my problem is a little bit different.
When you lock an object (for update), it is *before* you make any changes to it. How can OJB know when to "automatically" flush changes to the database ? It can't; you have to tell it to.
The same applies to locking an object for create; you can lock an object for create, *then* set the values on the object - it is only at commit/flush time that we know what the complete changes are...
I've got 2 EJB's let's say A and B. B does all OJB related stuff. A is a statefull session bean.
A part of it is I generate session data and store them at the DB. At the end of the session
I'm searching for the data and delete them. As long as A is bean managed everything works fine
but if A is container managed the commit of the insert of the session data is at the end of the
whole session and so the query to delete the data fails and AFTER that the session data are inserted.
I tried to set B to <trans-attribute>RequiresNew</trans-attribute>. So the first insert call should get a commit
after it's completion and the data should be at the db when querying at the second delete call.
This did not change anything. Either JBoss has a problem at the generating of the inner session
or OJB is using the outer session any time although there is a inner one.
best regards,
Cheers,
Charles
Guido
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
