667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

EJB design EJB design EJB design Messages: 5 Messages: 5 Messages: 5 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Entity bean - Connection busy ?

Posted by: alags thiags on August 17, 2003 DIGG
Hi friends,

Plz help me understand..

I am trying out an entity bean example with CMP. I use SQL server database with a JDBC-ODBC Bridge driver.
The first time i try to insert a row and execute some finder methods based on the row inserted and the programe
works fine..and then i try to run the same program again and, as expected, it throws a Duplicate key exception..
understandable. But after this, i delete that row from the table, and then i execute the same program and i get
the exception "java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt".(Complete stack trace attached) I just can not understand what is happening. But when i restart the server, everything is fine ie - the program inserts the row, executes finders & returns the results.

Thanks & Regards
Alagapan

java.rmi.RemoteException: EJB Exception:; nested exception is:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt

Start server side stack trace:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
        at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:2533)
        at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:217)
        at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:139)
        at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
        at weblogic.jdbc.rmi.internal.PreparedStatementImpl.executeUpdate(PreparedStatementImpl.java:64)
        at weblogic.jdbc.rmi.SerialPreparedStatement.executeUpdate(SerialPreparedStatement.java:58)
        at Product_meu6z3__WebLogic_CMP_RDBMS.__WL_create(Product_meu6z3__WebLogic_CMP_RDBMS.java:1041)
        at Product_meu6z3__WebLogic_CMP_RDBMS.ejbPostCreate(Product_meu6z3__WebLogic_CMP_RDBMS.java:971)
        at java.lang.reflect.Method.invoke(Native Method)
        at weblogic.ejb20.manager.DBManager.create(DBManager.java:583)
        at weblogic.ejb20.manager.DBManager.remoteCreate(DBManager.java:462)
        at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:190)
        at ProductEJB_meu6z3_HomeImpl.create(ProductEJB_meu6z3_HomeImpl.java:77)

        at ProductEJB_meu6z3_HomeImpl_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
        at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:265)
        at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace

Threaded replies

·  Entity bean - Connection busy ? by alags thiags on Sun Aug 17 11:02:34 EDT 2003
  ·  Entity bean - Connection busy ? by Tim Allen MO on Sun Aug 17 12:09:54 EDT 2003
  ·  Entity bean - Connection busy ? by Sameer Boddun on Mon Aug 18 04:48:57 EDT 2003
    ·  Entity bean - Connection busy ? by alags thiags on Wed Aug 20 07:52:51 EDT 2003
      ·  Entity bean - Connection busy ? by Sameer Boddun on Fri Aug 22 04:26:00 EDT 2003
  ·  Entity bean - Connection busy ? by Ashish Srivastava on Sun Aug 24 05:39:58 EDT 2003
  Message #92805 Post reply Post reply Post reply Go to top Go to top Go to top

Entity bean - Connection busy ?

