Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.sql.SQLException:[...]Can't start a cloned connection while in manual transaction mode

47 views
Skip to first unread message

Andrei

unread,
Mar 13, 2002, 11:51:21 AM3/13/02
to
I've installed MS JDBC driver instead of Weblogic driver
(weblogic.jdbc.mssqlserver4.Driver) in a real (well, in development stage)
EJB application.
Everything worked fine until I've tried to run a transaction.

One CMP-EJB "UserBeanCMP" depends on the second CMP-EJB "AddressBeanCMP".
(they persist in two referenced tables )

And when the second EJB is trying to load its state from DB it hits the
following exception.
(With weblogic driver this never happened!)

java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Can't start a
cloned connection while in manual transaction mode.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.setupImplConnection(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.<init>(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.<init>(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._lo.prepareStatement(Unknown
Source)
at com.evermind[Orion/1.5.2 (build 10460)]._lo.prepareStatement(Unknown
Source)
at com.evermind[Orion/1.5.2 (build
10460)].server.ejb.DataSourceConnection.getCustomStatement(Unknown Source)
at
AddressRemote_EntityBeanWrapper11.loadState(AddressRemote_EntityBeanWrapper1
1.java:2954)
at
AddressHome_EntityHomeWrapper15.findExistingEntity(AddressHome_EntityHomeWra
pper15.java:34)
at
AddressHome_EntityHomeWrapper15.findByPrimaryKey(AddressHome_EntityHomeWrapp
er15.java:274)
at
ca.jvl.games.ejb.registration.UserBeanCMP.loadAddress(UserBeanCMP.java:66)
at ca.jvl.games.ejb.registration.UserBeanCMP.ejbLoad(UserBeanCMP.java:54)
at
UserHome_EntityHomeWrapper35.findByNickname(UserHome_EntityHomeWrapper35.jav
a:1650)
at
ca.jvl.games.ejb.registration.UserControllerBean.getUserDetails(UserControll
erBean.java:36)
at
UserController_StatelessSessionBeanWrapper31.getUserDetails(UserController_S
tatelessSessionBeanWrapper31.java:66)
at ca.jvl.games.web.UserManagerEJB.Load(UserManagerEJB.java:39)
at ca.jvl.games.web.UserManagerEJB.checkLogon(UserManagerEJB.java:101)
at ca.jvl.games.web.SigninAction.perform(SigninAction.java:51)
at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1786)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:211)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Orion/1.5.2 (build 10460)]._cxb._abe(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._cxb._uec(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._io._twc(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._io._gc(Unknown Source)
at com.evermind[Orion/1.5.2 (build 10460)]._if.run(Unknown Source)


sanjay

unread,
Mar 13, 2002, 1:32:17 PM3/13/02
to
It does not work with websphere either. I am having
problem with JTA and this driver with websphere.
> at com.evermind[Orion/1.5.2 (build 10460)]._cxb._uec
(Unknown Source)
> at com.evermind[Orion/1.5.2 (build 10460)]._io._twc
(Unknown Source)
> at com.evermind[Orion/1.5.2 (build 10460)]._io._gc
(Unknown Source)
> at com.evermind[Orion/1.5.2 (build 10460)]._if.run
(Unknown Source)
>
>
>
>
>.
>

Sridhar Paladugu

unread,
Mar 13, 2002, 1:53:26 PM3/13/02
to
Hi,

Use the following url style

url = "jdbc:microsoft:sqlserver://127.0.0.1:1433;SelectMethod=cursor"

Thanks,

Sridhar Paladugu
Microsoft Developer Support
JDBC Webdata


This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Strategic Technology Protection
Program and to order
your FREE Security Tool Kit, please visit
<http://www.microsoft.com/security>.


Andrei

unread,
Mar 13, 2002, 2:37:13 PM3/13/02
to
It has worked out!
Thank you!

Andrei


"Sridhar Paladugu" <sr...@online.microsoft.com> wrote in message
news:2QkIOBsyBHA.1444@cpmsftngxa08...

Sridhar Paladugu

unread,
Mar 14, 2002, 8:47:47 AM3/14/02
to
Hi,
If you pass "SelectMethod=cursor" attribute in connectio url, will allow more
than one active statement per connection.
" jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;","user","pwd"

The reason for this is;

When SelectMethod is set to direct, SQL Server does not support multiple active
statements on a single connection within a transaction; however, when
auto-commit mode is enabled (the default), the Microsoft SQL Server JDBC driver
provides the ability to have multiple JDBC statements open on a single JDBC
connection. This is done by cloning physical SQL Server connections as needed.
To avoid cloning physical SQL Server connections in this circumstance, you
should create only one Statement, PreparedStatement, CallableStatement, or
DatabaseMetaData object per JDBC Connection object. Be sure to invoke the
"close" methods on these objects when you are finished with them, that is,
before creating another object of the types described.

0 new messages