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

  • Home
  • SEARCH
  • 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 7828863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:30:46+00:00 2026-06-02T10:30:46+00:00

I am using datasource to connect to Oracle database and insert data. Below is

  • 0

I am using datasource to connect to Oracle database and insert data.
Below is my hibernate config entry:


<hibernate-configuration>
    <session-factory>
        <property name="connection.datasource">jdbc/LOCAL_ORACLE</property>
        <property name="hibernate.format_sql">true</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
        <property name="current_session_context_class">thread</property>
        <property name="hibernate.current_session_context_class">thread</property>
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>   
    </session-factory>
</hibernate-configuration>

Below is the code snippet which saves the data.



final Configuration cfg = new Configuration().addResource("SampleTable.hbm.xml").configure();
final ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry();
sessionFactory = cfg.buildSessionFactory(serviceRegistry);
session = sessionFactory.openSession();
txn = session.beginTransaction();
session.save(cs90spTransDetails);
txn.commit(); 

The issue I am facing is when txn.commit() is called hibernate throws the below error:


[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R Caused by: org.hibernate.TransactionException: unable to commit against JDBC connection
[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R     at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:116)
[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R     at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:178)
[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R     ... 13 more
[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R Caused by: java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R     at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.commit(WSJdbcConnection.java:1064)
[4/24/12 19:25:13:675 IST] 0000001a SystemErr     R     at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:112)

NOTE: The above code works fine if I use hibernate.connection.driver_class and hibernate.connection.url to connect to database. Data gets stored in the database without any issues.

I am sure I am doing something wrong, which I am not able to figure out. Can someone tell me what I am missing.

Thank You.
Jay Chandran.

  • 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-02T10:30:49+00:00Added an answer on June 2, 2026 at 10:30 am

    As far as I can see datasource obtained from the application server is configured to participate in container-managed transactions.

    Therefore you need to configure Hibernate to use these transactions (see 3.9.1. Transaction strategy configuration and 3.9.3. Current Session context management with JTA), and don’t need to manage transactions manually.

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

Sidebar

Related Questions

I am using JPA with hibernate and trying to connect to the a datasource
I'm using the current version of ODP.NET and trying to connect to an Oracle
I have a single thread trying to connect to a database using JDBCTemplate as
I'm connecting to an Oracle database with SQL Developer, the connection data was provided
I'm trying to connect to a MySQL database using my ASP.NET Web Forms Application.
Im using this code to connect to access 2007 database : public void RetrieveData(){
My goal is to connect to my database either manually or using an sqladapater,
I am using below statement for database in tomcat context.xml. Some time it works
We are using Oracle SOA Suite 11g and the Datasource that is used by
I am trying to connect to a remote MySQL database using Visual C# 2008

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.