batchee-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Restart after a Decision Stop is not working
Date Mon, 10 Apr 2017 19:14:21 GMT
2017-04-10 20:59 GMT+02:00 Tiburtius, Ashwanth <
ashwanth.tiburtius@iwd.iowa.gov>:

> Hi Romain,
>
> If I can bother you for additional information related to enabling JTA
> transaction. I would like to enable container managed transaction in
> batchee. The persistence unit configured in my project is of transaction
> type "JTA" and I have the following entries in my batchee.properties. But I
> am getting an exception that tells me that I need to use "RESOURCE_LOCAL"
> transaction type instead. How can I turn on jta?
>
> batchee.properties:
> PersistenceManagerService=org.apache.batchee.container.
> services.persistence.JPAPersistenceManagerService
> persistence.jpa.unit-name=UIBatch
>
> persistence.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.0"
>    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
>    <persistence-unit name="UIBatch" transaction-type="JTA">
>       <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>       <jta-data-source>atiburtiusJta</jta-data-source>
>       <non-jta-data-source>atiburtius</non-jta-data-source>
>       <mapping-file>META-INF/orm.xml</mapping-file>
>       <class>gov.iowa.wd.ui.tax.batch.entity.Person</class>
>       <properties>
>          <property name="eclipselink.logging.logger" value="ServerLogger"
> />
>          <property name="eclipselink.logging.parameters" value="true" />
>          <!--  property name="eclipselink.logging.level.sql" value="FINE"
> / -->
>       </properties>
>    </persistence-unit>
> </persistence>
>
> Exception:
> Apr 10, 2017 12:10:26 PM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet [faces] in context with path
> [/UIBatch] threw exception [javax.batch.operations.JobStartException:
> java.lang.IllegalStateException:
> Exception Description: Cannot use an EntityTransaction while using JTA.]
> with root cause
> java.lang.IllegalStateException:
> Exception Description: Cannot use an EntityTransaction while using JTA.
> at org.eclipse.persistence.internal.jpa.transaction.JTATransactionWrapper.
> getTransaction(JTATransactionWrapper.java:65)
> at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getTransaction(
> EntityManagerImpl.java:1233)
> at org.apache.batchee.container.services.persistence.jpa.provider.
> DefaultTransactionProvider.start(DefaultTransactionProvider.java:28)
> at org.apache.batchee.container.services.persistence.
> JPAPersistenceManagerService.createJobInstance(
> JPAPersistenceManagerService.java:643)
>
> Also is there documentation available as to how the db tables should be
> setup? I was hoping that "persistence.database.ddl=create" property would
> create the tables but I couldnt get that far because of the above error.
>

Before explaining how to do let me put a warning: if you integrate batchee
transactions with the container and use an EJB in your batch then you can
rollback batchee state and loose some jbatch monitoring since you will
share the same transactions.

That said if you still want you can set persistence.jpa.ee=true

Then just use the JPA provider DDLs in your persistence unit.


>
> Since documentation in general seems to be scarce for BatchEE project in
> Apache website, do you recommend any other source where I would get
> additional information from - code samples, projects using batchee etc.?
>

I'm not sure we have a full documentation of all properties, in particular
of JPA with JTA since it is not a recommanded mode for the previously
explained reason. If you want to help to update the website you are more
than welcomed and I would be very happy to help you to find any info you
can miss. We just use some markdown files at
https://github.com/apache/incubator-batchee/tree/master/src/site/markdown
so should be easy to add content if you are motivated :)


>
> Thank you again for your time.
>
> Thanks,
> Jude.
> IWD - IT
> ashwanth.tiburtius@iwd.iowa.gov
> Ph: 515-281-3378
>
> On Tue, Apr 4, 2017 at 1:24 PM, Romain Manni-Bucau <rmannibucau@gmail.com>
> wrote:
>
>> Hello,
>>
>> yes, generally you use jpa module or jdbc integration (but it supports few
>> databases compared to jpa impl which relies on jpa for the
>> dialect/dictionnary).
>>
>> Here the associated configuration:
>> http://batchee.apache.org/configuration.html
>>
>> To activate JPA add in batchee properties:
>>
>> PersistenceManagerService=
>> org.apache.batchee.container.services.persistence.JPAPersist
>> enceManagerService
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> <https://blog-rmannibucau.rhcloud.com> | Old Blog
>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
>> <https://javaeefactory-rmannibucau.rhcloud.com>
>>
>> 2017-04-04 20:21 GMT+02:00 Tiburtius, Ashwanth <
>> ashwanth.tiburtius@iwd.iowa.gov>:
>>
>> > Hello everyone,
>> >
>> > Is it normally best practice to create a database schema for the batch
>> > framework to use, something similar to Quartz framework? Does Apache
>> > BatchEE allow that to be configured?
>> > The reason for my question is this - our project has around 40 batch
>> > processes that run in different schedules through out the year. I am a
>> > novice in BatchEE and having said that, from what I have seen so far it
>> > looks like the BatchEE framework holds the job execution data in memory.
>> > Will that cause issues over time especially when you have multiple
>> > processes. Any best practices to avoid a server melt down or memory
>> issues
>> > that you could provide inputs on would be extremely helpful for our
>> > project.
>> >
>> > Thank you. Appreciate your time.
>> >
>> > Regards,
>> > Jude.
>> >
>> > --
>> > ________________________________________
>> > An Equal Opportunity Employer/Program
>> > Auxiliary aids and services are available upon request for individuals
>> with
>> > disabilities.
>> >
>>
>
>
> ________________________________________
> An Equal Opportunity Employer/Program
> Auxiliary aids and services are available upon request for individuals
> with disabilities.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message