-->
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.  [ 2 posts ] 
Author Message
 Post subject: Know when Auditing is done
PostPosted: Wed Sep 28, 2011 11:37 am 
Newbie

Joined: Wed Sep 28, 2011 11:27 am
Posts: 3
Hi there,

As a newbie to Hibernate and Envers I kind of slided into a project using Seam and Hibernate.

Now, my problem is that I am calling the persist method on the EntityManager to save some entities to the database.
The method returns quickly, but after that I get a lot of Hibernate log output to the console about updating the _AUD tables.
This goes on for about 5 minutes before it is done.

The problem is: Until it is done hibernate cannot find the entities in the database. So either the entities are added to the database after the auditing, or hibernate refuses to see them until creating the auditing entries is completed.
That would be fine, unless I have no clue when auditing is done, and therefore no way to tell the user when his data has actually been saved, and is available to use.

Is there a way to insert a Listener, or block the EntityManager.persist method until auditing is done?

Thanks a lot in advance.

I hope my problem description is not too vague, since I'm really new to this.


Top
 Profile  
 
 Post subject: Re: Know when Auditing is done
PostPosted: Thu Sep 29, 2011 8:26 am 
Newbie

Joined: Wed Sep 28, 2011 11:27 am
Posts: 3
Ok, I just found out by myself.

This thread helped a lot:
http://community.jboss.org/message/485781

I can schedule an event with Events.instance().raiseTransactionSuccessEvent(..) and Annotate a method as @Observer to be fired when the transaction is done.

But that's probably a Seam issue, and not purely hibernate..


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

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.