I am actually running @Schedule process that executes some queries that
take a long time and save the result in the db so they can be downloaded.

I m not sure if there is a better way to do this, but 10 minutes may not be
enough. I just didn't want the process to stop.


On Tue, Nov 12, 2019 at 10:56 AM Jonathan Gallimore <
[email protected]> wrote:

> Right. You can't just "stop" a thread in Java. Your business method will
> need some mechanism by which it would stop and return with an error or
> similar if it didn't finish within a specific time, if that's what you're
> after.
>
> If you're changing the timeout to try and "fix" a problem, the root cause
> is probably somewhere else.
>
> Jon
>
> On Tue, Nov 12, 2019 at 12:46 PM Ivan Junckes Filho <[email protected]
> >
> wrote:
>
> > "but the operations themselves won't be interrupted at the
> > timeout point." This is important, thanks Jon.
> >
> > On Tue, Nov 12, 2019 at 10:32 AM Jonathan Gallimore <
> > [email protected]> wrote:
> >
> > > You'd need to define a TransactionManager, and set the
> > > defaultTransactionTimeout on it, similar to this:
> > >
> > > <TransactionManager id="myTransactionManager"
> type="TransactionManager">
> > >     defaultTransactionTimeout = 10 minutes
> > > </TransactionManager>
> > >
> > > Note that that bean invocations that exceed the timeout will be marked
> as
> > > rolled back, but the operations themselves won't be interrupted at the
> > > timeout point.
> > >
> > > Jon
> > >
> > >
> > > On Tue, Nov 12, 2019 at 12:00 PM Ivan Junckes Filho <
> > [email protected]
> > > >
> > > wrote:
> > >
> > > > Hey guys, quick question.
> > > >
> > > > What property should I use to change EJB transaction timeout?
> > > > Does this work in the system.properties?
> > > > defaultTransactionTimeout = 10 minutes
> > > >
> > >
> >
>

Reply via email to