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 9247489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:44:28+00:00 2026-06-18T09:44:28+00:00

Using hibernate in my application, and everytime I do a transaction, I get this

  • 0

Using hibernate in my application, and everytime I do a transaction, I get this warning. It is spamming my logs.

JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()

I think it is caused by hibernate.current_session_context_classproperty.

<hibernate-configuration>
<session-factory>
    <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
    <property name="hibernate.connection.pool_size">5</property>
    <property name="show_sql">false</property>
    <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
    <property name="hibernate.current_session_context_class">jta</property>

    <mapping class="foo.bar.Class1" />
    <mapping class="foo.bar.Class2" />
    <mapping class="foo.bar.Class3" />
    <mapping class="foo.bar.Class4" />
    <mapping class="foo.bar.Class5" />
</session-factory>

Is it something I should be worried about? If not, how can I stop the warning from appearing.

  • 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-18T09:44:29+00:00Added an answer on June 18, 2026 at 9:44 am

    As far as I’m aware,it is not possible to configure Hibernate JPA with JTA support using Spring unless you provide a persistence.xml in order to configure the datasource as JTA.
    Perhaps some thing like this will help you get rid of the warning:

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="something" transaction-type="JTA">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>blah blah</jta-data-source>
            <properties>
                <property name="hibernate.archive.autodetection" value="class"/>
                <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
                <property name="hibernate.hbm2ddl.auto" value="update"/>
                <property name="hibernate.current_session_context_class" value="jta"/>
                <property name="hibernate.transaction.manager_lookup_class" value="blah blah"/>
                <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>          
                <property name="hibernate.connection.release_mode" value="after_statement"/>
            </properties>
        </persistence-unit>
    </persistence>
    

    I would also suggest you to disable allowLocalTransactions so that your code will run as transactional all the time.

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

Sidebar

Related Questions

This is a JavaEE6 application using Hibernate and PostgreSQL. Users are created in the
I am using hibernate and spring for my web application. In this at some
WHen deploying my Spring / Hibernate application, I get the following warning related to
I'm attempting to build a JSF/Hibernate application using Java 7 and Tomcat 7. I
I am creating a Spring MVC Hibernate application using MySQL. Where should I save
Today I was trying to create a application using Hibernate as ORM. So while
I am using spring/hibernate stand alone application. if i dont configure Transactions i am
I am using Hibernate 3 version for my Application . While going through tutorials
I am using hibernate 3.2.2 in my application. For connection pooling, we are using
I'm using Hibernate in a Java application, and i feel that something could be

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.