Re: NullPointerException when connecting to a database which is shutting down

Fred Toussi via Hsqldb-user <[email protected]> Sun, 03 Sep 2017 14:22:49 +0100
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <1504444969.2142479.1093763792.0078C85B@webmail.messagingengine.com>
You need to run the latest version instead of looking at the code.
Regarding your comment, only one session is allowed to close the
database, therefore it doesn't matter if closeAllSessions() is
synchronized or not. Code changes have also been made in other classes.
// Database.java
    public void close(int closemode) {

        HsqlException he = null;

        // multiple simultaneous close
        synchronized (this) {
            if (getState() != DATABASE_ONLINE) {
                return;
            }

            setState(DATABASE_CLOSING);
        }

        sessionManager.closeAllSessions();

On Sun, Sep 3, 2017, at 10:51, Lucas Ventura Carro wrote:
> 2017-09-01 13:39 GMT+02:00 Fred Toussi via Hsqldb-user <hsqldb-
> [email protected]>:>> __
>> This was probably spotted and fixed in version 2.35 / 2.40 or even
>> the snapshot released in July. Please check the code from SVN and see
>> if it has been fixed.> 
> No, don't seems to me as fixed: the Database.close() code looks the
> same as 2.2.9, and SessionManager.closeAllSessions() still not
> synchronized
> (https://sourceforge.net/p/hsqldb/svn/HEAD/tree/base/trunk/src/org/hsqldb/SessionManager.java#l199)> 
> 
> --
> Lucas
> ----------------------------------------------------------------------
> --------> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _________________________________________________
> Hsqldb-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user