File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Using DataSource with Oracle 10g Application Server results in error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using DataSource with Oracle 10g Application Server results in error" Watch "Using DataSource with Oracle 10g Application Server results in error" New topic
Author

Using DataSource with Oracle 10g Application Server results in error

hasina kumar
Greenhorn

Joined: Jan 06, 2006
Posts: 9
After creating a DataSource on Oracle Application Server, we deploy a war file for the application. But when we try to run the application, it results in following error:
OrionCMTConnection not closed, check your code
Logical Connection not closed, check your code.
I have checked my code for closing all the open connections. All the connections are closed in the finally Block.

I have checked the web.xml for resource-ref tag pointing to correct DataSource. Also check the connection string in DataSource on the application server. Everything seems to be correcty. Does anybody have any idea why i would get this error. -Thanks
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
It seems odd to see a CMT exception but have somebody say
they are closing a connection manually in a finally clause.
Are you using this data source in some kind of session bean,
or did you wrap this in some kind of JTA code? Or maybe
the data source is configured for XA when one for local
transactions would be more appropriate?


Reid - SCJP2 (April 2002)
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Are you closing each of your JDBC objects in a separate try/catch block?


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
hasina kumar
Greenhorn

Joined: Jan 06, 2006
Posts: 9
I am not using Session Bean. I getting the dataSource by using JNDI context
try {
// Get the JNDI context
Context ic = new InitialContext();
ds = (DataSource) ic.lookup(dsName);
}
catch (NamingException e) {
e.printStackTrace();
throw new RemoteException(e.getMessage());

And this is the try-catch blocks to get the connection. I close connection in finally block
try
{
try {
conn = DbConnectionPool.getConnection(dsName);
}
catch (RemoteException e1) {
e1.printStackTrace();
}
stmt = conn.prepareCall(sql);
}
catch (SQLException e)
{
try {
throw new RemoteException(e.getMessage());
}
catch (RemoteException e1) {
e1.printStackTrace();
}
}
finally{
try{
conn.close();
}
catch(SQLException e){
}
}
return stmt;
}
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
If you swallow the exception, how can you tell that the close() worked?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using DataSource with Oracle 10g Application Server results in error