ixmp breaks until restart: "Unable to obtain Jdbc connection from DataSource"

108 views
Skip to first unread message

jasper...@googlemail.com

unread,
May 28, 2018, 5:47:57 AM5/28/18
to message_ix
Dear all,
do you also have the issue that the ixmp platform shuts down very frequently:
I am getting this error alot. Restarting the computer gets rid of the problem until it reappears. Any ideas on how to minimize this?
Best regards
Jasper 


launching ixmp.Platform with local HSQLDB database at 'C:\Users\geipel\.local\ixmp\localdb\default'
---------------------------------------------------------------------------
org.flywaydb.core.internal.dbsupport.FlywaySqlExceptionPyRaisableTraceback (most recent call last)
<ipython-input-2-b25af498959a> in <module>()
      1 # launch the IX modeling platform using the local default database
----> 2 mp = ix.Platform(dbtype='HSQLDB')

C:\ProgramData\Anaconda3\lib\site-packages\ixmp\core.py in __init__(self, dbprops, dbtype, jvmargs)
    106                 print("launching ixmp.Platform with local {} database at '{}'"
    107                       .format(dbtype, dbprops))
--> 108                 self._jobj = java.ixmp.Platform("Python", dbprops, dbtype)
    109         except TypeError:
    110             msg = ("Could not launch the JVM for the ixmp.Platform."

C:\ProgramData\Anaconda3\lib\site-packages\jpype\_jclass.py in _javaInit(self, *args)
    109     else:
    110         self.__javaobject__ = self.__class__.__javaclass__.newClassInstance(
--> 111             *args)
    112 
    113 

org.flywaydb.core.internal.dbsupport.FlywaySqlExceptionPyRaisable: org.flywaydb.core.internal.dbsupport.FlywaySqlException: 
Unable to obtain Jdbc connection from DataSource (jdbc:hsqldb:file:C:\Users\geipel\.local\ixmp\localdb\default) for user 'ixmp': Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@c2bc1203[file =C:\Users\geipel\.local\ixmp\localdb\default.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2018-05-28 09:43:29 heartbeat - read: -6152 ms.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State  : S1000
Error Code : -451
Message    : Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@c2bc1203[file =C:\Users\geipel\.local\ixmp\localdb\default.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2018-05-28 09:43:29 heartbeat - read: -6152 ms.


HUPPMANN Daniel

unread,
May 28, 2018, 9:49:15 AM5/28/18
to jasper...@googlemail.com, message_ix
Dear Jasper,

Sorry for the trouble!

It seems that you try to open multiple connections to the local HSQLDB - this does not work, in the same way that you cannot open a Word document on a network drive from two PCs simultaneously. Each notebook is its own process and unique connection to the database instance.

You need to close the connection in a notebook using the function `mp.close_db()` - then, you should be able to launch an platform instance and connect from another notebook. (If you want to connect again from the first notebook, close the connection in the other notebook and use `mp.open_db()`).

Just closing the browser window showing the notebook _does not close_ the Jupyter kernel, so the database connection will still be open. Terminating Jupyter should do the trick, however, no need to restart the computer.

I hope this is helpful!
Best regards,
Daniel

PS: for future expert users - it is possible to launch an HSQLDB instance in server mode, which will allow multiple connections.
> --
> You received this message because you are subscribed to the Google Groups "message_ix" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to message_ix+...@googlegroups.com.
> To post to this group, send email to messa...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/message_ix/3314fd38-a626-4056-b8eb-cbb4713c9577%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

jasper...@googlemail.com

unread,
May 29, 2018, 7:43:17 AM5/29/18
to message_ix
Dear Daniel,
thanks for the quick reply.

However that does unfortunatly not resolve the issue. I tried the

mp.close_db() command -->  NameError: name 'mp' is not defined
I restarted the Kernel& cleared output
File--> close and halted the notebook.
Verified on Jupyter Home screen that there are actually no notebooks running
Restarted Anaconda.

Yet the issue remains. 
Best
jasper
Reply all
Reply to author
Forward
0 new messages