Re: Help with "458: Long transaction aborted."
Posted in 1998
Topics: Transactions, Locking & Isolation, Logging & Checkpoints
Len Charest wrote: > > Hi- > > Is it possible to avoid the dreaded "458: Long transaction aborted." > error without taking either of the actions recomended by the finderr > docs, namely "replan [the app] so that it modifies fewer rows per > transaction" or increase number/size of logical logs? > > Can LOCK TABLE inside of a transaction be of help? > > Thanks, > -- > Len Charest len@cogent.net > Senior Software Engineer 888-4-COGENT > Cogent Software, Inc. http://www.cogent.net/ Hi You have some possible ways: 1. LOCK every tables in transaction. I'm not sure that help you, because this way is good when you get error "No more locks". 2. LOCK tables and declare cursor FOR UPDATE and inside loop delete or update rows with WHERE CURRENT OF CURSOR ... option. It's not so fast. 3. If you delete more rows than stay in table. In this case I create new table and in one instruction insert all need rows to this table and than drop old table and rename new to name of old table 4. You can divide your delete or update instruction to some parts which works on "n" rows (n - for example 10.000 rows it's depend how big are logs) 5. Try to do your operation when you ONE in database. Jacek Baran