Posted by: Tim Allen MO on August 17, 2003 in response to Message #92804
Duplicate key is because you have not implemented Primark Key class properly. Make you beans unique in pool so that app server can figure out and it won`t throw Duplicate key exception.

Can specify which app server are you using ??

  Message #92821 Post reply Post reply Post reply Go to top Go to top Go to top

Entity bean - Connection busy ?

Posted by: Sameer Boddun on August 18, 2003 in response to Message #92804
> Hi friends,
>
----------------------
> The first time i try to insert a row and execute some finder methods based on the row inserted and the programe
> works fine..and then i try to run the same program again and, as expected, it
throws a Duplicate key exception..
----------------------
a. check that primary key class is oproperly defined.
b. If u have defined it properly then, check whether u have some hard coded values for promary key beacuse of which u r getting this exception.

----------------------
> the exception "java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt".(Complete stack trace attached) I just can not understand what is happening. But when i restart the server, everything is fine ie - the program inserts the row, executes finders & returns the results.
----------------------
U r using weblogic,
a) please check whether u r closing all the connection properly.
b) Look for connection pool properites and increase the Maximum Capacity of connection pool. and the value Capacity Increment is 1 or more.
If u don't know where to look for this properties. Tell me which weblogic version u r using. may be then, i can tell u where to look for them.

  Message #93037 Post reply Post reply Post reply Go to top Go to top Go to top

Entity bean - Connection busy ?

Posted by: alags thiags on August 20, 2003 in response to Message #92821
Hi ,

Thank you very much for ur inputs.

1. I get the DuplicatePrimaryKey exception becoz i use hard coded inputs and the exception is expected..but not when i run the same code, after i delete the previously inserted rows.

2. The 'Connection busy' is the problem i face. And becoz i'm using CMP my code does NOT have any connections/statements/resultsets..etc. And the connection pool inital size is set to 2 and capacity increment to 2 and max capacity to 10. I use weblogic 6.1.

I had some other inputs which says that itz becoz of SQL server - Bridge driver limitation of 1 statement for 1 connection. I'm yet to try out using another driver. Plz let me know if have anything to say.

Thanx & Regards
Alags

  Message #93284 Post reply Post reply Post reply Go to top Go to top Go to top

Entity bean - Connection busy ?

Posted by: Sameer Boddun on August 22, 2003 in response to Message #93037
> I had some other inputs which says that itz becoz of SQL server - Bridge driver limitation of 1 statement for 1 connection. I'm yet to try out using another driver. Plz let me know if have anything to say.

ur connection properties are OK, so, there could be some driver limitation. We had such problem when we were not able to make more than 5 connection, but that was with oracle and that had nothing to do with the driver. I have never worked on SQL server so, I cannot help u on that matter.

In-fact, in order to check whether ur driver has any limitation, u can check in weblogic admin console for the no of connections in connection pool. if they are 2 as u have specified. then ur driver allows to create atleast two connection. try increasing the initial of pool size and u will know whether there are any limitation associated with ur driver.

  Message #93432 Post reply Post reply Post reply Go to top Go to top Go to top

Entity bean - Connection busy ?

Posted by: Ashish Srivastava on August 24, 2003 in response to Message #92804
This problem occures while using SQL server. Do not create statements unnecessarliy or close previous unused statements and connection. Hoping this might work.

Try Daffodil DB

Recent active threads Recent active threads Recent active threads More More More
Registration for TheServerSide Java Symposium Las Vegas now open
Use Sun SPOTs as your build canary
AspectJ In Action Published; Sample Chapters Posted on TSS
WSO2 goes all RESTy
Return to previous view after user action
Return to previous view after action
Mule Data Integrator released for graphical data transformation
JSR-286 Now Posted
forward(request, response) displaying jsp in a different way
Apache Software Foundation : J2SE Project Proposed
More active threads »
Top posters of the weekTop posters of the weekTop posters of the week
This list contains the members who have made the most posts in all forums over the last 7 days:
  1. Dan Evans
  2. James Watson
  3. Chief Thrall
  4. William Louth
  5. peter veentjer
Hot threads Hot threads Hot threads More hot threads More hot threads More hot threads

Object pooling is now a serious performance loss

Brian Goetz continues to lift the lid and peak into the inner workings of Java in Java Urban Performance Legends. In this article he exposes the fallacy behind some of the more common performance myths found in the annals of the JVM.
(93 comments, last posted February 06, 2009)

Beyond Java

Bruce Tate, author of Better, Faster Lighter Java and Bitter EJB has come out with a new book called Beyond Java. Bruce has an epiphany about the future of software development. Does it include Java?
(770 comments, last posted September 23, 2009)

Three forms of AJAX: solid, liquid and gas.

Looks like today AJAX concept have several interpretations. We can distinguish different approaches of AJAX integration. Can they co-exist within the same application? Can we talk about layered AJAX integration?
(68 comments, last posted May 08, 2008)

Design-Time API Promises to make Java more like VB

Artima has published a short article describing the Design-Time API for JavaBeans, which was recently approved as JSR 273. This API promises to bring VB-like ease to Java development, but may face a cultural bias among Java developers who tend to think more in terms of class libraries than components.
(225 comments, last posted November 19, 2009)

Will Sun be that target of a management buyout?

There is plenty of speculation today regarding a potential buyout of Sun Microsystems by Scott McNealy and Silver Lake Partners. How would privatization of Sun affect Java?
(16 comments, last posted May 15, 2009)
More hot threads »

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy      Powered by JIVE
Site Map