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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:41:42+00:00 2026-06-12T13:41:42+00:00

I downloaded a sample app which uses Hibernate and JPA the issue is the

  • 0

I downloaded a sample app which uses Hibernate and JPA the issue is the persistence unit. It seems I can use either <persistence-unit name="hibernatePersistenceUnit" transaction-type="RESOURCE_LOCAL"> or <persistence-unit name="hibernatePersistenceUnit" transaction-type="JTA">
from my research I found that if I use the first I also have to specify <non-jta-data-source> and with the second <jta-data-source> (I think that is right but correct me if I am wrong)

I think the first one implies that the url,driver,user, pwd will be configured within the web-app. And the second one will look for the source via JNDI in the container (Again correct me if I wrong)
But the value which I need to specify for that property is my stumbling block.
I have seen jdbc:sampleDS, java:sampleDS. (Are these also jndi lookups? Haven’t seen jndi:sampleDS) So should it be jdbc: or java: or jndi: and are these all “JNDI”?

And the “sampleDS” what does that name actually refer to? In other words does it refer to a bean name (I am using spring and my bean which configures the datasource information is called jpaDataSource) if I use resource_local or does it refer to a jndi resource somewhere on the application server, JBOSS for instance, or something else I am not aware of?

  • 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-12T13:41:44+00:00Added an answer on June 12, 2026 at 1:41 pm

    RESOURCE_LOCAL you use if you don’t need global transactions (transaction spanning multiple persistence units i.e. databases) or JNDI defined datasources, if you need global transactions you must use JTA which in turn requires that you use JNDI datasources as they reside within the application server which is the one that can handle global transactions.

    JNDI datasources are configured in the application server – in case of JBOSS either in the configuration/standalone.xml or with *-ds.xml files in the deployments folder.

    java:sampleDS is a JNDI name, example mssql-ds.xml file:

    <?xml version="1.0" encoding="UTF-8"?> 
    <datasources>
      <datasource jndi-name="java:jboss/datasources/myDatabase" pool-name="myDatabase" enabled="true" jta="true" use-java-context="true" use-ccm="true">
        <connection-url>
            jdbc:sqlserver://localhost;databaseName=myDatabase
        </connection-url>
        <driver>
            sqljdbc
        </driver>
        <security>
            <user-name>
                myusername
            </user-name>
            <password>
                mypassword
            </password>
        </security>
      </datasource>
    <datasources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sample app which i downloaded from net In this i was
I downloaded a mouse hook sample, which didn't work. So I stripped all the
I am trying to use the Bluetooth Chat sample API app that google provides
i have a simple iPhone app (*.ipa), which downloaded from AppStore. I have changed
I have a content based, read-only iPhone app. Users can select favorite topics, which
Ref: Android encryption/decryption issue (AES) I am building an android app which requires aes
I wrote an app in C++, and downloaded some samples code from the internet
I have downloaded sample code from Apple Center.I also have gone through following question:
I'm signed up, I've downloaded sample code, I've got a WSDL...and yet I have
I have downloaded the sample code from this site for FTP Client http://www.lysesoft.com/products/andftp/index.html But

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.