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
      • http://n2.nabble.com/overriding-accesors-in-entity-need-tranisent-declaration-tp3363414p3363414.html


TODO

  1. Make it work with OpenJPA and Hibernate JPA
  2. Test with other transaction managers
  3. Test with other App Servers
  4. Dynamic Query API
  5. Implement query cache using provider specific hints
  6. 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.
  7. Remove any hibernate dependence
    1. com.liferay.counter.service.persistence.IDGenerator (if unused, remove)
    2. com.liferay.portal.dao.shard.ShardSessionFactoryTargetSource
    3. Fix HIBERNATE_JDBC_BATCH_SIZE in BatchSessionImpl

 

0 附件
43493 查看
平均 (0 票)
满分为 5,平均得分为 0.0。
评论
讨论主题回复 作者 日期
Will the end result be that Liferay orm... Richard Knight 2009年6月30日 下午12:34
No. The mappings will be available as orm.xml... Prashant Dighe 2009年8月30日 下午5:53

Will the end result be that Liferay orm mappings will be available through JPA annotations?
在 09-6-30 下午12:34 发帖。
No. The mappings will be available as orm.xml just like hibernate mappings are in hbm.xml
在 09-8-30 下午5:53 发帖以回复 Richard Knight