-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standard name and value for "read-only" query hint #62
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@mkarg Commented |
|
@mkarg I was the original reporter. |
Hibernate has a very similar feature, with a very similar semantic. So this is definitely something we should discuss standardizing at some stage. (However, I would advocate doing it in a more typesafe way, not via a stringly-typed hint.) |
For example, if #454 goes through, it could be a |
Actually, if #454 does go through, I think we should even consider including this in 3.2. |
Well, it did not make it into 3.2, but H7 introduces a |
finally addresses issue jakartaee#62 Signed-off-by: Gavin King <[email protected]>
finally addresses issue jakartaee#62 Signed-off-by: Gavin King <[email protected]>
In #668 I have proposed There are two open issues here:
|
A third question is:
|
Relational databases typically benefit from the knowledge, whether a transation will potentially modify and information (so locks are needed), or only read-only queries are executed (so no locks are needed). For similar reason, EclipseLink (and hopefully other JPA implementations, too) know query hints for "ready-only".
Unfortunately when using such vendor-specific hints, this will induce the problem that a portable application must know all these hints for all JPA implementations (or there will be no Performance gain for the unknown ones). This is not smart from the view of an ISV.
Hence I want to propose that the next maintenance release of the JPA specification defines a unique name and value to enable the read-only query mode independently of the actual JPA implementation.
Proposal: A compliant implementation which has a read-only query mode MUST enable this read-only query mode when the "javax.persistence.readonly" with a value of "true" is provided.
The text was updated successfully, but these errors were encountered: