|
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 ?
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
|
|
Message #92805
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Entity bean - Connection busy ?
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 ?
> 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 ?
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 ?
> 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 ?
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
|
|
 |
Hot threads
Hot threads
Hot threads
|
More hot threads
More hot threads
More hot threads
|
 |
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)
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)
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)
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)
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 »
|
|