Transactions and collection.GetMulti

Posts   
 
    
jselesan
User
Posts: 8
Joined: 06-Jun-2012
# Posted on: 27-Sep-2013 17:08:05   

Hi guy. I have a method where I update some entities using a transaction, and I also have to fetch some entities from DB. The problem is that the call to collection.GetMulti(...) takes too much time and ends with a database time out. If I do not use the transaction, it works fine.

Any ideas? Thanks in advance

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 27-Sep-2013 23:29:11   

you run into a deadlock. Add the collection to the transaction before fetching, that should make the GetMulti use the connection of the transaction and therefore avoid the deadlock, otherwise it will create a new connection and that one will run into the locks set by the DML statements you executed in the transaction, causing a deadlock.

Frans Bouma | Lead developer LLBLGen Pro
jselesan
User
Posts: 8
Joined: 06-Jun-2012
# Posted on: 30-Sep-2013 19:39:23   

Thank you so much Otis, it worked fine!

Posts: 27
Joined: 02-Oct-2008
# Posted on: 22-Sep-2015 06:46:03   

Thanks Frans...forgot to add a collection I was using to the transaction. Appreciate the reminder.