Hi Steve.

A conn.commit() is not allowed by the container. Already tried this. Thanks.

Marc.

-----Ursprüngliche Nachricht-----
Von: Stephen Davidson [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 7. März 2002 20:43
An: Orion-Interest
Betreff: Re: JDBC connection leak


Hi Marc.

Maybe try a conn.commit() before conn.close()?

-Steve

Marc Lehnert wrote:
> 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;
>             }
> 
> 
> 



-- 
Stephen Davidson
Java Consultant
Delphi Consultants, LLC
http://www.delphis.com
Phone: 214-696-6224 x208


Reply via email to