• 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

Entity bean - Connection busy ?!

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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 program 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
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparently this is caused by a well-known SQL Server ODBC Driver limitation such that only one active Statement is allowed on a single Connection. AFAIK, there is no known work around for this limitation except to ensure all Statements and ResultSets are properly closed. Unfortunately, this is out of your control since you are using CMP.
My recommendation is to abandon the JDBC-ODBC Bridge Driver and use a straight SQL Server 2000 JDBC Driver. Microsoft offers a free type 4 JDBC driver for SQL Server 2000 on their website.
 
JAlagapan Thiagarajan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Chris.
Regards
Alags
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's worth my 2 cents - I agree. The JDBC-ODBC driver is not wirth a production app. Just look at what it does with an empty resultset returned from a SQL statement!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic