Hello,
Thank you for this answer.
I am in the same situation. The DB administrator thinks I should use RAD READ ONLY of every select request that we identified.
I am using DB2 9.7 and hibernate 4.3.1. I tried to resue the code given above. The DB2 dialect has no getDatabaseReadOnlyString method. Is this supported in hibernate 4.3.1 .
How can I use a custom interceptor with an entity manager (because I use the enetity entity manager way of doing things) ? Most exemples use Interceptor with a Session, but I have no explicit Session, because I use the EntityManager.
The 2 following solutions do not work for me : if in the final generated SQL query I have no READ ONLY keyword: query.setHint("org.hibernate.readOnly", true); query.setLockMode(LockModeType.READ);
What I try to do is: Instead of a NameQuery who generates: Select SITE.NAME from SITE I want to have Select SITE.NAME from SITE FOR READ ONLY
Thank you very much
|