-->
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: MS Sql server automatic rollback
PostPosted: Wed Dec 21, 2005 1:46 pm 
Newbie

Joined: Wed Jun 22, 2005 10:07 am
Posts: 5
Hibernate version:3.0


If MSSql Server 2000 encounters a syntax error it automatically rolls back the transaction without the rollback ever getting to hibernate

For example:

create table t1 (a int Primary key )

begin tran

insert into t1 values("test")

--never gets here
insert into t1 values(1)
commit tran



Hibernate's transaction never gets the information of rollback.

The relevant code would be

tx=session.beginTransaction();

try
{
session.save(entity);
tx.commit();
}
catch(Exception e)
{
//throws new Exception because transaction on sql server
//is rolled back
tx.rollback();
}


Any way we could overcome this issue?

Thanks


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.