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

Moderator: admin

Post Reply
M_Z

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

Post by M_Z » Fri Mar 16, 2012 4:32 pm

I think explanation for option B (which I agree is wrong) is not accurate:

currently it says that "The persistence provide may implement ...", while specification says: "...the persistence provider is responsible..." (i.e. not "may" but "must")

I believe that option B is mainly wrong because of: not all updates are flushed to DB before nexty query run (as written in the option), but only which could potentially affect the result of the query and not flushed, but made visible (i.e. flush to DB or make changes in some way in local cache).

P.S. btw, a typo in word "provide" (persistence provide may)

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

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

Post by admin » Fri Mar 16, 2012 5:04 pm

I think the given explanation is correct. Here is what the specification says,
the persistence provider is responsible for ensuring that all updates to the state of all entities in the persistence context which could potentially affect the result of the query are visible to the processing of the query. The persistence provider implementation may achieve this by flushing those entities to the database or by some other means.
So the PP is responsible to make sure that the results of the updates are visible to the next query. But it may achieve this either by flushing to db or by any other means.

So even the entities that could potentially affect the result of the query may not necessarily be flushed to db. The PP is only responsible to make sure that the changes are be visible to the next query.

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

johnlong
Posts: 185
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong » Sat Dec 24, 2016 5:21 pm

The query should be executed after calling flush() on the entity manager so that the updates on the entities done prior to the execution of the query are visible in the query result.
Explanation says : "it is not required", however question was not whether it is required or not, but "what describes behavior", and in this case behavior described correctly.

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

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

Post by admin » Sun Dec 25, 2016 12:26 pm

The option says, "The query should be...". You agree that it is not required i.e. there is no need to call flush. So how is this a description of the correct behavior?
The correct behavior is that updates done on the entities done prior to the execution of the query are visible in the query result irrespective of whether you call flush before firing the query or not.
If you like our products and services, please help us by posting your review here.

johnlong
Posts: 185
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong » Sun Dec 25, 2016 6:23 pm

Code: Select all

So how is this a description of the correct behavior?
It depends on context, if we have given limited choices, that might be a correct choice, instead of just giving up.
I think it is subjective, thank you for your reply.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest