users@glassfish.java.net

Glassfish transaction-problem

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Aug 2008 01:09:33 PDT

we migrated an application from jboss to Glassfish
the application works with stateless-sessionBeans (no Entity-Beans)
here is a small example :



Object o=new InitialContext().lookup("java:comp/UserTransaction");
UserTransaction tr=(UserTransaction) PortableRemoteObject.narrow(o,UserTransaction.class);
try {
    tr.begin();
    processSQL();
    tr.commit();
} catch (Exception e){
     tr.rollback;
}




private void processSQL(){
    try{
     DataSource ds= new InitialContext().lookup(db);
     Connection con = ds.getConnection();
     ........

    } catch (Exception e) {}
    }finally{ con.close()}



}



this works fine on Jboss ! but if we try this on glassfish (with high load), we get locks on the database (DB2) .... we debugged the database and found out, that some connections stay opened, despite con.close().
[Message sent by forum member 'thomas_x' (thomas_x)]

http://forums.java.net/jive/thread.jspa?messageID=295072