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
|
I've been getting this error when I try to insert data into the Oracle DB and I do not understand why this is happening. It fails on iow.Add(izvodNap); . Any clues? Everything goes fine until some point in the loop when the iow.add throws this error. I checked if there is already the same izvodNap instance added to iow, that's not the case. I checked if I'm trying to pass some null values to not null fields, that is not the case either. For some sets of data the code executes correctly and saves changes to db. If it fails, it always fails on the specific iteration of the loop for a specific set of data, so it must be something with the data I try to pass to iow but I can't see what's wrong the whole afternoon. All ideas greatly appreciated!
MyModelUnitOfWork iow = Repository.Context.CreateUnitOfWork(); foreach (ReqNaplata napl in reqNaplata)
......some code that fills izvodNap.... |
|
|
News! I did this: Repository.Context.IdentityBlockSize = reqNaplata.Count + 100;
instead of Repository.Context.IdentityBlockSize = reqNaplata.Count + 1;
and it went through the loop correctly for a set of data that was throwing an error before. So, it is not the data that I'm passing. I've been reading about INCREMENT BY sequence and Lightspeed Id. Is that the problem? |
|
|
More news!
It seems that Repository.Context.IdentityBlockSize = 1; solves the problem. |
|
|
The IdentityBlockSize should be less than or equal to -- normally equal to -- the INCREMENT BY amount (so I'm a bit surprised that using count + 100 worked better than count + 1). The reason is that when LightSpeed gets the first block of identities from the sequence, Oracle or PostgreSQL only tells LightSpeed the new value of the sequence. Therefore LightSpeed uses the IdentityBlockSize to count back from there to the starting identity value. If the IdentityBlockSize is greater than the INCREMENT BY amount, this can result in LightSpeed reusing an identity that was assigned in a previous session. Also, 2.2 RTM had a bug which could cause duplicate IDs under certain other circumstances. This is fixed in current nightly builds. So if you're using sequences, and you're using RTM, we'd recommend that you upgrade to the nightly. Express edition from http://www.mindscape.co.nz/products/lightspeed/nightlybuilds.aspx, retail editions from the store (please note the caveat about uninstalling). (Of course, if your solution is working for you and you don't need the additional efficiency of block allocation, then there's no need to upgrade.) |
|
|
Our problem is not solved :( . Every once in a while the procedure throws the error Entity has already been addedParameter name: entity.
Could you give us a hand with the nightly build? What do we have to do in order to have the last version? We have a licensed version of the product. |
|
|
Hi Delfino, To get the commercial version of your nightly build please visit: http://www.mindscape.co.nz/store/myaccount.aspx I hope that helps - let me know if you're still having issues. Also, please make sure you uninstall LightSpeed before installing the nightly. Kind regards, John-Daniel Trask |
|
|
In order to get a nightly build we have to purchase Lightspeed again? |
|
|
Hi Delfino, No, nightly builds are available to customers at the URL that I provided. You will need to login with the account that you purchased LightSpeed with however. I hope that helps, John-Daniel Trask |
|
|
I need some more help on this...I requested a nightly build from the collegues who are responsible but they sent me .msi file that installs the 2.2.948.10429 version of .dll that I've already had. How does the download of nightly build function? Is the version of .dll going to be different? If yes, could you tell the current version? |
|
|
Hi Delfino, The current nightly build should be version 2.2.948.12227. Customers need to download nightlies from the store site: http://www.mindscape.co.nz/store/myaccount.aspx This ensures you're getting the latest commercial build - not the express version. Let me know if you have any issues - I'm happy to help further. John-Daniel Trask |
|
|
Hi Delfino, Just to help some more, I've attached a screenshot of the store interface for downloading LightSpeed (in my case, the standard edition). I've drawn an outline in red for the download you'll need to get your team to download (it might be helpful to send them the picture). Basically:
I hope that helps, John-Daniel |
|
|
Thank you! I forwarded your detailed instructions. Mindscape gives the best support ever :) . |
|
|
Since we installed the version we haven't been getting the error in subject. Our identity block size is Repository.Context.IdentityBlockSize = 1;
if we change it, we randomly receive the error ORA-00904: "LIGHTSPEED"."NEXTVAL": invalid identifier
What is this error? Why we try to change IdentityBlockSizeis because it seems to us that if IdentityBlockSize is bigger, the data is inserted faster into the table.
|
|
|
Yes, a larger IdentityBlockSize will result in faster inserts. IdentityBlockSize controls how many IDs gets from the sequence in one go. If you set IBS to 1, LightSpeed gets one ID at a time, so you incur a sequence query for every entity. If you set IBS to 10, you incur a sequence query for every 10 entities. However note your sequence INCREMENT BY amount MUST equal your IdentityBlockSize or you may get duplicate IDs allocated. LIGHTSPEED.NEXTVAL is the value being requested from the LIGHTSPEED sequence -- I believe the exact SQL is SELECT LIGHTSPEED.NEXTVAL FROM DUAL. I don't understand why you would get an error when querying for that, unless the sequence is not set up -- but then it would never work at all. Is it possible you are changing the LightSpeedContext.Schema? What is your QuoteIdentifiers setting and is the sequence declaration in the database case-preserving? Could you attach a logger and post the SQL that gets logged when one of these errors occurs? Thanks! |
|