« Return to Thread: [jira] Created: (DERBY-1585) derbylang/procedureInTrigger: not able to create trigger due to an open ResultSet

Re: [jira] Commented: (DERBY-1585) derbylang/procedureInTrigger: not able to create trigger due to an open ResultSet

by Deepa Remesh :: Rate this Message:

Reply to Author | View in Thread

On 9/8/06, Daniel John Debrunner (JIRA) <derby-dev@...> wrote:
>     [ http://issues.apache.org/jira/browse/DERBY-1585?page=comments#action_12433524 ]
>
> Daniel John Debrunner commented on DERBY-1585:
> ----------------------------------------------
>
> Does this mean that there is a bug?

Thanks Dan for looking at this one. I think this could be a bug.

> Either:
>
> When a procedure is called from a trigger any ResultSet's returned are not explictly closed by the trigger calling mechanism?
>

We do not explicitly close the result set returned by procedure called
from a trigger. The user application cannot access the result set too.
So the result set get closed only when it is garbage-collected. This
may lead to unpredictable behaviour which was the cause of the
intermittent failures. I hadn't thought this was a bug. I thought
there is no point for an user application to create a trigger that
calls a procedure that returns result sets because the  application
cannot access the returned result sets. But we do not disallow this. I
myself did this (unintentionally) when I first wrote the test and it
is possible for users to do it which can lead to unpredictable
behaviour.

> or
>
> procedures that return result sers should not be allowed in triggers.
>
> Might need to look at the standard to see what is expected here.


I have not seen anything in the spec which disallows this.

>For the first case the question would be should the
> returned dynamic result sets simply be closed, or should each row be fetched and then closed. The fetching of rows
> could have functions that produce side effects the application is expecting to occur.

I am thinking what the correct behaviour should be. Any
thoughts/pointers would be helpful.

Thanks,
Deepa

 « Return to Thread: [jira] Created: (DERBY-1585) derbylang/procedureInTrigger: not able to create trigger due to an open ResultSet