Re: [Pharo-users] SQLite and sure last_insert_rowid

2016-07-20 Thread Hilaire
Hi Pierce, Yes, I already knew about this problem and documentation. That's why I do it in a transaction. My question was about be unsure my code example do it correctly in Pharo. Thanks Hilaire Le 20/07/2016 21:09, Pierce Ng a écrit : > On Sat, Jul 16, 2016 at 02:19:37PM +0800, Hilaire wrote:

Re: [Pharo-users] SQLite and sure last_insert_rowid

2016-07-20 Thread Pierce Ng
On Sat, Jul 16, 2016 at 02:19:37PM +0800, Hilaire wrote: > In a multi-thread context use of Sqlite, I try to find out how one will > fetch securely the automatically last row index of a Primary key. > > The problem seems to be that between the insert of rows in a table and > the moment you request

Re: [Pharo-users] SQLite and sure last_insert_rowid

2016-07-16 Thread Sven Van Caekenberghe
> On 16 Jul 2016, at 11:54, Hilaire wrote: > > Hi Sven, > > I know but my questioning is how you will do it properly with Pharo > driver for Sqlite. > In my previous email, I shared how I think doing it but I am not sure it > is the proper way. Ah yes, I didn't read all the way through. > For

Re: [Pharo-users] SQLite and sure last_insert_rowid

2016-07-16 Thread Hilaire
Hi Sven, I know but my questioning is how you will do it properly with Pharo driver for Sqlite. In my previous email, I shared how I think doing it but I am not sure it is the proper way. For example, NBSqlite3ResultSet (specific to Pharo driver) produces rows on demand, is such instance valid on

Re: [Pharo-users] SQLite and sure last_insert_rowid

2016-07-16 Thread Sven Van Caekenberghe
That are SQL 101 questions, this is a Pharo list ;-) You should wrap your SQL statements in a transactions, https://sqlite.org/lang_transaction.html > On 16 Jul 2016, at 08:19, Hilaire wrote: > > Hi guys, > > In a multi-thread context use of Sqlite, I try to find out how one will > fetch secu

[Pharo-users] SQLite and sure last_insert_rowid

2016-07-15 Thread Hilaire
Hi guys, In a multi-thread context use of Sqlite, I try to find out how one will fetch securely the automatically last row index of a Primary key. The problem seems to be that between the insert of rows in a table and the moment you request the last row id, you may have another insert from anothe