-->
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: implications of updating in an sql-query
PostPosted: Wed Feb 01, 2006 7:28 am 
Newbie

Joined: Fri Jan 27, 2006 8:04 am
Posts: 8
I define a named sql-query mapping which calls a stored function with various parameters.

In my stored function I insert a new row in a table. As the DB has triggers which modifies some columns I then return a cursor to the newly inserted row.

To call this from java I do:

Code:
           
Query query = session.getNamedQuery("insert-and-return");
q.setString("param1", "something");
q.setString("param2", "somethingElse");
List insertedRows = query.list();


What are the implications of doing an insert / update in the stored function even though my java code looks like it's doing a query. Apart from being confusing to read.


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.