Perhaps I'm doing something wrong, but this seems like a bug to me.
I have an intereceptor set up, and in the code below each call to session.getNamedQuery() is triggering the interceptor. The only way round appears to be to set the flushMode to commit.
Code:
Session session = sf.openSession();
Transaction tx = session.beginTransaction();
//session.setFlushMode(FlushMode.COMMIT);
MyEntityPK pk = new MyEntityPK ();
pk.setID(new Integer(1));
//Get Entity
MyEntity entity = (MyEntity ) session.load(MyEntity .class, pk);
//Make entity dirty
entity.setSomeProperty(new Integer(99));
//Exeute some named queries - each one triggers the interceptor!!??
List results = session.getNamedQuery("someQuery").list();
results = session.getNamedQuery("someOtherQuery").list();
//finish off..
tx.commit();
session.close();