EHCache conflict problem resolution

Occurs when two Springboot applications are running on the same server and update the same table entity records with hibernate
org.springframework.orm.hibernate4.HibernateSystemException: net.sf.ehcache.CacheException: java.io.StreamCorruptedException: invalid stream header: 00000000; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: java.io.StreamCorruptedException: invalid stream header: 00000000
	at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:218)
	at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)
	at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)

Abnormal, after investigation, it is found that the default configuration of ehache is persistent hard disk, and the cache storage paths of the two projects are the same, resulting in an error during deserialization.
Modify ehcache.xml and set diskPersistent="false" of the default cache.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326159135&siteId=291194637