-->
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: Execute statement
PostPosted: Thu Jan 10, 2008 3:58 am 
Newbie

Joined: Thu Jan 10, 2008 3:50 am
Posts: 4
Hi,

I have a couple of problems and I've been banging my head against the wall. I need to do some simple operations that I think any business application can have...nothing out of the ordinary.

When I create a new customer, I have a custom method to obtain a numerator (it's not the ID and I don't want to use generator). Is it not possible to just execute a statement? Soemthing like "update x set y=y+1"? Forget even returning the result. Can't I just execute a direct SQL statement? I just don't see myself having to create a numerator class, the class mapping and do things like:

Numerator numerator = new Numerator();
int value = numerator.GetNextNumerator();
session.Update(numerator);

where GetNextNumerator gets a ID and then increments it. It's just an overkill.

My other problem is with transactions. If I have a sequence generator in the ID, TransactionScope fails with cannot open data connection. I have to use Begin/End Transaction.

Also, even if I rollback my transaction, my generator in Firebird is still updated.

I'm really close to throwing in the towel with NH and I don't want to :(


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.