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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:18:53+00:00 2026-05-20T21:18:53+00:00

I am trying to create transaction manager and use it with Hibernate for Oracle.

  • 0

I am trying to create transaction manager and use it with Hibernate for Oracle.

My persistence.xml file is:

<persistence-unit name="org.drools.persistence.jpa"
        transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/testDS1</jta-data-source>
        <class>org.drools.persistence.session.SessionInfo</class>
        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
        <class>org.drools.persistence.processinstance.WorkItemInfo</class>

        <exclude-unlisted-classes>true</exclude-unlisted-classes>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
            <property name="hibernate.connection.autocommit" value="false" />
            <property name="hibernate.max_fetch_depth" value="3" />
            <property name="hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory"/> 
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.transaction.manager_lookup_class"
                value="org.hibernate.transaction.BTMTransactionManagerLookup" />
        </properties>
    </persistence-unit>

In applicationContext.xml of spring I added:

<bean id="dataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close"> 
           <property name="className" value="oracle.jdbc.xa.client.OracleXADataSource" /> 
           <property name="uniqueName" value="jdbc/testDS1" /> 
           <property name="minPoolSize" value="1" /> 
           <property name="maxPoolSize" value="5" /> 
           <property name="driverProperties">
            <props>
                <prop key="URL">myURL</prop>
                <prop key="user">username</prop>
                <prop key="password">password</prop>
            </props>
        </property>       
    </bean> 

    <bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"> 
        <property name="transactionManager" ref="bitronixTransactionManager"/> 
        <property name="userTransaction" ref="bitronixTransactionManager"/> 
    </bean> 

    <bean id="bitronixTransactionManager" factory-method="getTransactionManager" 
          class="bitronix.tm.TransactionManagerServices" depends-on="dataSource,txManager" 
          destroy-method="shutdown"/>

However, when I run:

EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");

I get an exception:

Caused by: org.hibernate.HibernateException: Could not find datasource: jdbc/testDS1

The exception is on ds = (DataSource ) NamingHelper.getInitialContext(props).lookup(jndiName); of Hibernate infra file.

  1. What could be the problem?

  2. How does Hibernate persistence knows to refer to spring txManager bean?

  • 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-05-20T21:18:54+00:00Added an answer on May 20, 2026 at 9:18 pm

    Your persistence provider does its lookups on jndi. Data sources defined in Spring application context are not bound to jndi. Hence, persistence provider’s lookup attempt for the data source fails as there is no such data source bound to jndi.

    You may want to check http://forum.springsource.org/showthread.php?t=13984.

    Can you try defining your data sources in the server context and looking them up in your spring application by their jndi names?

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

Sidebar

Related Questions

I'm trying to create an ado.net transaction in IronPython in asp.net and I'm getting
I have 3 tables: user_transaction, transaction and users I am trying to create a
Currently im trying out the application managed persistence context, by creating the entity manager
I'm trying to create a transaction history for each transaction on a Django based
Trying to create an Oracle trigger that runs after a table is updated in
I'm trying to create a table using SMO, and further use the SqlBulkCopy object
I'm trying to create a datasource in JBOSS 7. My standalone.xml excerpts: <subsystem xmlns=urn:jboss:domain:datasources:1.0>
I am trying to create an Entity manager to persist a object. Here is
I am trying to configure Spring3 + JPA using Hibernate, but I am getting
I'm trying to create a two dimensional array like this... @transactions = {} @expenses.each

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.