My session bean may take connection from one of 2 available pools. Its choice depends on transaction attribute that was defined on this bean (it is defined globally for all methods).
My question is:
How I can access transaction attribute value that was defined in ejb-jar.xml (not reading the file directly, but via some API)?
Thank you.
-
Access transaction attributes from EJBs (2 messages)
- Posted by: Igor Laberov
- Posted on: April 14 2004 07:48 EDT
Threaded Messages (2)
- Access transaction attributes from EJBs by ofer baranes on April 14 2004 08:52 EDT
- Access transaction attributes from EJBs by Mircea Crisan on April 15 2004 02:36 EDT
-
Access transaction attributes from EJBs[ Go to top ]
- Posted by: ofer baranes
- Posted on: April 14 2004 08:52 EDT
- in response to Igor Laberov
I don't think that there is a way to do that in stanard J2EE API,
it might be avaliable ,however, through the AppServer you are using.
a manual way which might work :
through your bean try locating the URL of the ejb jar which is the source of
your bean , using a code like that :
sbean.getClass().getProtectionDomain().getCodeSource().getLocation()
then init a classloader which include in its path the jar and use the
getResource() method to locate the ejb-jar.xml
ofer -
Access transaction attributes from EJBs[ Go to top ]
- Posted by: Mircea Crisan
- Posted on: April 15 2004 02:36 EDT
- in response to Igor Laberov
Hi,
The transaction attributes are deceided at deployment time. Simmilar, you should deceide the connection pool (datasource) at deployment time. This can be done through an env-entry in your bean deployment descriptor, or some other config strategy (property files in calsspath, etc).
Best regards,Mircea