About Question enthuware.oce-jpad.v6.2.419 :

Moderator: admin

Post Reply
stiekemaj
Posts: 8
Joined: Sun Jan 25, 2015 6:08 am
Contact:

About Question enthuware.oce-jpad.v6.2.419 :

Post by stiekemaj »

In this question, it is not clear whether the entity manager is a transaction-scoped or extended-scoped. When the entity manager is transaction-scoped, the correct answer will be 'X', because on line 6, the entity is unmanaged.

I've seen this kind of question earlier where the scope of the entity manager is not clear. When we see this kind of questions on the real exam, can we expect that the entity manager is always extended-scoped?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.419 :

Post by admin »

The last line of the problem statement does say, "(Assume that extended scoped EntityManager is used.)". Please let me know if you are not seeing this line in your viewer.

In the exam, if the answer depends on the type of the entity manager, the question will specify that. If it is not specified, then you should assume that it could be either one and you should select the option that is correct for both the cases.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

romsky
Posts: 39
Joined: Thu Jan 29, 2015 4:49 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.419 :

Post by romsky »

I see the question in that form:

Consider the following entity code: @Entity public class LifecycleCallbackTestEntity implements Serializable { // attributes and accessor methods not shown @PrePersist public void m1(){ System.out.println("X"); } @PreUpdate public void m2(){ System.out.println("Y"); } } What will be printed when an application performs the following steps - 1. Creates the entity 2. Begins a transaction 3. Persists the entity 4. Commits the transaction 5. Begins another transaction 6. Updates the entity 7. Commits the transaction. (Assume that extended scoped EntityManager is used.)

The Java code has to be formatted.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.419 :

Post by admin »

Attached is what I see. Could you please mention your platform details so that I can investigate?

-Paul.
test.png
test.png (21.92 KiB) Viewed 4009 times
If you like our products and services, please help us by posting your review here.

romsky
Posts: 39
Joined: Thu Jan 29, 2015 4:49 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.419 :

Post by romsky »

I use moc-exam on MacOS.

vromanov@romsky-apple:~/Exam $ java -jar etsviewer.jar
JVM Vendor : Oracle Corporation
JVM VM Vendor : Oracle Corporation
JVM Version: 1.8.0_05
Java User Dir: /Users/vromanov/Exam
OS: Mac OS X
user.name: vromanov
user.home: /Users/vromanov
-DfontSizeIncrement=null
-DuseAWTFileDialog=null
-Dswing.defaultlaf=null
L&F In Use : [Aqua Look and Feel for Mac OS X - com.apple.laf.AquaLookAndFeel]
ETS_INIT: INITED
User Data Dir: /Users/vromanov/cefdex/JAVA/ETSWF_com_enthuware_ets_oca-jp-i_v7
User Data Dir: /Users/vromanov/Exam/ETSWF_com_enthuware_ets_oce-jpad_v6
Created QDWin

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests