Topic
3 replies Latest Post - ‏2012-12-14T15:02:53Z by sspavan
Veluri
Veluri
31 Posts
ACCEPTED ANSWER

Pinned topic (OPEN) JPA example for Compute Intensive programming model

‏2012-12-13T04:45:49Z |
I have situation like

1. JPa project which contains all entities including persistence.xml
2. Created Compute intensive batch in Enterprise Application project

I try to create entity object and presist in JPA project .
Not committing the transaction.

Does any one has example for CI programming for JPA transactions
Updated on 2012-12-14T15:02:53Z at 2012-12-14T15:02:53Z by sspavan
  • sspavan
    sspavan
    60 Posts
    ACCEPTED ANSWER

    Re: (OPEN) JPA example for Compute Intensive programming model

    ‏2012-12-13T22:08:17Z  in response to Veluri
    Here is sample that worked for me.
  • Veluri
    Veluri
    31 Posts
    ACCEPTED ANSWER

    Re: (OPEN) JPA example for Compute Intensive programming model

    ‏2012-12-14T00:17:30Z  in response to Veluri
    Thank you Pavan It worked

    I also change the persistance.xml as

    persistence-unit name="BatchCISampleEJB" transaction-type="RESOURCE_LOCAL">
    Perviously it was type= "JTA"

    Can you suggest when to use exactly JTA and RESOURCE_LOCAL in point of batch world.
    • sspavan
      sspavan
      60 Posts
      ACCEPTED ANSWER

      Re: (OPEN) JPA example for Compute Intensive programming model

      ‏2012-12-14T15:02:53Z  in response to Veluri
      Hi,

      Not sure on exactly when to use JTA vs. RESOURCE_LOCAL. Initially I had JTA and it didn't work so I changed it to RESOURCE_LOCAL.