Hi, > but that can lead to deadlocks ... > e.g. see this previous discussion:
As part of that discussion, I wrote: "I suggest to use PreparedStatement, and always create a new PreparedStatement (for each invokation of the trigger). Internally, the database caches a low-level part of a PreparedStatement,..." So, I wonder if caching prepared statements is really a problem? > 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? The use case is: you might want to drop a table when the trigger is removed, but do nothing if the database is closed. Regards, Thomas On Sat, Jul 20, 2013 at 4:10 PM, Noel Grandin <[email protected]> wrote: > On Sat, Jul 20, 2013 at 3:11 PM, Thomas Mueller > <[email protected]> wrote: > > > >> That would allow the Trigger instances to create and cache > >> PreparedStatements in their init() method. > > > > Yes, if you look at the FullTextTrigger class (package org.h2.fulltext), > you > > can already cache the prepared statements, using this system session. > > > > Yeah, but that can lead to deadlocks, because the PreparedStatements > execute on a different session from the current session. > e.g. see this previous discussion: > https://groups.google.com/d/topic/h2-database/B3xG488RBhI/discussion > > -- > 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. > > > -- 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.
