• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using DataSource with Oracle 10g Application Server results in error

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you closing each of your JDBC objects in a separate try/catch block?
 
hasina kumar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you swallow the exception, how can you tell that the close() worked?
reply
    Bookmark Topic Watch Topic
  • New Topic