[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Recovering from non-managed changes to database
Holy Joe
do-not-reply at jboss.com
Tue Aug 22 16:26:26 EDT 2006
I have some entities that are in many-to-many, bidirectional relationships with very large numbers of other entities (millions). Deleting one of them the naive way (walking through all the related entities and remove()-ing it from their collections) is not feasible, so I used a native SQL query to remove all references from the join table. This almost works fine. Unfortunately, some small number of those millions of related entities are usually being managed, but I don't know which ones. If I knew which they were, I could call refresh() on each.
Is there some way of finding out which entities of a given type are currently being managed? Is there some better way of accomplishing this delete?
Thanks,
Joe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966791#3966791
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966791
More information about the jboss-user
mailing list