Thank you for your response. However, I?m still unclear as to what I need to
do to fix the issue in my code. The example about RetryingTransactions is
referring to an EJB, and my code is in a simple servlet running in Tomcat under
JBoss.
The snippet of code below is my method for obtaining a JTA connection from the
pool. As you can see it does the JNDI lookup, fetches the DataSource object,
and tries to return a Connection object. Once I have the DataSource, how can I
determine if the connection I get will be dead? Or, if I trap the exception,
how can I remove the dead transaction from the pool and get a live one?
private static Connection getJBossJTAConnection(String poolName) throws
DataException
| {
| Connection conn = null;
| try {
| InitialContext ctx =
JNDIManager.getInstance().getInitialContext();
| DataSource ds = (DataSource)ctx.lookup("comp/env/jdbc/"
+ poolName + "Tx");
| conn = ds.getConnection();
| }
| catch ( Exception e ) {
| e.printStackTrace();
| throw new DataException( e.getMessage() );
| }
| return conn;
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3923432#3923432
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3923432
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user