on 05-15-2015 5:57 PM
We have a long running job synchronizing Facet Search Configuration from staging to live config. The job first removes existing linked models using "modelService.removeAll" and then copies over from staging to live. All of this is in a single transaction and takes about a minute. When the job is running and in the same time a search is made or viewing a category in the live catalog in the storefront we get the following exception:
Caused by: item 8796551809180 no longer valid (was removed): object no longer valid
at de.hybris.platform.jalo.Item$CachedGetter.get(Item.java:675)
Clearly the problem is not with the isolation level as by default Repeatable Read is used. For some reason the removeAll operation makes the cache inconsistent.
Any help or suggestions will be appreciated?
The solution that worked is disabling the cache within the transaction. Transaction.current().activateCache(false);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This solution worked for us too: we used it in the beginning of the execute() method of the TransactionBody like this:
Transaction.current().execute( new TransactionBody()
{
public Object execute()
{
Transaction.current().activateCache(false);
doSomething();
Transaction.current().activateCache(true);
return something;
}
}
);
Try flushing the transaction before the second operation to ensure all the deletes are hitting the database. Read more about delayed store to understand the optimization that has been made to improve performance https://wiki.hybris.com/display/release5/Transactions#Transactions-DelayedStore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.