I am making the <res-sharing-scope>Unshareable</res-sharing-scope> in the
web.xml file , here goes the code .<resource-ref>
| <description>DB Connection</description>
| <res-ref-name>jdbc/testDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| <res-sharing-scope>Unshareable</res-sharing-scope>
| </resource-ref>
I have a jsp which does the following
InitialContext ctx = new InitialContext();
| DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/testDS");
| UserTransaction utx = (UserTransaction)ctx.lookup("UserTransaction");
| utx.begin();
| Connection con = ds.getConnection();
| out.println("First Connection --> "+con.toString()+"<br>");
| WrappedConnection unlycon = (WrappedConnection)con;
| out.println(unlycon.getUnderlyingConnection()+"<br>");
| Connection con1 = ds.getConnection();
| WrappedConnection unlycon1 = (WrappedConnection)con1;
| out.println(unlycon1.getUnderlyingConnection()+"<br>");
| out.println("Second Connection"+con1);
| utx.commit();
| con.close();
| con1.close();
And I see the following result First Connection --> [EMAIL PROTECTED]
| [EMAIL PROTECTED]
| [EMAIL PROTECTED]
| Second [EMAIL PROTECTED]
Since the resource sharing is defined as Unsharable I was expecting the
underlying connection reference as different but it is not .
Am I missing some thing here ?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043406#4043406
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043406
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user