Hello!
I call the following code in a Message Driven Bean in Orion 1.5.2. After the
"conn.close()" all entity beans I created in some code before are destroyed.
The database is empty. The sql statement gets the right result but after the
close everything is lost. No error, nothing. Without the close statement
Orion says that there is a leaked connection and that I have to close it:
==
OrionCMTConnection not closed, check your code!
LogicalDriverManagerXAConnection not closed, check your code!
(Use -Djdbc.connection.debug=true to find out where the leaked connection
was created)
==

Can anybody help me?

Thanks in advance.

Marc Lehnert,.


The code:
====

            PreparedStatement stmt = null;
            java.sql.Timestamp siteEndDate;
            java.sql.Timestamp siteBeginDate;
            
            try {

              javax.sql.DataSource ds =
(javax.sql.DataSource)jndiContext.lookup("jdbc/sapdbDS");
              Connection conn = ds.getConnection();

              //Connection conn =
ConnectionFactory.getConnection("jdbc/sapdbDS");
              
              String sqlStatement = "select max(rw_datetime),
min(rw_datetime) from logfilerow where rw_websiteid = ?";
              
              stmt = conn.prepareStatement(sqlStatement);
              stmt.setString(1, websiteid);
              ResultSet rs = stmt.executeQuery();
              rs.next();
              siteEndDate = rs.getTimestamp(1);
              siteBeginDate = rs.getTimestamp(2);

====>    conn.close();
              
            } catch (Exception e) {
              e.printStackTrace();
              throw e;
            }

Reply via email to