This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connection is Closed.  RSS feed

 
San John
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Fallows is my Exact Error Message is as fallows...can any body at the symptom of this error.

com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Connection is closed.


Actually I am trying to call the database using SessionBean in the bean itself i am opened connection and closing as fallows.

/** @modelguid {F529BAD7-BD30-4A58-943C-FA9E5D73132B} */
public void ejbActivate() {
try {
makeConnection();
} catch (Exception e) {
logger.debug("ejbActivate");
throw new EJBException(e.getMessage());
}
}

/** @modelguid {EFD577C3-50C2-4A58-8D65-B2840692D69A} */
public void ejbPassivate() {
try {
databaseConnection.close();
} catch (java.sql.SQLException ex) {
logger.debug("ejbPassivate");
throw new EJBException(ex.getMessage());
}
}

/** @modelguid {D9C98315-A905-4FEF-A227-61BE5F464DBB} */
public void ejbRemove() {
try {
databaseConnection.close();
} catch (java.sql.SQLException ex) {
logger.debug("ejbRemove");
throw new EJBException(ex.getMessage());
}
}

/** @modelguid {87AE3A3C-0AEC-40ED-87BA-1410FAFA804C} */
public void setSessionContext(javax.ejb.SessionContext sessionContext) {
this.sessionContext = sessionContext;

}

/** @modelguid {A637A023-8DDE-473E-9769-B1B81B0B95F8} */
public void ejbCreate() throws javax.ejb.CreateException {
//chungfee - Added to resolve Deadlock issue
try {
makeConnection();
} catch (Exception e) {
logger.debug("ejbCreate");
throw new javax.ejb.CreateException(e.getMessage());
}
}
Fallowing My MakeConnection Method.

private void makeConnection() {
logger.debug("makeConnection");

try {
javax.naming.InitialContext ic = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ic.lookup(dbName);
databaseConnection = ds.getConnection();

} catch (java.sql.SQLException e) {
logger.debug("SQLException");
} catch (javax.naming.NamingException e) {

e.printStackTrace();
}
}

When the multiple users are trying to access same resources i am facing the error is connection is closed..can any body suggest to me the what is the solutions of this type of problems.

Thanks..

San John
dilsesan@yahoo.co.in
 
Lakshmi Ashok
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Where exactly are you getting the connection exception?
2. Have you checked the connection pool parameters on the server..how many max connections have you allowed at a point?
3. After u actually create a connection , have you checked if the connection object is not null or throwing exception?
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
San, please refrain from duplicate posting. I have deleted your two other duplicate posts of this thread. You can always delete your own threads but lciking the Edit icon, and checking the delete post checkbox.

Thanks

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!