-->
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: Using JDBC Query from within an entity lifecycle callback
PostPosted: Thu May 31, 2007 1:20 pm 
Beginner
Beginner

Joined: Wed Jan 03, 2007 7:47 pm
Posts: 23
Location: Richardson, Texas
Hello All,

I am currently using 3.2 with annotations and entity manager.

I am interested in using entity lifecycle callbacks using annotations such as @PostPersist and @PostUpdate.

I realize that in order to maintain portability, invoking an entity manager or invoking entity manager queries are not allowed. However, making calls to other beans or running JDBC queries are allowed.

I am making a JDBC call based on a post update trigger and the query is working although it is not picking up the database changes that are occurring as part of the entity manager flush. Once the flush has completed and before the JTA transaction commit, the JDBC query works as expected, pulling in the updated entities. I am using an injected JDBC datasource which should join with the open transaction.

Is this expected behavior or is there a way to get this to work?

Thanks alot!

Kurt


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.