tags:

views:

99

answers:

2

When querying for a object by id or returning a list of objects using Hibernate, is it possible to tell hibernate to retrieve the object(s) in transient state.

I don't want to track any changes at all, this is a read only type query and speed is of essence.

+1  A: 

https://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html

setReadOnly(Object, boolean)

Pindatjuh
+1  A: 

You can also use StatelessSession:https://www.hibernate.org/hib_docs/v3/api/org/hibernate/StatelessSession.html

Viktor Klang