-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Evaluate if an entity satisfies the "where" clause in HQL
PostPosted: Tue Nov 05, 2013 5:42 am 
Newbie

Joined: Tue Nov 05, 2013 5:31 am
Posts: 1
Hi,

I'm writing a bit of tooling so that my app defaults to bulk HQL deletes where possible. This is to squeeze a bit more performance out of my app. However this can potentially leave the data in the session stale because HQL deletes by-pass the session level cache. In the depths of the legacy code in which I am working, where deletes and inserts are common, NonUniqueObjectExceptions gets thrown all over the place.

I could evict the all instances of the entity class being deleted from the session level cache. This may cause problems the other way around because entities added to the session may be evicted before they have been flushed to the database.

What I would like to be able to do is evaluate whether a particular entity satisfies the HQL "where" clause in the delete statement. If it does, then I can evict it from the session level cache, knowing that it will have been deleted from the database by the bulk HQL delete.

I can't see any obvious methods to allow me do do this. I could crack open the HqlParser and do this myself but I suspect heading down this route will become a hefty coding task.

Thoughts?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.