| siddhath 2005-08-03, 8:48 pm |
| Hi All,
Does DirectStream BAM API class participate in com+ transactions?
I am using directstream class to insert/update BAM data.
I want "UpdateDB1() ,BAMServer.InitiateBaming(MyObject); and UpdateDB2()
" to all be successful or fail.
I am using com+ for this.
but i am not sure if directstream will participate in com+ transaction
1)will following code work and give me the com+ (Acid) behavior?
2)Also I see this error once in while under load ...
"The transaction has already been implicitly or explicitly committed or
aborted"
this sporadic .If i submit 100 requests 80 may work fine 20 may throw this
error?
If I remove BAMServer.InitiateBaming(MyObject); this call from my main
function “PerformUpdations()”everything works fine.
any ideas ?
Thanks
siddharth
========================================
========
---Client For first calss-----------
TransactionalUtil t = new TransactionalUtil ()
t.PerformUpdations();
----------------------------
----------First classs-------------------------------
[Transaction(TransactionOption.RequiresNew)]
public class TransactionalUtil : ServicedComponent
{
public void PerformUpdations()
{
try{
UpdateDB1() //updates databse1 using ADO.net object
BizUtils BAMServer = new BizUtils();
BAMServer.InitiateBaming(MyObject);
UpdateDB2() //updates databse2 using ADO.net object
if(ContextUtil.IsInTransaction)
{
ContextUtil.SetComplete();
}
}
catch(System.Exception ex)
{
if(ContextUtil.IsInTransaction)
{
ContextUtil.SetAbort();
}
}
}
}
------------------------------------------------------
----------Second classs-------------------------------
[Transaction(TransactionOption.Required)]
public class BizUtils : System.EnterpriseServices.ServicedComponent
{
//static DirectEventStream es;
DirectEventStream es;
public void InitiateBaming(object obj)
{
//string stringData ;
try
{
interceptor.OnStep(BAMServer.BizUtils.dataExtractor,"TrackWorkItem",obj,es);
...........
}
catch(System.Exception ex)
{
throw ex;
}
}
}
------------------------------------------------------
========================================
============
|