This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Why am I getting "Nested transactions are not supported" errors when doing updates or adding new entries of my lightspeed entity objects?
This never used to happen before until I started putting in relations in the tables.
I'm not doing any nested transactions, I'm doing simple adds/updates
Has anyone else seen this error? Thanks
|
|
|
If you are using the KeyTable or Sequence identity method, LightSpeed will make the call to the database to get another tranche of IDs in a separate transaction. That could be the source of the nesting. What identity method are you using, and on which database? Are you creating an explicit transaction anywhere? How many new entities are you saving in one go? Thanks! |
|
|
Hi, The identity method is IdentityColumn, And I am adding or updating 1 entity at a time |
|
|
Hi Marc, Which database provider are you using? Thanks! |
|
|
MySql, and the tables are InnoDb |
|
|
Hi Marc, I've not been able to reproduce this behaviour. I'm using a simple parent-child relation, and I've tried adding items within no transaction, a MySQL database transaction and a .NET TransactionScope, but can't get the nested transactions error. Would it be possible for you to post a sample which reproduces the problem? You can attach a zip file via the Options tab. Thanks! |
|
|
Without giving you the source code and a MySQLdump I don't know how you can actually test it |
|
|
Ok, I figured out what is causing it:
When I set "Eager Load Backreference" on the one-to-many relationship to true, it will cause this error.
When I set it to false, it stopped causing the error.
I wanted to set it to true however, otherwise the lookups between tables is painfully slow |
|
|
Do you have a stack trace for the exception? I know a lot of it will be obfuscated but it will still be helpful if you can post that. Thanks.
|
|
|
Ah, thanks for the extra info. Unfortunately I'm still not able to reproduce what you're seeing. Can you describe precisely what combination of adds and updates you are doing? E.g.: * Create unit of work Thanks! |
|