Exception in TransactionBegin is multi user web environment


Author
Message
ChanKK
ChanKK
StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
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

}

}


Attachments
transactionbegin.PNG (118 views, 123.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search