Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 302
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
When you load a batch of orders, does this lock parts of tables in the database? If so, is there a way to do this without the locking if these orders are going to be viewed only, no other action? I know if a sql query you can use with (nolock), but these are loaded using OrderDataSource. Thanks
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
I'm surprised that support has yet to weigh in on this question, and I hope they do. In my 15 years of using MS SQL, using the standard functions without any type of implicit lock, there should be no locking at all, especially when using a select statement.
Pretty much all SQL databases work on the principle of stateless protocol, same principle as the Internet, they will retrieve whatever subsection of data you need to your local computer and then disconnect from the database, in other words, no hooks into the table. This is one of the reasons you can pull the plug on the local computer you're using, and the SQL database is not damaged in any way, because it no longer has his hooks into the database structure.
It will deliver the goods and then back off, the same cannot be said to other alternatives like dbase, paradox, or even access, where all the rows are transferred to the local computer. They will always maintain a hook/ connection to the database, this is why if your local computer disconnects (pull the plug) the indexes get all messed up at the server.
Yikes, I remember those days very well.
Unless you're specifically using locking commands, SQL will take care of the rest and will only lock tables when a transaction occurs, and at that point it's an all or nothing event otherwise your data can be overwritten by someone else.
I have written many front end applications in Pascal, where two users are on the same record and one will do a save and a notice will pop up on the other user screen advising them that specific fields have been updated and to refresh their screen. This of course will only occur if it's the same row and the same specific columns in that row. Anything else, the users is unaware of what's going on.
Again, in a nutshell there should be no record locking (actually I believe it's page lock) whatsoever, if you've are using standard protocols, but love for support to weigh in.
I hope some of this helps, -Ray
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Quote:When you load a batch of orders, does this lock parts of tables in the database? I am not certain about what you actually meant by locking. If this is related to IsolationLevel on transactions I am sharing the details with you below. https://learn.microsoft....om=MSDN&view=net-6.0This link has some standard IsolationLevel fields details There are only a few places where we explicitly apply the IsolationLevel as Serializable: "A range lock is placed on the DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete." - ExecuteCheckout - Updating Inventory. DeStock/Restock - SetNextOrderNumber There is no such explicit code for loading order data. Also, you mentioned about OrderDataSource. Are you referring to Gold because, in AC9, we use repositories instead of OrderDataSource.
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 302
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
Thanks. Yes, this is a Gold site. They have issues every few days with inserting shipments in the checkout service. This is the only site where I consistently see this error.Sometimes it is about the same time there is an error viewing a custom order management page in the admin that displays about 78-80 orders. They also have routines that import/export data for CounterPoint. One of the routines was running every minute so I changed it to every five minutes. The code that updates orders doesn't use transactions, it just uses order.Save().
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 467
Thanks: 4 times Was thanked: 34 time(s) in 33 post(s)
|
|
Thanks for your support!
Katie Secure eCommerce Software and Hosting |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close