This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

my exam cloud mock 2, modifying persistence.xml to make the persistence unit JEE compliant.  RSS feed

 
Ranch Hand
Posts: 1708
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer to the attached diagrams.
I think A is also needed as we are using the jta datasource in JEE container instead of using J2SE.
So, I think A and B are needed.
Question.JPG
[Thumbnail for Question.JPG]
Question
Answer.JPG
[Thumbnail for Answer.JPG]
Answer
sample_persistenceXML.JPG
[Thumbnail for sample_persistenceXML.JPG]
Sample persistence.xml
 
Creator of Enthuware JWS+ V6
Posts: 3218
283
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So, I think A and B are needed.


A is not required according to the specs:

8.2.1.5 jta-data-source, non-jta-data-source
In Java EE environments, the jta-data-source and non-jta-data-source elements are used to specify the global JNDI name of the JTA and/or non-JTA data source to be used by the persistence provider. If neither is specified, the deployer must specify a JTA data source at deployment or a JTA data source must be provided by the container, and a JTA EntityManagerFactory will be created to correspond to it.

 
Himai Minh
Ranch Hand
Posts: 1708
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer should be C as the application is deployed in multiple J2EE containers and we should remove all vendor specific properties.
Regarding to B,  Java EE environment can support Resource Local transaction type.


8.2.1.2 Transaction type
...
In general, in Java EE environments, a transaction-type of RESOURCE_LOCAL assumes that non-JTA datasource will be provided. ...



7.5 Controlling Transactions
Both JTA entity manager and resource local entity managers are required to be supported in Java EE web containers and EJB container.



So, if that application in the question uses resource local transaction, Java EE container will support it. We don't need to remove Transaction_Type=RESOURCE_LOCAL in the persistence.xml.
 
The moustache of a titan! The ad of a flea:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!