StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
executescalar in middle (be part) of transaction
executescalar in middle (be part) of transaction
Post Reply
Like
2
executescalar in middle (be part) of transaction
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Fabian R Silva, -
Fabian R Silva, -
posted 14 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 153,
Visits: 1.2K
I need to execute a "executescalar" on a transaction to get the last invoice number again (if someone get the number that the actual invoice have... change it before save on this transaction)
I have:
...(try)...
BusinessLayer.TransactionBegin("invoiceTr", IsolationLevel.ReadCommitted);
var nextNumber = invBO.GetNextNumber(invBO.IdTalonario, DataSourceKey); //
<--- THIS METHOD call a EXECUTESCALAR VALUE.... freezes and timeout after some seconds...
invBO.Numero = invBO.HastaNumero = nextNumber;
saveUndoResult = invBO.Save(true);
...
...
...(rollback/commit)...
Tags
executescalar
transaction
Edited
14 Years Ago by
Fabian R Silva, -
Reply
Like
2
Replies
Fabian R Silva, -
Fabian R Silva, -
posted 14 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 153,
Visits: 1.2K
-
Edited
14 Years Ago by
Fabian R Silva, -
Reply
Like
2
Fabian R Silva, -
Fabian R Silva, -
posted 14 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 153,
Visits: 1.2K
I see that I was wrong on what I tried to accomplish, I will explain better.
I need to save invoices, and was searching better way of update the invoice number (each type have his own number)
I was planning to select max actual record and put that max+1, but if I do this the problem is that there is a posible repeat of number if it is not part of transaction.
¿can be a good idea to have a table like "InvoiceNumbers" that have a column "type" and a "number"?
Then on the current transaction I can fill the table InvoiceNumbers" adding +1 to actual number by the actual invoice type (¿this lock that table?)
then I read the current table InvoiceNumbers on transaction to set that number to the Invoice.
if another transaction try to get same invoice number and type on invoicenumbers, it will wait ?
thanks and sorry my lack of understanding about transactions, first time that have multiuser app that really need to be transactional and update some tables.
Edited
14 Years Ago by
Fabian R Silva, -
Reply
Like
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
executescalar in middle (be part) of transaction
Fabian R Silva, -
-
14 Years Ago
Hi Fabian, Please post the code for the GetNextNumber method as...
Edhy Rijo
-
14 Years Ago
basically it receive a data from the bo to be saved (idTalonario) and...
Fabian R Silva, -
-
14 Years Ago
The GetHastaNumeroProximo method should be in the ComprobantesBO...
Edhy Rijo
-
14 Years Ago
-
Fabian R Silva, -
-
14 Years Ago
I see that I was wrong on what I tried to accomplish, I will explain...
Fabian R Silva, -
-
14 Years Ago
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search