StrataFrame Forum

Exception in TransactionBegin is multi user web environment

http://forum.strataframe.net/Topic22512.aspx

By ChanKK - 3/29/2009

HI,

I hit the error as attached when I have 2 users perform same action at the same time. Any ideas?

Beside, may I know any special thing I need to take care of in web environment?



Please advice. Urgent!





public class LeavePersonalApplication : LeavePersonalApplicationBasePage

{

protected ResultSet Submit(ActionType actionType)

{

ResultSet result = new ResultSet();



this.LVELeaves.SubmitterAction = actionType;

this.LVELeaves.OwnerAction = actionType;



DocHelper docHelper = new DocHelper((IEmployeesBO)this.Owner,

(IEmployeesBO)this.Submitters,

(IDocumentsBO)this.LeaveAppUserControl.LVELeaves, Guid.NewGuid().ToString());



result = docHelper.Submit();



return result;

}

}



public class DocHelper

{

public DocHelper(VfsEmpInterface.IEmployeesBO documentOwner,

VfsEmpInterface.IEmployeesBO documentSubmitter,

VfsGenInterface.IDocumentsBO document)

{

if (documentOwner != null)

this.DocumentOwner = documentOwner;

else

throw new NullReferenceException("DocHelper: Document's Owner has Null Reference during Initialization.");



if (documentSubmitter != null)

this.DocumentSubmitter = documentSubmitter;

else

throw new NullReferenceException("DocHelper: Document's Submitter has Null Reference during Initialization.");



if (document != null)

this.Document = document;

else

throw new NullReferenceException("DocHelper: Document has Null Reference during Initialization.");



this.TransactionKey = new Guid().ToString();



this.document.SysDocId = SysDocBO.SysDocId;

}



public DocHelper(VfsEmpInterface.IEmployeesBO documentOwner,

VfsEmpInterface.IEmployeesBO documentSubmitter,

VfsGenInterface.IDocumentsBO document,

string transactionKey): this(documentOwner, documentSubmitter, document)

{

this.TransactionKey = transactionKey;

}



public VfsGenBO.ResultSet Submit()

{

VfsGenBO.ResultSet result = new VfsGenBO.ResultSet();

VfsWfBO.TasksBO task = new VfsWfBO.TasksBO();



BusinessLayerExtension.TransactionBegin(VfsWfHelper.WfHelper.WORKFLOW_DSKEY, this.TransactionKey, IsolationLevel.ReadCommitted);

BusinessLayerExtension.TransactionBegin(ESSLVE_DSKEY, this.TransactionKey, IsolationLevel.ReadCommitted);

BusinessLayerExtension.TransactionBegin(HRMSLVE_DSKEY, this.TransactionKey, IsolationLevel.ReadCommitted);



// Save data here

}

}

By Trent L. Taylor - 3/30/2009

Well, without having my hands on this code it is going to be next to impossible for me to debug and give a straight answer.  But one thing that I might suggest trying is one of the following:

  1. Give a unique name to the transaction name.  For example, use a System.Guild.NewGuid.ToString() or something to ensure a unique transaction name.
  2. If that doesn't work, then turn off transactions to make sure that this is your point of failure.