Jdbc Transaction

Hi,
I am using Jdbc txn ang getting this error. Please guide me.
A part of log file is here::

Caused by: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: socket write error
	at org.apache.ibatis.transaction.jdbc.JdbcTransaction.setDesiredAutoCommit(JdbcTransaction.java:105)
	at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:138)
	at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:61)
	at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279)
	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:72)
	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47)
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)
	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:71)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)

cheers,
Jauhari

that depends on jdbc driver. try to use the new.

Hi @jauhari,

Could you please include the environment you are using like

  • application server
  • database driver
  • jdk version
  • spring / cdi

Cheers,
Christian

  • application server–>Tomcat8
  • database driver–>sqljdbc4 (microsoft sql)
  • jdk version–>1.8.0_121
  • spring / cdi–>Not using spring

cheers,
Jauhari

@hawky4s
application server–>Tomcat8
database driver–>sqljdbc4 (microsoft sql)
jdk version–>1.8.0_121
spring / cdi–>Not using spring
cheers,
Jauhari

The database configuration for Tomcat we use in our CI is following:

<Resource name="jdbc/ProcessEngine"
             auth="Container"
             type="javax.sql.DataSource" 
             factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
             uniqueResourceName="process-engine"
             driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
             url="jdbc:sqlserver://localhost:1433;DatabaseName=process-engine"
             username="${database.username}"
             password="${database.password}"
             defaultTransactionIsolation="READ_COMMITTED"
             maxActive="20"
             minIdle="5" />

Does you one looks different in points of options being used? (not database host / url etc.)
Also could you please post the whole stacktrace.

Cheers,
Christian

@hawky4s

my db config is here::

              auth="Container"
              type="javax.sql.DataSource" 
              factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
              uniqueResourceName="process-engine"
              driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
              url="jdbc:sqlserver://10.223.65.182:1433;databaseName=DCS_ECONTRACT;MVCC=TRUE;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE"
              username="iDCS_USER"  
              password="iDCS_USER"  
               />

@hawky4s
and log file is here:
catalina.2017-02-01.log (1.3 MB)

Hi @jauhari,

could you try to add username and password to your connection url? So that it looks somewhat like this

jdbc:sqlserver://machine:1433;instance=SQLEXPRESS;databaseName=db;user=USERNAME;password=PASSWORD

Cheers,
Askar