Hi Offray, On Fri, Jun 10, 2016 at 09:37:58AM -0500, Offray Vladimir Luna C??rdenas wrote:
On 09/06/16 23:39, Alistair Grant wrote:
[...]
I have seen one other problem with UDBC-SQLite3: if a connection is open when the image is saved, it must be manually closed and re-opened after the image is opened. Should this be handled automatically? If you think this should be working I'll put together some code to reproduce it.
[...]
I experienced something similar with NBSQLite3 before. Now I'm always closing my connections explicitly, once I have the collected info of the query in a "report" object of Pharo. I don't know if this could work in your case. In mine, the Panama Papers project has this, for example:
=============== OffshoresDB class>>totalOffshoresByCountryRaw "I query for the offshores by country data from a SQLite database file" | queryResults query | query := 'SELECT countries AS "country_name", count(countries) AS "total_offshores" FROM Addresses GROUP BY countries'. self dataLocation exists ifFalse: [ self inform: 'Download database first by running: ', String cr, '"OffshoreLeaks updateDatabase"' ] ifTrue: [ queryResults := (self database open execute: query) rows collect: [ :each | each data ]. self database isOpen ifTrue: [ self database close ]. ^ queryResults ] ===============
Thanks for the suggestion. I had tried this, however my application is fairly interactive, and Glorp proxies require the session to be logged in to operate correctly, so it doesn't work in my situation, unfortunately. I guess I'll write a startup script that closes and re-opens the session (I don't want to have to close everything when saving an image). Thanks again, Alistair