I've got a project using SQLite3 that I wanted to work on again. FWIW, I got smashed by a bug in the current SQLite3 code. The SQLiteconnection>>finalize method is wrong, as the self close in there has the following code: finalize self close. close self unregister. self isOpen ifTrue: [SqliteLibrary default close: reference]. reference := nil. #unregister is unregister self class registry remove: self ifAbsent: [] But, thing is that if close is called in finalize, is looking for reference, but reference is invalid because the object is not valid anymore. So, it appears to work and at one point (after, say, a number of execution of statements), the gc will kick in and try to finalize and the vm will bomb because te reference passed to SqliteLibrary default close: will just be something weird. A fix is to: * first get rid of the finalize method (One can just rename it to finalize_dont in order to not lose it just in case * modify open open reference := SqliteLibrary default open: fileName. self flag: #TODO. "This is fucked up" "self register." * modify close close self flag: #TODO. "This is fucked up. Fix it." "self unregister." self isOpen ifTrue: [SqliteLibrary default close: reference]. reference := nil. To get a connection: sqliteDb ^ db ifNil: [ db := SQLiteConnection fileNamed: (FileSystem disk workingDirectory / 'datasources' / 'data.db') fullName. ] Do a query: | result | result := self sqliteDb execute: 'SELECT * FROM question LIMIT ?' args: {aRowCount}. ^result. or self sqliteDb execute: 'SELECT * FROM writtenquestion LIMIT ?' args: {aRowCount} do: aBlock. HTH Phil On Sun, Mar 1, 2015 at 2:10 PM, Bernardo Ezequiel Contreras <vonbecmann@gmail.com> wrote:
here's Torsten Bergmann's email astares@gmx.de and blogspot http://astares.blogspot.com.ar/
get it in contact with him, and you may write some helpful documentation :)
Thanks.
On Sun, Mar 1, 2015 at 5:30 AM, Julien Delplanque <julien@tamere.eu> wrote:
Also, it would be great to give more details about the installation on Smalltalkhub (http://smalltalkhub.com/#!/~PharoExtras/NBSQLite3) and there is absolutely no details in http://smalltalkhub.com/#!/~TorstenBergmann/SQLite.
I think it would be great to give precisions about the version of the lib etc
Maybe also give the exact commands to have it fully working on each platforms?
Who do I have to contact if I want to help by writing a little bit more about installation details?
I mean no offense, I just want to help next people that will have troubles with that :p
Julien
-- Bernardo E.C.
Sent from a cheap desktop computer in South America.