Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Tx propagation across multiple weblogic servers

  Asked By: Bryant    Date: Feb 17    Category: Java    Views: 782
  

This is a very frustrating problem:

I deploy a stateless session bean A with required tx attribute on one
instance of weblogic. In another instance (on a different machine), I
deploy a stateful session bean B, also with required tx attribute
that
implements SessionSynchronization. Bean A has a simple business
method doA
() which simply finds bean B and call one of B's method.

When I run a test client that finds bean A and calls doA(). The
transaction
created when A is called will propagates to B. And when B returns, doA
()
simply ends. This complete the transaction across the two beans on
different servers.

Now. Since B implements SessionSynchronization, weblogic should
invoke the
callbacks e.g., afterBegin(), beforeCompletion() and
afterCompletion(boolean committed). That's good. It does that.
(Actually, only afterBegin() and afterCompletion() is called.) But
it's
calling afterCompletion(false). That is. Even though the transaction
was
committed successfully, weblogic still invoke afterCompletion() with
a
false flag indicating the transaction was NOT completed. This is a
serious
error.

However, if A and B is deployed in one single server, everything
works
fine.

I suspect this is a bug with weblogic - as if one instance "forgets"
to tell the
other instance the transaction completed successfully.

I also found this in the weblogic log when bean A in one machine
calls bean B in another machine:


<Oct 22, 2001 6:12:17 PM PDT> <Error> <ConnectionManager>
<Closing: 'weblogic.rj
vm.t3.T3JVMConnection@551f11' because of: 'Server received a message
over an uni
nitialized connection: 'JVMMessage from: 'null' to: '-
4155626721612201556S:167.1
16.91.251:[7001,7001,7002,7002,7001,7002,-1]:mydomain:myserver'
cmd: 'CMD_REQUES
T', QOS: '101', responseId: '1', invokableId: '9', flags: 'JVMIDs Not
Sent, TX C
ontext Not Sent', abbrev offset: '248'''>

Does anyone have a hint on what's going on?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Hehet Chalthoum     Answered On: Feb 17

Anyway, should it really call  B’s SessionSynchronization methods?! It should for A but not B. transaction  starts in A and finishes in A too. No need for calling B’s synch methods. I guess you’re using a side effect of how weblogic  handles transactions (I guess by putting some transaction info in active thread context), so when you’re in the same jvm the info is there in the context so it blindly calls  synch… methods. When you declare B to use A’s transactional state, it means B trusts in A for managing its transaction, gives B the chance to do something more that what it meant by giving A the privilege to manage the transaction. You may try using REQUIRES_NEW for B and see what happens.



Still I’m not sure. I haven’t found  anything in ejb spec about it! Better to ask this question in ejb-interest mailing list.

 
Didn't find what you were looking for? Find more on Tx propagation across multiple weblogic servers Or get search suggestion and latest updates.




Tagged: