NBSQLite on Moose 5.1 connection problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NBSQLite on Moose 5.1 connection problems

Torsten Bergmann
Offray wrote:
>We have been dealing with a pretty strange and awkward problem in our
>workshops regarding the NBSQlite package and Moose 5.1 interaction

I checked in a recent Moose 5.1 image from CI (which is based on latest Pharo 4 #40626)
and anything looks good (see screenshot attached). I tested on Windows, the sqlite3.dll
is placed in the VM executable directory (folder of Pharo.exe).

Unfortunately you just posted the stack trace - but not the error message that was displayed in the debugger.
But as it failed already in the first API call (opening sqlite) I can only guess it is again
the issue that the module was not found on your local machine.

But you also said sometimes it workes and sometimes not. Mmmmhh. In case you have Sqlite cipher support
already loaded you might have an issue after running the tests. I found the reason: The NBSQLCipher3ConnectionTest
switches to sqlcipher support in #setUp but does not reset the class variable #Library in NBSQLite3FFI which is holding the
module name back to 'sqlite' module in #tearDown). This was experimental stuff from Pierce anyway but it might have
been in the config loaded already.

I fixed this now in general by providing a #tearDown and updated the config with a new version 1.3 having also
all latest packages. Fix is not optimal as when one is using sqlciper module the NBSQLCipher3ConnectionTest
test switches back to sqlite then. But should be OK as most people use sqlite instead of sqlcipher and we discontinue
NBQLite3 package starting with Pharo 5 anyway.
(NBSqlite is not working with Pharo 5 because NB was dropped in favour of UFFI).

So anything green here in the tests with latest config when I try in fresh images (Pharo 4/Moose 5.1).
Also your example script works and outputs to the Transcript in both images.

So please:
==========
 1. load updated NBSqlite3 from config browser again in a fresh Mosse 5.1 image and try
    to provoke the error again

 2. In case you still have trouble check what the expression:
   
       NBSQLite3FFI classVarNamed: 'Library'

    returns. It should give #sqlite3 on Mac and 'sqlite3' on Linux/Windows

 3. If broken or the system still laments about the module you can even try to give
    the module with an absolute path:
 
     NBSQLite3FFI classVarNamed: 'Library' put: '/mypath/sqlite3.so'

HTH

Bye
T.
 


moose51nbsqlite.png (110K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NBSQLite on Moose 5.1 connection problems

Offray Vladimir Luna Cárdenas-2
Thanks Torsten for your quick answer.

Step 3 was the fix, so we can made explicit where libsqlite3.so is
installed. I will share your solution with the rest of the workshop
attendees.

Cheers,

Offray

On 29/03/16 15:30, Torsten Bergmann wrote:

> Offray wrote:
>> We have been dealing with a pretty strange and awkward problem in our
>> workshops regarding the NBSQlite package and Moose 5.1 interaction
> I checked in a recent Moose 5.1 image from CI (which is based on latest Pharo 4 #40626)
> and anything looks good (see screenshot attached). I tested on Windows, the sqlite3.dll
> is placed in the VM executable directory (folder of Pharo.exe).
>
> Unfortunately you just posted the stack trace - but not the error message that was displayed in the debugger.
> But as it failed already in the first API call (opening sqlite) I can only guess it is again
> the issue that the module was not found on your local machine.
>
> But you also said sometimes it workes and sometimes not. Mmmmhh. In case you have Sqlite cipher support
> already loaded you might have an issue after running the tests. I found the reason: The NBSQLCipher3ConnectionTest
> switches to sqlcipher support in #setUp but does not reset the class variable #Library in NBSQLite3FFI which is holding the
> module name back to 'sqlite' module in #tearDown). This was experimental stuff from Pierce anyway but it might have
> been in the config loaded already.
>
> I fixed this now in general by providing a #tearDown and updated the config with a new version 1.3 having also
> all latest packages. Fix is not optimal as when one is using sqlciper module the NBSQLCipher3ConnectionTest
> test switches back to sqlite then. But should be OK as most people use sqlite instead of sqlcipher and we discontinue
> NBQLite3 package starting with Pharo 5 anyway.
> (NBSqlite is not working with Pharo 5 because NB was dropped in favour of UFFI).
>
> So anything green here in the tests with latest config when I try in fresh images (Pharo 4/Moose 5.1).
> Also your example script works and outputs to the Transcript in both images.
>
> So please:
> ==========
>   1. load updated NBSqlite3 from config browser again in a fresh Mosse 5.1 image and try
>      to provoke the error again
>
>   2. In case you still have trouble check what the expression:
>    
>         NBSQLite3FFI classVarNamed: 'Library'
>
>      returns. It should give #sqlite3 on Mac and 'sqlite3' on Linux/Windows
>
>   3. If broken or the system still laments about the module you can even try to give
>      the module with an absolute path:
>  
>       NBSQLite3FFI classVarNamed: 'Library' put: '/mypath/sqlite3.so'
>
> HTH
>
> Bye
> T.
>  
>