I lowered the timeout value for 2 minutes, just to see if the timeout
worked, but it doesn't seem to work. Maybe it doesn't work less than 10
minutes?

On Tue, Nov 12, 2019 at 9:59 AM Ivan Junckes Filho <ivanjunc...@gmail.com>
wrote:

> 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 <
> jonathan.gallim...@gmail.com> 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 <
>> ivanjunc...@gmail.com>
>> 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 <
>> > jonathan.gallim...@gmail.com> 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 <
>> > ivanjunc...@gmail.com
>> > > >
>> > > 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