Java 多重持续单位日食
我正在使用一个带有postgresql连接的osgi应用程序和一个包含如下属性的persistence.xmlJava 多重持续单位日食,java,jpa,osgi,eclipselink,Java,Jpa,Osgi,Eclipselink,我正在使用一个带有postgresql连接的osgi应用程序和一个包含如下属性的persistence.xml <persistence-unit name="postgres-name" transaction-type="JTA"> <properties> <!-- <property name="show_sql" value="true" /> --> <!-- <pro
<persistence-unit name="postgres-name"
transaction-type="JTA">
<properties>
<!-- <property name="show_sql" value="true" /> -->
<!-- <property name="hibernate.format_sql" value="true" /> -->
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.logging.level.sql" value="FINEST"/>
...many other properties...
</properties>
</persistence-unit>
我认为我的属性eclipselink.allow-zero-id在h2 unitname中定义了postgres EntityManager
事实上,如果我使用id为0的always postgres数据库,一切都很好,因为序列是call,但如果我使用一次h2 EntityManager,则id为0的实体将不再工作,因为allow-zero-id
如何为每个持久unitname定义单独的属性
询问我是否要查看更多配置
提前感谢您是使用纯日食还是与白羊座jpa结合使用?@ChristianSchneider您是对的,它与servicemix中的“白羊座jpa容器1.0.2”捆绑一起使用。您也尝试过新的白羊座jpa 2.x吗?也许这个问题已经解决了?通常情况下,我希望属性是每个持久性单元的。如果可以,我可以测试,但我在servicmix容器中,不能按照我的意愿更新其中的任何捆绑包,我不希望将arias 1.0.2和Aries 2.x作为捆绑包。如果可以的话,我会设法找到另一个解决方案…谢谢你的帮助
<persistence-unit name="h2-unitname"
transaction-type="RESOURCE_LOCAL">
<properties>
...many properties...
<property name="eclipselink.allow-zero-id" value="true"/>
...many other properties...
Detail: key (id)=(0) already exist
Call: INSERT INTO TABLE(ID, TEST) VALUES (?, ?)
bind => [0, null]