This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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

 
Ranch Hand
Posts: 1723
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: 3246
287
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: 1723
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!