|
Search the archives for isModified. You can
perform a straightforward optimization that prevents the unnecessary
updates.
----- Original Message -----
Sent: Tuesday, June 12, 2001 2:49
PM
Subject: Re: [JBoss-user] When do entity
beans commit?
Thanks Georg,
Your state charts of I's and dashes are
awesome!
Indeed I no longer saw deadlocks in that scenario, but I did
see a performance slowdown, as every single "get" method resulted in the
opening and closing of a transaction.
What I've done is mark all my
Entity beans as "Supports", rather than "Requires".
Furthermore, at the
session bean level, my read-only methods are marked as "Never", while my
read/write methods are marked as "Requires".
In this way I get good
read-only performance for my read methods, and data integrity for my
read/write methods.
I am aware that marking my entity beans as
"Supports" ventures into "unspecified" behavior, but in the above scenario, it
appears to work in a good way.
If I am making a poor assumption here
then I would appreciate your further
comments.
Regards,
Bryan
Georg Rehfeld wrote:
024501c0f36d$c05a1d90$[EMAIL PROTECTED]"
type="cite">Hi Bryan,
In the "Never" session bean methods, when exactly are my entity bean's transactions ENDED (committed)?
As of the EJB spec 1.1 section 11.6.2 they are ended on return from the Entities method set to Requires. I crosschecked the code in org.jboss.ejb.plugins.TxInterceptorCMT and it behaves as specified.
session1 session2 entityA entityB -------- -------- ------- ------- | I TX.begin | | | I---------->I | | I TX.commit | | I I | TX.begin | I--------------------------------->I I I | TX.commit | I I | | I I | TX.begin | I I---------------------->I I I | TX.commit | I I TX.begin | | I--------------------->I | I I TX.commit | |
Thus you should see no deadlock caused.
regards Georg ___ ___ | + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg |_|_\ |___ [EMAIL PROTECTED] +49 (40) 23 53 27 10
----- Original Message ----- From: "Bryan Field-Elliot" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 11, 2001 11:06 PM Subject: [JBoss-user] When do entity beans commit?
I am using jBoss 2.2.2.
My clients access a stateful session bean, and my session bean's methods in turn access CMP entity beans.
All my entity beans are marked as "Requires" transactions; in my session bean, some methods are marked as "Never", while others are marked as "Requires".
In the "Never" session bean methods, when exactly are my entity bean's transactions ENDED (committed)? These are essentially read-only methods in my session bean. They use entity beans to gather data, but they aren't making any changes. Nonetheless, they are causing me some deadlock problems. Will these entity beans not be released until after my session bean method returns, even though my session bean method is not transactional?
Help would be appreciated.
Regards,
Bryan
_______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
|