cancel
Showing results for 
Search instead for 
Did you mean: 

Hybris DB-connection or RelationInvalidationListener errors after Update to 2205

0 Kudos

We started getting a lot of errors in integration tests that use impex scripts and the importCsv() method after updating Hybris to version 2205. Especially for tear down impex scripts that are imported in the @After method.

It also seems that junit tenat initialization (by yunitinit command) helps solve the problem, but only for one test case. So maybe there is a table in the database that needs to be cleared before running the test?

This does not affect the execution of tests, but it makes it very difficult to read the logs.

Please share your experience with this problem. I found a similar question here, but unfortunately without answers.


Full error stack trace in attached file transaction-invalidation-error.txt.

Short stack trace below:

ERROR [hybrisHTTP14] (junit) [InvalidationTopic] unexpected error invalidating InvalidationTopic[hjmp, entity] via listener de.hybris.platform.cache.relation.RelationInvalidationListener@a867b41asked
java.lang.IllegalStateException: The transaction is performing invalidatins after commit / rollback. You cannot access the database in this phase.
        at de.hybris.platform.tx.Transaction.getTXBoundConnection(Transaction.java:1900) ~[coreserver.jar:?]
        at de.hybris.platform.jdbcwrapper.DataSourceImpl.getFromPool(DataSourceImpl.java:484) ~[coreserver.jar:?]
        at de.hybris.platform.jdbcwrapper.DataSourceImpl.doGetConnection(DataSourceImpl.java:465) ~[coreserver.jar:?]
        at de.hybris.platform.jdbcwrapper.DataSourceImpl.getConnection(DataSourceImpl.java:456) ~[coreserver.jar:?]
        at de.hybris.platform.jdbcwrapper.DataSourceImpl.getConnection(DataSourceImpl.java:410) ~[coreserver.jar:?]
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByTypeCode1FinderResult.getFromDatabase(ComposedType_HJMPWrapper.java:1568) ~[coreserver.jar:?]
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByTypeCode1FinderResult.compute(ComposedType_HJMPWrapper.java:1556) ~[coreserver.jar:?]
        at de.hybris.platform.cache.AbstractCacheUnit.privateGetNoLock(AbstractCacheUnit.java:297) ~[coreserver.jar:?]
        at de.hybris.platform.cache.AbstractCacheUnit.privateGet(AbstractCacheUnit.java:270) ~[coreserver.jar:?]
        at de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:172) ~[coreserver.jar:?]
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper$FindByTypeCode1FinderResult.getFinderResult(ComposedType_HJMPWrapper.java:1528) ~[coreserver.jar:?]
        at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper.ejbFindByTypeCode(ComposedType_HJMPWrapper.java:1601) ~[coreserver.jar:?]
        at jdk.internal.reflect.GeneratedMethodAccessor407.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1021) ~[coreserver.jar:?]
        at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1011) ~[coreserver.jar:?]
        at de.hybris.platform.persistence.framework.HomeInvocationHandler.invokeMethod(HomeInvocationHandler.java:105) ~[coreserver.jar:?]
        at de.hybris.platform.persistence.framework.HomeInvocationHandler.invoke(HomeInvocationHandler.java:55) ~[coreserver.jar:?]
        at jdk.proxy2.$Proxy25.findByTypeCode(Unknown Source) ~[?:?]
        at de.hybris.platform.persistence.type.TypeManagerEJB.getRootComposedType(TypeManagerEJB.java:445) ~[coreserver.jar:?]
        at de.hybris.platform.jalo.type.TypeManager.getRootComposedType(TypeManager.java:338) ~[coreserver.jar:?]
        at de.hybris.platform.cache.relation.TypePKsExtractor.getTypePKs(TypePKsExtractor.java:62) ~[coreserver.jar:?]

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

So, after reading the documentation, I found a couple of ways that work in some cases:

- I tried adding the @Transactional annotation as mentioned in the TransactionRunListener documentation (here) and it seems to have fixed the bug:

"Listener which will start a transaction before each test and will rollback it when test is finished"

But I'm not sure about this. Because documentation says that extended class already managed transactions.

- We got a lot of errors because of "@After" method with tear-down scripts. And it seems like we can just remove tear-down scripts with After method, because transaction will rolled-back by the TransactionRunListener(as mentioned here)

- Also I tried to extend ServicelayerTest instead of ServicelayerTransactionalTest and it helped me too for another cases.

I would be grateful if you share the correct solution to this problem!

Answers (0)