-->
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: problem with entitymanger and insert trigger
PostPosted: Wed Sep 24, 2008 10:25 am 
Newbie

Joined: Wed Sep 24, 2008 10:14 am
Posts: 4
Hello all,

i am having strange problem.

i wrote a trigger on a table which will be fired when some one inserts data on to that table.when i insert a row manually on that table in the db the trigger is getting fired and executing successfully.

so when i am trying to insert data from my application using entity manager.persist() ,i don't know what happens the row is not getting inserted in the table itself.it is showing the following exception...

[JDBCExceptionReporter] SQL Error: 0, SQLState: null
18:22:43,991 ERROR [JDBCExceptionReporter] The statement must be executed before any results can be obtained.
18:22:43,991 ERROR [STDERR] javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [org.impact.entity.ListingDetail]


when i remove the trigger from the database and try to persist the data,the detials are succesfully persisted.

i am passing correct data from the application to the database.

so where i am going wrong.

i want that trigger to be fired when the entity manager persists the data.

Any help on this is greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2008 5:44 pm 
Newbie

Joined: Wed Sep 24, 2008 10:14 am
Posts: 4
Worked on this issue further and figured out that hibernate fails if there is a stored procedure call in the trigger.

I replaced the stored procedure call with inline logic and it worked.


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.