I am having problems with long transactions not comitting fully. I am working on an accounting system for sawmills. One of the functions of this system is to import data that is sent in the form of text files from scaling bureaus. These files contain information about loads and logs (each log record refers back to a load record via a foreign key) that the mill recieves from vendors. There are conversion tables in the system to relate text information (trucker names, logger names, species, etc..) to primary key values of the related tables. There can be errors (the system cannot find a conversion for a piece of information and does not have a default available) or warinings (the system does not have a conversion, but can set the field to a default value) during this import. The loads and logs are added to the DB inside a transaction. In the case of an Error the entire transaction is automatically rolled back. If there are warnings the user can choose to rool back the transaction or commit itbased on a report of the warnings. In the case of warnings but no errors there is always enough data to commit the transaction (all the foreign key values in the load and log tables are related to a valid record, although some may just be a default). The problem is that SQL Server seems to lose some of the transaction. I will issue the commit command and not all the loads will be in the database. I know the loads were all imported during the transaction because as they are imported i run a stored procedure on each load to set it's cost based on prices in the system. I am reading the connection's error object after each run of the Stored Procedure and printing any errors to the error/warning report so i know there are no errors occuring at the server as these loads are added. I started with a bureau file containing 88 loads. Whenever i would go through the process and chosse to commit the loads only the last 15 would be in the database. I then cut and pasted these loads into 6 seperate text files. The fist had 14 loads in it and all 14 were imported. The next had 19 loads but after comitting it to the database only 17 of these showed up. I cut the remaining 2 out of the text file and pasted them into their own file. After processing this file the 2 loads showed up. That tells me that there is not actually a problem with the data or the import would have failed when these 2 loads were imported alone. Am i missing some setting or settings on the server that would allow these transactions to fully commit? Any help would be greatly appreciated. I have been at this a long time trying to figure out what's wrong but everything i see points to SQL Server 'losing' part of the transactions. TIA Ruairi
Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.