Hibernate version: 2.1.7
Hi there,
i hope someone can and want answer me ...
In same situations i need to do a 'select' with isolation-level repeatable read. Not always ... only sometimes.
On a AS400/DB2 you can do that by adding a 'with RR' to the select-clause.
I've tried this via HQL and a named query, but got :
Code:
Exception in thread "main" net.sf.hibernate.QueryException: unexpected token: RR [from com.test.hibernate.hql.data.TestWithRR with RR]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:101)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:142)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:295)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1571)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1542)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.test.hibernate.hql.WithRRTest.runTest(WithRRTest.java:42)
at com.iks.hibernate.hql.WithRRTest.main(WithRRTest.java:34)
My question is if it's possible at all doing it, if the sql-parser don't know it.
Or can i do it by patching the AS400Dialect? But in which method i must do that? I think it's something like the "for update" ... But i've only found a method to decide whether "for update" is possible... but not how it looks like ...
thx!
curio