• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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

 
Ranch Hand
Posts: 1703
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
Bartender
Posts: 3143
276
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: 1703
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!