Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with Store Procedure and Transaction #59

Open
edidiway opened this issue Nov 13, 2017 · 0 comments
Open

Working with Store Procedure and Transaction #59

edidiway opened this issue Nov 13, 2017 · 0 comments

Comments

@edidiway
Copy link

edidiway commented Nov 13, 2017

Hi, I have issue while working with stored procedure
my stored procedure have update command, and after the execution, I tried to retrieve the updated record.
my code is like below

using (var dbContextScope = dbContextScopeFactory.CreateWithTransaction(IsolationLevel.Serializable))
{
	var vendorID = "12345";
	
	//in this function, it will run SP, and inside the SP will update the vendor document status
	result = VendorProvider.spRecalculateVendorDocument(vendorID); 

	//get vendor document
	//vendorDocument object still have old status
	vendorDocument = VendorProvider.GetVendorDocument(vendorID);

	//commit database CRUD
	//after commit the db, vendor document status is updated to new one
	await dbContextScope.SaveChangesAsync();
}

the problem is, the vendorDocument object still hold the old data, although after execute dbContextScope.savechange(). the value in database will be updated to new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant