You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Rami Ojares / PDF-Comics Oy <ra...@absinth.fi> on 2010/01/16 23:15:15 UTC

Maximum depth of nested triggers was exceeded.

Hi,

Now I have confirmed a following (rather alarming) issue.

I have a before trigger on inserting a row in a table.
That trigger either throws an exception or returns 0.

Now on the client side a create a connection (autoCommit = true)
And I start inserting rows all of which result in an exception thrown by 
the before trigger.
In my trigger function I print to console each time the trigger is entered.
For the first 16 rows the trigger is entered and throws an exception (as 
expected).
But after that the trigger is not entered and "Maximum depth of nested 
triggers was exceeded." exception is thrown for all the rest of the 
triggers.

Derby reference says that "The maximum trigger recursion depth is 16."
But my trigger does not cause other triggers to fire.
The insert statements are separate transactions but created from the 
same connection.
It seems that derby starts adding the trigger recursion counter for 
completely separate statements?!?

I have to test now if I open a separate connection for each statement 
what is going to happen.
Will report soon.

- rami


Re: Maximum depth of nested triggers was exceeded.

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Rami Ojares / PDF-Comics Oy <ra...@absinth.fi> writes:

> Yes, as I expected.
> If I execute those same statements from a separate connection then
> everything works as expected.
> No more "Maximum depth of nested triggers was exceeded."
> So this is definately a bug.

Thanks for bringing this to our attention! You can further help speed
up fixing this bug by filing a JIRA issue. If possible, attaching a
repro will help even more.

Dag

Re: Maximum depth of nested triggers was exceeded.

Posted by Rami Ojares / PDF-Comics Oy <ra...@absinth.fi>.
Yes, as I expected.
If I execute those same statements from a separate connection then 
everything works as expected.
No more "Maximum depth of nested triggers was exceeded."
So this is definately a bug.
I am using currently 10.5.3.1

- rami

> Hi,
>
> Now I have confirmed a following (rather alarming) issue.
>
> I have a before trigger on inserting a row in a table.
> That trigger either throws an exception or returns 0.
>
> Now on the client side a create a connection (autoCommit = true)
> And I start inserting rows all of which result in an exception thrown 
> by the before trigger.
> In my trigger function I print to console each time the trigger is 
> entered.
> For the first 16 rows the trigger is entered and throws an exception 
> (as expected).
> But after that the trigger is not entered and "Maximum depth of nested 
> triggers was exceeded." exception is thrown for all the rest of the 
> triggers.
>
> Derby reference says that "The maximum trigger recursion depth is 16."
> But my trigger does not cause other triggers to fire.
> The insert statements are separate transactions but created from the 
> same connection.
> It seems that derby starts adding the trigger recursion counter for 
> completely separate statements?!?
>
> I have to test now if I open a separate connection for each statement 
> what is going to happen.
> Will report soon.
>
> - rami
>
>