-->
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: WCF + NHibernate + TransactionScope
PostPosted: Tue Jul 24, 2007 7:13 am 
Newbie

Joined: Thu Nov 25, 2004 11:41 am
Posts: 9
Need some urgent help to me,

İ am using NHibernate session in wcf it working normal transactionscope
But when i use wcf managed transaction it was error “This connection explixty or ….. commited or abort bla bla” i try so much search in net.


//[OperationBehavior(TransactionScopeRequired = true,
// TransactionAutoComplete = false)]
public ServiceResponse Add(ref LoginUser model)
{
ServiceResponse response = new ServiceResponse();
if (isvalidSession)
{
SoftLogger.writeInfo(String.Format(ResourceProvider.getRourceString(GetType(), "AddObjectCRUDInfo"), model.ToString(), model.GetType().Name));
//using (TransactionScope tx=new TransactionScope())
//{
using (IPersistManager ipm = new NHibernateManager())
{
try
{
ipm.Save(model, true);
response.ResponseStatus = ResponseStatus.Success;
}
catch (Exception ex)
{
response.ResponseStatus = ResponseStatus.Fail;
response.ResponseMessage = ex.InnerException.ToString();
}
}
//tx.Complete();
//}
}

This is work like that, but when i use OperationBehavior it throw an error.

Did you know any solution ..


Top
 Profile  
 
 Post subject: Re: WCF + NHibernate + TransactionScope
PostPosted: Wed Jul 25, 2007 10:38 am 
Newbie

Joined: Thu Nov 25, 2004 11:41 am
Posts: 9
SOLVED...

kargenc wrote:
Need some urgent help to me,

İ am using NHibernate session in wcf it working normal transactionscope
But when i use wcf managed transaction it was error “This connection explixty or ….. commited or abort bla bla” i try so much search in net.


//[OperationBehavior(TransactionScopeRequired = true,
// TransactionAutoComplete = false)]
public ServiceResponse Add(ref LoginUser model)
{
ServiceResponse response = new ServiceResponse();
if (isvalidSession)
{
SoftLogger.writeInfo(String.Format(ResourceProvider.getRourceString(GetType(), "AddObjectCRUDInfo"), model.ToString(), model.GetType().Name));
//using (TransactionScope tx=new TransactionScope())
//{
using (IPersistManager ipm = new NHibernateManager())
{
try
{
ipm.Save(model, true);
response.ResponseStatus = ResponseStatus.Success;
}
catch (Exception ex)
{
response.ResponseStatus = ResponseStatus.Fail;
response.ResponseMessage = ex.InnerException.ToString();
}
}
//tx.Complete();
//}
}

This is work like that, but when i use OperationBehavior it throw an error.

Did you know any solution ..


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.