Hello, everybody!

Look at the following code:


  | public void foo()
  | {
  |     Connection connection = null;
  |     PreparedStatement command = null;
  |     ResultSet data = null;
  |     try
  |     {
  |         InitialContext context = new InitialContext();
  |         DataSource dataSource =
  |             (DataSource) context.lookup("java:/BibliotecaDS");
  |         connection = dataSource.getConnection();
  |         connection.setTransactionIsolation(
  |             Connection.TRANSACTION_REPEATABLE_READ);
  | 
  |         // Execute some selects and updates...
  |     }
  |     catch (NamingException ex)
  |     {
  |         // Handle exception...
  |     }
  |     catch (SQLException ex)
  |     {
  |         // Handle exception...
  |     }
  |     finally
  |     {
  |         // Close resources...
  |     }
  | }
  | 
As you can see I'm getting a managed connection from the connection pool and 
changing its transation isolation level before using the connection to create 
statements and result sets. My doubt is: after the method completes and JBoss 
commit or rollback the updates, will the container revert the connection's 
transaction isolation level to the initial value, before the execution of the 
method? If so, that's what I expect and what
I want. If not, I won't be able to change the isolation level because suddenly 
I'll have a connection pool full of connections with a more restrictive 
isolation level, making my application run slow.

Thank you.

Marcos

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4202823#4202823

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4202823
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to