Hi Thomas,

    Okay, thank you.

Please note that there is a typo in your commit. "if it return a single value" should be "if it *returns* a single value".

Gili

On 28/05/2013 12:45 AM, Thomas Mueller wrote:
Hi,

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 that creating the PreparedStatement should be fast. This is the "query cache", see also http://h2database.com/javadoc/org/h2/constant/DbSettings.html#QUERY_CACHE_SIZE - the documentation is actually wrong, as it doesn't just cache "select" statements as it used to, but also "delete", "insert", "update". I have updated the documentation: https://code.google.com/p/h2database/source/detail?r=4829

Regards,
Thomas



On Mon, May 27, 2013 at 10:14 PM, Gili <cow...@bbs.darktech.org <mailto:cow...@bbs.darktech.org>> wrote:

    So to follow-up on http://stackoverflow.com/q/16705097/14731, are
    triggers the only way to go? Or is there a better way to implement
    this?

    Thank you,
    Gil

    On Thursday, May 23, 2013 8:17:30 PM UTC-4, Gili wrote:

        Hi,

        Based on the third answer at
        
https://groups.google.com/forum/#!msg/h2-database/VoE3AU7mSuM/YAReMtnRsZQJ
        
<https://groups.google.com/forum/#%21msg/h2-database/VoE3AU7mSuM/YAReMtnRsZQJ> I
        am expecting a AFTER DELETE Trigger to get the same Connection
        as the statement that executed the DELETE operation, but it
        does not. I am seeing two separate connections and if they
        attempt to write to the same table the operation deadlocks.

        Did this behavior change since June 2010 (when linked post was
        made)? Are trigger supposed to get the same connection as the
        original operation? If not, is it possible to configure them
        to do so?

        I ask because I'm still trying to solve this question:
        http://stackoverflow.com/q/16705097/14731
        <http://stackoverflow.com/q/16705097/14731>
        Thanks,
        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 h2-database+unsubscr...@googlegroups.com
    <mailto:h2-database%2bunsubscr...@googlegroups.com>.
    To post to this group, send email to h2-database@googlegroups.com
    <mailto:h2-database@googlegroups.com>.
    Visit this group at http://groups.google.com/group/h2-database?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/B3xG488RBhI/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to