• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Possible Errors SelfTest Engine (Demo)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I took the SelfTest Engine free demo (with 10 questions) and some of them seems to present wrong answers, what do you think?

You are consulting with a team that has maintained several legacy database for years. They have
reviewed the JPA spec and are wondering if the technology would offer benefits over this current
SQL base.
Which statement identifies a risk of adopting JPA?
A. JPA only works with well-known data models.
B. JPA may be able to model every table as a class.
C. JPA could render code that requires extensive SQL tuning to perform well.
D. JPA’s query language relies on a container to manage the persistence layer.
E. JPA doesn’t provides ACID semantics.
Answer: D
My Answer: C (loose of performance is the main concern regarding starting with JPA in my opinion)


You are the architect at ACME, a large a large global retailer of festival and holiday accessories.
ACME wants to launch a new shopping portal for the holiday shopping session, allowing two
months from project inception to going live. The portal must contain in-house and third-party stock
to attack customers.
Fast response times are also critical so users remain engaged and sticky to the portal.
What would you recommend to the ACME project team to deliver this project?
A. Access all third party content using JSONP to dynamically load it from the browser.
B. Access as much content with bulk-loading as possible; use JSONP to access the remainder.
C. Access all content regardless of source using the HTML 5 XML parsing capabilities of the
browser
D. Access all third party content using JSON to dynamically load it from the browser.
Answer: D
My Answer: A (By the same origin policy, it's not possible to access third party hosts using pure json, it needs to be wrapped)

You are the operations architect for a large online retailer. During peak times, your set of
monitored applications exhibits non-reproducible errors. The data center is growing at 50% per
annum, while your team headcount remains constant.
Which method would you use to implement an affective monitoring strategy?
A. Use the Visitor pattern to collect per-JVM statistics and store them centrally.
B. Use the Strategy pattern to encapsulate collection logic for each JVM.
C. Use the Thread Tracker to monitor the JVMs directly.
D. Use the Observer pattern to monitor each JVM directly.
Answer: B
My Answer: C (I am really in doubt this question, anyway, the only pattern that I know for monitoring is Thread Tracker)

Your company provides a marketplace for industrial chemicals. You are required to offer accurate
pricing and quantities to all marketplace users.
Marketplace users are globally distributed.
What is the most appropriate technology to use to satisfy this requirement?
A. Server-side distribution using JAX-WS
B. Client-side polling using JAX-RPC
C. Web services using REST
D. An enterprise messaging system
Answer: C
My Answer: A (Since performance is not explicitly declared, I would go to the most secure solution, JAX-WS which has WS-Security, avoiding Tampering for instance).
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the same doubts of the Samuel Martinucci. have someone more detail regard this questions?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

For JPA question:
A. Although JPA does not work with non-relational data models, the team uses SQL, so it is no risk in this case.
B. There are tables which maintain only relationships, those can not be mapped as a class but as relation @OneToMany or @ManyToMany.
C. JPA generates queries that could require SQL tuning but not *extensive SQL tuning*.
D. Read only queries can run with no transaction and can work in JSE.
E. Obviously wrong

In conclusion, B. is correct answer.

For the JSON question:
A. OK option.
B. same as A. but saves waiting time if a lot of contents is loaded before hand. It is a requirement "Fast response times are also critical". As it is online shop, the available stocks information is important, so information about stocks can be bulk-loading and information about availability can be loaded live with JSONP.
C. not an option
D. wrong, you already explained why.

In conclusion, B. is correct answer.

For "You are the operations architect for a large online retailer. During peak times, your set of ..." question. The Observer pattern is correct, as Thread Tracker is about tracing in log file when one names a thread.

For Marketplaces question, the Demo answer is correct. One provides information about a resource which is valid for any requesting user. All marktplaces users means a choice of generally available protocol, i.e., HTTP (as not all users afford implementing SOAP clients and with HTTP, they can just use a browser) and for security, we make it HTTPS.

Good luck!
 
Ranch Hand
Posts: 34
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont understand how the Observer Pattern would be used here? The obverser pattern is a publish-subscribe pattern, how will that be used to monitor?

Henry Freedman wrote:Hello there,

For JPA question:
A. Although JPA does not work with non-relational data models, the team uses SQL, so it is no risk in this case.
B. There are tables which maintain only relationships, those can not be mapped as a class but as relation @OneToMany or @ManyToMany.
C. JPA generates queries that could require SQL tuning but not *extensive SQL tuning*.
D. Read only queries can run with no transaction and can work in JSE.
E. Obviously wrong

In conclusion, B. is correct answer.

For the JSON question:
A. OK option.
B. same as A. but saves waiting time if a lot of contents is loaded before hand. It is a requirement "Fast response times are also critical". As it is online shop, the available stocks information is important, so information about stocks can be bulk-loading and information about availability can be loaded live with JSONP.
C. not an option
D. wrong, you already explained why.

In conclusion, B. is correct answer.

For "You are the operations architect for a large online retailer. During peak times, your set of ..." question. The Observer pattern is correct, as Thread Tracker is about tracing in log file when one names a thread.

For Marketplaces question, the Demo answer is correct. One provides information about a resource which is valid for any requesting user. All marktplaces users means a choice of generally available protocol, i.e., HTTP (as not all users afford implementing SOAP clients and with HTTP, they can just use a browser) and for security, we make it HTTPS.

Good luck!

 
Henry Freedman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Christiaan, may I please ask to minimise your quoted text to the question concerned?

The question presents the problem of "applications exhibit non-reproducible errors" and gives 4 alternatives: Visitor, Strategy, Thread Tracker, and Observer.
If one understands the patterns Visitor and Strategy, he can stricke them out. That leaves Thread Tracker and Observer.
Thread Tracker is there as trap (Threads are very close to JVMs) so one easily chooses the wrong answer. Thread Tracker is about naming threads so one can track them while debugging or in log file.

The only option left is Observer. A bean registers, with the condition, when an expected error (uncaught exception) occurs to be notified. Furthermore, using JMX Bean one can register it through JVM hook, when JVM reaches some latch (situation), say number of used threads, cpu, memory, etc., it notifies the registered bean. Here is an article http://www.ibm.com/developerworks/library/j-rtm1/ from IBM on JVM monitoring, where the explain the usage of Observer pattern: "Listening: This general data pattern is a form of the Observer pattern. The collector registers itself as a listener of events with the target PDS and receives a callback whenever the event of interest occurs."
 
Christiaan Thamm
Ranch Hand
Posts: 34
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry about that and thanks for the reply
 
Christiaan Thamm
Ranch Hand
Posts: 34
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Freedman wrote:Hello there,

For JPA question:
A. Although JPA does not work with non-relational data models, the team uses SQL, so it is no risk in this case.
B. There are tables which maintain only relationships, those can not be mapped as a class but as relation @OneToMany or @ManyToMany.
C. JPA generates queries that could require SQL tuning but not *extensive SQL tuning*.
D. Read only queries can run with no transaction and can work in JSE.
E. Obviously wrong



In my mind its either A or C. I say A because in the Enterprise Architect Exam guide it says there could be problem if "the underlying persistence layer is not on the major relational databases". The question states that its a legacy database, so thats possible.
C because possbile poor performance due to the extra layer is a very real drawback of JPA.

As with most of these questions im not 100% sure whats the correct answer!
 
Henry Freedman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question states: 'if the technology would offer benefits over this current SQL base.' SQL mapping to objects is the main function of JPA. So A. is not an option.
For C. JPA does not produce poor performance (which require extensive SQL tuning), otherwise no one will ever use it.

If you look at the options for the question, B. fits best, as I already explained. Reading some introductory material on JPA mapping shall explain it.
 
Christiaan Thamm
Ranch Hand
Posts: 34
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I respectfully disagree. How is "JPA may be able to model every table as a class." a risk? Read it again, "may be able to". Its not "it has to" or "there is no other way", its it may be able to.

The question is not as you say "if the tech would offer benefits", the question is why could JPA be a risk. Theres a big difference, and in that regard option B makes no sense. I dont need to read introductory material to JPA as
you so condescendingly suggested, i work with it every day and i got 97% on the certification a few months back

Allow me to quote for you what comes directly out of the exam guide by oracle press:

The drawbacks of JPA include the following:
- There is potential for sub-optimal performance. The generated SQL statements may not perform as needed because of the data store design and implementation.
- If the existing implementation in not using JPA and you need to extend functionality in a minor way, a rewrite of the entire tier to use JPA is typically not permitted or justified
- If the underlying persistence layer is not supported sufficiently by the JPA implementation. This occurs mostly when the persistence layer is not one of the major relational databases.

Thats why is said i believe the answer is A or C, just not sure which one
 
Henry Freedman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No need to take things personally. I also have most of expert level JEE 6 certificates (including JPA) and did the JEE Architect certificate too.

let us go ahead and quote the original question:


You are consulting with a team that has maintained several legacy database for years. They have
reviewed the JPA spec and are wondering if the technology would offer benefits over this current
SQL base.

Which statement identifies a risk of adopting JPA?

A. JPA only works with well-known data models.
B. JPA may not be able to model every table as a class.
C. JPA could render code that requires extensive SQL tuning to perform well.
D. JPA’s query language relies on a container to manage the persistence layer.
E. JPA doesn’t provides ACID semantics.



We agree that D. nor E. is a valid option. So it is either A., B., or C.

A. Although, the statement is correct in general, however since the current base is SQL, this is not a risk.
B. There are tables which maintain only relationships, those can not be mapped as a class but as relation @OneToMany or @ManyToMany.
C. JPA generates queries that could require SQL tuning but not extensive one.

Evaluate B. vs C., B. is so factual, as each database has entities with one-to-many and many-to-many relationships reflected by tables and those tables are not mapped as classes.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://coderanch.com/t/665266/java-programmer-OCPJP/certification/OCJP-Exams#3099271
 
reply
    Bookmark Topic Watch Topic
  • New Topic