On Fri, Aug 4, 2017 at 10:01 PM, Nico Williams <n...@cryptonector.com> wrote:
> On Fri, Aug 04, 2017 at 09:55:03PM +0200, Sylvain Pointeau wrote: > > On Fri, Aug 4, 2017 at 9:16 PM, Nico Williams <n...@cryptonector.com> > wrote: > > > In general I would say: pthread_once() (Unix) or InitOnceExecuteOnce() > > > (WIN32). But here, a global in combination with CREATE TEMP TABLE IF > > > NOT EXISTS is probably good enough. > > > > I wonder if a memory structure would not be better? > > Doesn't matter. You already have a solution. > > The main issue is that you can't tell when a transaction has begun or > ended, so you can't tell when curr_val() should raise an error. You can > only tell that next_val() has been called on this connection, and that's > not the same semantics as H2's. > > actually the temp table is better in case of rollback. however normally it should be executed under an autonomous transaction, a rollback should not affect the sequence. > I would just not bother with curr_val() for now. > I need it, but the current implementation should be enough. => I would really really like if a real implementation of the sequence could be done in sqlite, behaving like oracle. (very fast, reliable etc) Thanks for all your help! _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users