After some analysis it seems that: Query.query(int limit,ResultTarget resultTarget) allows me to disable reusal of results via: session.getDatabase().setOptimizeReuseResults(false);
This is helpful for my use case. My next problem however is finding a good way to truncate my table(s) once the query lifecycle is over. I tried following Sergi's advice of removing results in Table.unlock() but then the data's lost before being sent back to the caller. I will continue the discussion at that original thread: https://groups.google.com/group/h2-database/browse_thread/thread/10f11d8fb986bea6 AC On Jul 15, 10:51 pm, Atul <[email protected]> wrote: > Hi - > > I'm extending RegularTable to surface some complex object graphs in a > query-friendly JDBC-compliant form (H2). > > Once the select statement (query) is issued against H2, a "before > select trigger" populates the table for what's being requested, sends > it to the user and then truncates the table. So, my datasets are > short-lived, or just for the duration of the resultset being sent. > > My question: I want the same query to always do a NEW prepare and NOT > utilize any type of caching. I noticed that on a fresh start of H2, > new queries are received at Select.prepare(). Subsequent queries do > NOT make it to this method, as I assume they're cached. > > How do I disable this type of caching or have my query interpreted in > Select.prepare() every time? > > Thanks in advance - > > AC -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
