Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9009007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:05:16+00:00 2026-06-16T02:05:16+00:00

I have Java Spring application running in a jetty-maven plugin. When I call a

  • 0

I have Java Spring application running in a jetty-maven plugin. When I call a myBatis insert statement, the statement is automatically committed. However, when I call update, the statement is not committed. Per the myBatis documentation (http://www.mybatis.org/spring/transactions.html):

You cannot call SqlSession.commit(), SqlSession.rollback() or SqlSession.close() over a Spring managed SqlSession.

How do I configure my application to auto commit on a myBatis update statement?

I enabled logging. Here is what the log states on updates:

2012-12-12 17:20:31,669 DEBUG [org.mybatis.spring.SqlSessionUtils] – Creating a new SqlSession
2012-12-12 17:20:31,669 DEBUG [org.mybatis.spring.SqlSessionUtils] – SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@19e86f9] was not registered for synchronization because synchronization is not active
2012-12-12 17:20:31,669 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] – Fetching JDBC Connection from DataSource
2012-12-12 17:20:31,669 DEBUG [org.springframework.jdbc.datasource.DriverManagerDataSource] – Creating new JDBC DriverManager Connection to [jdbc:jtds:sqlserver://test/test]
2012-12-12 17:20:31,684 DEBUG [org.mybatis.spring.transaction.SpringManagedTransaction] – JDBC Connection [net.sourceforge.jtds.jdbc.ConnectionJDBC3@af7eaf] will not be managed by Spring
2012-12-12 17:20:31,684 DEBUG [com.persistence.MyMapper.updateMyItem] – ooo Using Connection [net.sourceforge.jtds.jdbc.ConnectionJDBC3@af7eaf]
2012-12-12 17:20:31,684 DEBUG [com.persistence.MyMapper.updateMyItem] – ==> Preparing: update myTable set date=? where id=?
2012-12-12 17:20:31,700 DEBUG [com.persistence.MyMapper.updateMyItem] – ==> Parameters: 2012-11-26 00:00:00.0(Timestamp), 0(Integer)
2012-12-12 17:20:31,700 DEBUG [org.mybatis.spring.SqlSessionUtils] – Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@19e86f9]
2012-12-12 17:20:31,700 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] – Returning JDBC Connection to DataSource

On insert, the log is:

2012-12-12 16:35:53,932 DEBUG [org.mybatis.spring.SqlSessionUtils] – Creating a new SqlSession
2012-12-12 16:35:53,932 DEBUG [org.mybatis.spring.SqlSessionUtils] – SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22da8f] was not registered for synchronization because synchronization is not active
2012-12-12 16:35:53,932 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] – Fetching JDBC Connection from DataSource
2012-12-12 16:35:53,932 DEBUG [org.springframework.jdbc.datasource.DriverManagerDataSource] – Creating new JDBC DriverManager Connection to [jdbc:jtds:sqlserver://test/test]
2012-12-12 16:35:53,932 DEBUG [org.mybatis.spring.transaction.SpringManagedTransaction] – JDBC Connection [net.sourceforge.jtds.jdbc.ConnectionJDBC3@3af3cb] will not be managed by Spring
2012-12-12 16:35:53,932 DEBUG [com..persistence.MyMapper.insertMyItem] – ooo Using Connection [net.sourceforge.jtds.jdbc.ConnectionJDBC3@3af3cb]
2012-12-12 16:35:53,932 DEBUG [com.persistence.MyMapper.insertMyItem] – ==> Preparing: insert into myTable (id,date) values (?, ?)
2012-12-12 16:35:53,932 DEBUG [com.persistence.MyMapper.insertMyItem] – ==> Parameters: 5(Integer), 2012-11-26 00:00:00.0(Timestamp)
2012-12-12 16:35:53,932 DEBUG [org.mybatis.spring.SqlSessionUtils] – Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22da8f]
2012-12-12 16:35:53,932 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] – Returning JDBC Connection to DataSource

The insert and update log statements seem to indicate the same basic steps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:05:18+00:00Added an answer on June 16, 2026 at 2:05 am

    After a bit more research, I found that it was a client issue. It was always passing a 0 for the id in the update statement. The records have ids > 0. Along the way, I configured spring txn management. It was at that point that I observed the same behavior and realized it must be something other than server side configuration issue. Sorry about not catching that prior to posting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application, built with Maven, consisting of a Java (Spring) backend
I have a Java Web Application using Spring and running in Glassfish 3.1.2 and
I have a web application running on Java stack (Struts 2 + Spring +
I have a Java application that uses Spring/Hibernate (running on Amazon Elastic Beanstalk) with
In my Java spring application I have a form with Region drop down. On
I have stand alone Java Application with Spring 3.0. I am calling REST service
We have a spring-enabled java desktop application started through Java Web Start. The JNLP
I have a web application running in tomcat where I'm using a ThreadPool (Java
I have an spring-hibernate web application running on tomcat server version 7.0.25 with jdk
I have a Java web application connecting to an Oracle database running on another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.