-->
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: Delete validation in 'Pre delete'
PostPosted: Wed Apr 02, 2008 10:58 am 
Newbie

Joined: Sun Apr 29, 2007 4:27 am
Posts: 10
Location: Israel
Hey,

In our application we have decided to add ‘erasion validation’ – By using pre-delete, we catch all entities erasion requests, and check by querying the DB whether any applicative* references exist to the deleted entity
(* Applicative reference is a reference which can be seen in the java object, and won’t be automatically deleted once the requested entity is removed)

The problem is, that before we run the erasion validation – we make some applicative changes, and then querying the DB by using SQL statements. In this level, the application references are not synchronized with the DB references, and not all applicative changes are reflected in the DB.

One kind of solution will be Flush the DB before executing the validation queries. This solution is bad since we catch the delete at ‘pre delete’ stage, and flushing during cascade (which may happen if we delete a hierarchy of objects) is wrong.

Any better ideas of how can I ensure the DB is synchronized with my java application?

Thanks in advance,
Sharon.


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.