
« Torna a Custom Deployments
JPA on Tomcat
How to configure on Tomcat
1. copy lib/development/spring-instrument-tomcat.jar to tomcat/lib/ext
2. Edit conf/Catalina/localhost/ROOT.xml and add this line in the "Context" element.
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
3. Delete hibernate3.jar from WEB-INF/lib
4. Copy to WEB-INF/lib
persistence.jar
eclipselink.jar
5. configure portal-ext.properties
1. persistence.provider=jpa
2. transaction.isolation.portal=-1 # Notice that the value is negative 1 which means default
3. transaction.isolation.counter=-1
See:
Note:
- Works only with TopLink and EclipseLink.
- Although JPA is a spec, not everything works with just any JPA provider. See this blog for details.
- Hibernate JPA has these bugs
- https://forum.hibernate.org/viewtopic.php?f=1&t=998837&sid=06373cbf8023349f4f38c342aadc54b1
- https://forum.hibernate.org/viewtopic.php?f=1&t=999049&p=2416582#p2416582
- https://forum.hibernate.org/viewtopic.php?f=1&t=998876
- OpenJPA has this bug
- Hibernate JPA has these bugs
TODO
- Make it work with OpenJPA and Hibernate JPA
- Test with other transaction managers
- Test with other App Servers
- Dynamic Query API
- Implement query cache using provider specific hints
- Current ScrollableResults is a minimal, non-optimal implementation. Since JPA does not provide one, should implement our own or leverage various mechanisms in a provider specific manner. See toplink-tips and eclipselink-ext.
- Remove any hibernate dependence
- com.liferay.counter.service.persistence.IDGenerator (if unused, remove)
- com.liferay.portal.dao.shard.ShardSessionFactoryTargetSource
- Fix HIBERNATE_JDBC_BATCH_SIZE in BatchSessionImpl
43492 Visualizzazioni