-->
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: What am i allowed to do during jpa callbacks
PostPosted: Mon Apr 07, 2008 12:52 pm 
Beginner
Beginner

Joined: Mon Apr 07, 2008 12:49 pm
Posts: 33
Hey,

In the book - "java persistence with hibernate" they write;
Quote:
It’s illegal to invoke the original Hibernate Session from an Interceptor callback.
The Session is in a fragile state during interceptor calls.


I am working with JPA and want to do some things like queries or change the object or create a reference from this object to other objects in the callbacks events like post-persist and etc.

I am working with JPA and the underline implementation is hibernate, so I am assume that the same rule that quoted above is relevant also to JPA callback?
Am I right?
Can you please give examples for things that you are doing on callbacks?

In the book they suggest the following trick -
A nice trick that avoids this issue is
Opening a new Session only for the purpose of saving a single AuditLogRecord
Object. You reuse the JDBC connection from the original Session. [/QUOTE]

How can use this trick as concern to entity manager is JBoss, am I need to use the same trick?

Thank you
[/quote]


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.