Subject Re: [Firebird-Java] using Hibernate stream with Jaybird 3.0.5 I receive error
Author Gábor Dolla
Hi

I guess I figured it out but of course I might be wrong.

I have a @Repository class which is annotated as @Transactional and in that class I have a method which returns the Stream.
I call this method from my @Controller, which processes the stream and returns data to the browser.
It fails with the exception I sent last week. If I start the transaction in the controller method it works.

So I guess in the first case the transaction ends when the repository method returns and it closes the resultset. The controller method tries to process
the Stream but it's too late.
It's not specific to firebird, this thread is also interesting:

Best regards


Gabor




Mark Rotteveel mark@... [Firebird-Java] <Firebird-Java@yahoogroups.com> ezt írta (időpont: 2018. szept. 27., Cs, 16:17):
 

On 27-9-2018 15:22, Gabor Dolla agdolla@... [Firebird-Java] wrote:
> So it was my fault, I had to define the transaction boundaries and then
> it started to work.

Thanks for letting us know!

I'm curious to know why explicitly defining the transaction boundaries
was necessary to get this to work. Was the count() executed in a
different bean than the query+stream?

Mark
--
Mark Rotteveel