Hi, this is my first project which using Microsoft SQL Server 2000.
I already developed few project which are used MySQL as database.
Found a serious problem at SQL Server 2000,
I can insert new record in the database, but
when i update a object X with calling
session.update(X) and
session.commit()...
Exception throwing...
The message as below:
Full stack trace of any exception that occurs: 11:50:48,781 ERROR JDBCExceptionReporter:58 - [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode. 11:50:48,796 ERROR SessionImpl:2400 - Could not synchronize database state with session
net.sf.hibernate.exception.JDBCConnectionException: could not update: [com.vsi.beans.datas.Test#123456] at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:681) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:621) at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2393) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at TestMain.main(TestMain.java:63) Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.mchange.v2.c3p0.stmt.GooGooStatementCache$2.run(GooGooStatementCache.java:325) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:148)
Here are my specs:
Hibernate 2.1.8
Tomcat 5.0.5
jdk 1.4.03
Microsoft SQL 2000 server.
MS SQL 2000 JDBC Driver (SQL 2000 server with service pack 3)
msbase.jar
mssqlserver.jar
msutil.jar
I'm using C3P0 as my connection pooling
hibernate.properties
hibernate.c3p0.min_size=2
hibernate.c3p0.max_size=15
hibernate.c3p0.timeout=300
hibernate.c3p0.max_statements=50
hibernate.c3p0.idle_test_period=3000
hibernate.cglib.use_reflection_optimizer=true
hibernate.cfg.xml
<property name="connection.username">sa</property>
<property name="connection.url">jdbc:microsoft:sqlserver://localhost;DatabaseName=newera;SendStringParametersAsUnicode=true</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="connection.password">sa</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
Is it posible cause by my connection pooling setting?
How about change to Apache DBCP?
Thanks.
|