Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » .NET Programming » Visual Basic .NET/2005/2008 » Database not getting updated


Database not getting updatedExpand / Collapse
Author
Message
Posted 5/9/2008 2:01:11 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/15/2008 8:19:56 AM
Posts: 6, Visits: 20
Hello everybody in the problem solving world !!!!.........

Well I have come across a unique problem and am not able to find any logic behind that.

My vb.net application runs on a sql server 2000 and it is about making bills in a fast running gift counter with 5 to 6 client and server is placed at a distance of 200 meters. The store sells maximum of 50-60 gifts. The user does all the transaction through clicks.

Two tables are involved for making a transaction. One is mastertable and detailtable.

In the mastertable my application is inserting the total of the bill, date, amount and the counter person’s code. It then generates an auto number which I picks up after the data is inserted in the mastertable and then uses the same in the detailtable.

The detailtable holds fields like item, qty, rate,id of mastertable etc.

My application is running smooth, but recently I noticed that say one in 500th time, row is not added to mastertable while it is present in detailtable with the id of mastertable. I have binded the sql with commit. I have digged my code but am not finding any logic behind this error.

Please help. Thanks in advance.
Post #24856
Posted 5/20/2008 9:37:30 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 9/1/2008 1:12:10 PM
Posts: 57, Visits: 106
The most likely root cause of the above mentioned issues can be:

1) The Insert into BillMaster and Insert into BillDetails (this would be triggered for multiple times in case of 1 customer buying multiple items, while insert wud be triggered only once on BillMaster) might not be encompassed into a single transaction.

Ensure the flow is as follows

BeginTrans

Insert into BillMaster

Insert Into BillDetails (In a loop)

CommitTrans

2) Ensure your application handles CONCURRENCY issues. Are you generating the Bill No manually/ on runtime (ie; Max(BillNo) +1) or relying on SQL's AutoIncrement?

If you are generating the BillNo manually ensure same BillNo is not generated when multiple users simultaneously save a Bill.

3) Ensure you have implemented TRANSACTION on Delete operation of Bills. Your Delete Bill action should be encompassed within a Transaction to ensure all or no records get deleted in case any of the record is found in undeletable state when Delete is triggered.

s.p.i.d.e.r.m.a.n

Post #24965
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Brian, Peter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 10:31am