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
|
Per the LightSpeed documentation: "LightSpeed will automatically take care of maintaining the search index when entities are inserted, updated or deleted however if working with an existing database there will be a need to build an initial search index of all the data in the system." Well, the Lucene search indices don't appear to update properly during inserts/updates (I don't know about deletes) unless I manually call Context.SearchEntine.Update(myEntity); Please advise, Thanks, |
|
|
Hi Bill, This should just work and you shouldn't require a work around. I'll take a peek into this and see if I can find any issues with the LightSpeed handling here. Could you let me know which database type you're using and if you're using transactions at all? I'll have a look into this right away but the answer to those two questions will help me move faster. Kind regards, John-Daniel Trask |
|
|
Microsoft SQL 2005/2008, in a .Net System.Transaction |
|
|
Hi Bill, I've been tinkering with this and haven't have much luck in creating a repro that shows a bug. One issue that can occur is if your transaction wraps the UnitOfWork in which the unit of work is disposed of before the transaction is completed and therefore the post commit actions do not fire as they are cleared during the disposal process. Could you possibly provide me with a break down of how your transaction and unit of work are running (who encapsulates whom). If you could provide a code example please attach it to this post (on the options tab) or email it to jd@mindscape.co.nz if it's sensitive (excluding any binaries please) so that I can better understand your situation. I suspect if I cannot find an explicit bug, this is certainly an area for us to give specific guidence about how transactions work with the unit of work. Thanks for working through this with me. John-Daniel Trask |
|
|
That's exactly what it does. Basically: using (var scope = new TransactionScope()){ using (... uow = ....CreateUnitOfWork()) { ... } scope.Complete(); } |
|
|
Hi Bill, Thanks for that. Could you try reworking it to: using(var uow = CreateUnitOfWork()) The issue is that the search index happens as a post-commit action however the UoW is disposed at that stage and therefore has no actions to occur post commit. Having looked at this and discussed it more with the team I don't think this is the ideal situation because it requires that you understand far too much about post commit actions and search indexing. It should "just work" so we'll look at ways to improve this situation if possible. Could you try that and let me know if works for you? Kind regards, John-Daniel Trask |
|