Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Multiple persistence-units

    SmartGWT 3.0 / GWT 2.4 / FF 3.6

    I have 2 persistence-units defined in my persistence.xml, 1 for in-memory and 1 for disk persistence.

    How do I specify in my datasource configuration (ds.xml?) that I want to choose the in-memory or disk persistence-unit?

    #2
    Hi,

    You should use jpaConfig property.

    Here is an except from
    http://www.smartclient.com/docs/8.2/...jpaIntegration

    Additional configurations:

    In case you have several persistence units defined in your persistence.xml you can have additional configurations in server.properties file. Additional configurations (prefixed with jpa.) should have name, emfProvider property and other properties required by specified EMF provider implementation. For example:

    jpa.configName.emfProvider: com.isomorphic.jpa.EMFProviderLMT
    jpa.configName.persistenceUnitName: ANOTHER_PERSISTENCE_UNIT_NAME

    To use additional JPA configuration you have to set jpaConfig property in data source definition:

    <DataSource
    ID="countryDS"
    serverConstructor="com.isomorphic.jpa.JPA2DataSource"
    beanClassName="com.smartgwt.sample.showcase.server.jpa.Country"
    jpaConfig="configName"
    >
    Regards,
    Alius

    Comment

    Working...
    X