Hi,
I am curious if there is some rule about when does the Derby engine push a new StatementContext? I have tried couple examples and noticed few cases where a new StatementContext is pushed and later popped.
1)When a user gives a sql statement and if it is not in the cache, then during the compilation phase, a StatementContext is pushed and at the end of compilation, the StatementContext is popped. When the execution phase starts for the statement, a new StatementContext is pushed and at the end of execution, the StatementContext is popped.
2)When the user moves in a JDBC ResultSet with next/first/last etc, a StatementContext is pushed and popped around the ResultSet movement code.
3)If a trigger is defined on a dml statement, trigger execution has its own StatementContext.
My question is when is there a need to push a new StatementContext rather than using an existing one?
thanks,
Mamta
