Hi Thomas,
On 17/07/2013 12:35 PM, Thomas Mueller wrote:
Hi,
Hm, it's interesting, but I'm not quite sure if the change is worth
it. What are the pain points?
> ability to clean up resources when a trigger is dropped (not just
when the database is closed)
There are already method Trigger.remove() and Trigger.close(). Your
interface only has close(). So it's actually one step back from what
we have now?
Hi Thomas,
I am under the impression that it doesn't matter whether a
Trigger's resources get cleaned up due to the Trigger being dropped or
the database being closed. Do you have a use-case that counters that?
>Simplified init() method
Well, in a way you added complexity by adding a class. But I see your
point, having 6 parameters isn't all that great. But this change alone
isn't worth the trouble I think. Changing the API needs to have a
real, big benefit.
Today you have 6 parameters. Tomorrow you will have 12. This
approach makes it easier to evolve the API in the future. This isn't an
argument in favor of the new interface, it's just icing on the cake.
>Performance benefit for triggers that process multiple rows
Sorry what is the performance benefit? Also, do you have a benchmark?
I am referring to the fact that currently if I want to process N
rows, you need to create N * PreparedStatements (one per row inside
fire()) as opposed to once at the beginning of the transaction. You are
right that this needs to be benchmarked.
> Ability to detect when triggers are fired by SELECT or ROLLBACK
Well, what would you pass when rolling back an update in the fire
method: UPDATE or ROLLBACK? In fact both should be passed...
In the case you described (update followed by a rollback) the
trigger would fire() once for UPDATE and once for ROLLBACK. There is
also the conceptual benefit of the API explicitly stating the
StatementType as opposed to having users reverse-engineer it from other
parameters.
Gili
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.