thanks, Bill

a few more questions in-line...

>
>       problem:
>
>       I've got rather long transactions (they begin in a session
> bean) whithin
> which I access other session beans and eventually CMP entity beans(mostly
> getter methods). I'm getting a lot of deadlock. I'm implementing the
> isModified() method in hopes that it will alleviate some of this
> problem by
> cutting down on calls to the ejbStore method.
>
>       questions:
>
>       1. I'm assuming that if the ejbStore method does not get
> called then the
> ejbLoad method will not get called either and the cached values will be
> used. is this right?
>

ejbLoad get's called at most once per transaction, depending on your commit
option

Commit option A:
ejbLoad get's called when bean enters cache

Commit option B and C:
ejbLoad get's called once per transaction

ejbStore is a different story.  It is called at transaction commit.  It can
also be called within a transaction when a finder method is invoked.  If a
finder method is invoked within a transaction, it will call ejbStore on
every bean of that finder's type that are involved within the transaction.
The EJB spec requires this.

even with the isModified returning false?

>       2. I'm already using tuned updates but the isModified()
> method should
> improve things further, right? or at least overide the tuned updates
> behavior.
>

It will improve things, but not much.

>       3. is there anything else I can do to avoid deadlock? I've
> been thinking of
> implementing a stateless session bean facade to the entity beans.
> Will that
> help me to avoid deadlock?
>

I'm assuming you're getting application deadlock?  That is, the order in
which you are accessing your beans is causing your deadlock, correct?  Are
you getting SQL exceptions stating that deadlock was detected?  Or is JBoss
throw transaction timeouts?  If the latter, then you need to write your app
so it accesses beans always within a specific order

yes I'm getting a timeout at the app level. everything works fine with a
single thread, no deadlock
but as soon as I introduce two threads then deadlock happens everywhere. the
thing is that all of the methods are get( readonly)
so why would I deadlock. why can't I just get my value from the entity bean
and move on?

or maybe it's the finders that are making all the fuss...

-dom





>       4. will specifying NOT_SUPPORTED in the entity getter
> methods do anything?
> I've been under the impression that a trasaction is always started for
> entity beans.
>

Not sure on this one.

Bill



_______________________________________________
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

Reply via email to