just curious ... are there any way we can tell which transaction the bean (entity / session / mdbean) is currently within when processing?
can we retreieve that from the entitycontext or sessioncontext?...
that will be awesome if we can do it...
thx.
hoi
-
transaction (6 messages)
- Posted by: hoi tsang
- Posted on: September 03 2002 15:48 EDT
Threaded Messages (6)
- transaction by Dave Wolf on September 03 2002 17:09 EDT
- transaction by hoi tsang on September 03 2002 18:21 EDT
-
transaction by Dave Wolf on September 03 2002 08:05 EDT
-
transaction by hoi tsang on September 03 2002 09:29 EDT
-
transaction by Dave Wolf on September 03 2002 10:34 EDT
- transaction by hoi tsang on September 04 2002 08:43 EDT
-
transaction by Dave Wolf on September 03 2002 10:34 EDT
-
transaction by hoi tsang on September 03 2002 09:29 EDT
-
transaction by Dave Wolf on September 03 2002 08:05 EDT
- transaction by hoi tsang on September 03 2002 18:21 EDT
-
transaction[ Go to top ]
- Posted by: Dave Wolf
- Posted on: September 03 2002 17:09 EDT
- in response to hoi tsang
What do you mean "which transaction"? Do you mean you want to know if a transaction is already pending? Do you mean you want to know the state of that transaction?
Dave Wolf
The Scupper Group
dave at scuppergroup dot com
-
transaction[ Go to top ]
- Posted by: hoi tsang
- Posted on: September 03 2002 18:21 EDT
- in response to Dave Wolf
mmmmm i think best with code.. i meant:
e.g.
public class BeanA implements EntityBean {
...
public void call() throws RemoteException {
// look up bean B
beanB.doSomething();
}
..
}
public class BeanB implements EntityBean {
public void doSomething() ..
// are there any way we can tell
// if this method call of this
// instance is already within an
// transaction?
// if yes can we retrieve that transaction's ID?
// or anything that represent that transaction?
}
}
when beanB is being called, are there anyway we can
tell if the method that is being called is executed
within an existing transaction? if yes are there
any way we can retrieve the information about the
transaction?..
thx...
-hoi. -
transaction[ Go to top ]
- Posted by: Dave Wolf
- Posted on: September 03 2002 20:05 EDT
- in response to hoi tsang
If you use declarative transactions you dont have to do anything. If both beans are marked as requires transaction the transaction will be managed by the container.
Dave Wolf
The Scupper Group
dave@scuppergroup.com -
transaction[ Go to top ]
- Posted by: hoi tsang
- Posted on: September 03 2002 21:29 EDT
- in response to Dave Wolf
thanks... but are there anyway we can do some explicit checking on which specific transaction the method call in BeanB is within?... -
transaction[ Go to top ]
- Posted by: Dave Wolf
- Posted on: September 03 2002 22:34 EDT
- in response to hoi tsang
Yes you can check the status with the EJBContext object. It will be passed into you at the setSessionContext() method.
_context.getUserTransaction().getStatus();
Dave Wolf
The Scupper Group
dave at scuppergroup dot com
-
transaction[ Go to top ]
- Posted by: hoi tsang
- Posted on: September 04 2002 08:43 EDT
- in response to Dave Wolf
awesome... thanks a lot...