NullPointerException on SQLContainer commit(), IllegalStateException

Hello Vaadin users,

unfortunately my first post will be me asking for help with an issue I cannot solve. What is more, I cannot even deduce what is happening.
I am using Vaadin 6.8.5 along with one plugin,
FilteringTable
, and Eclipse Juno Java EE IDE on Windows operating system.

I am using a FilterTable to display the data and an SQLContainer to communicate with the HSQLDB database located in local files through JDBC Driver, mostly as described in Vaadin introductory Address Book example.

The application is more or less working now with one exception (pun not intended): from time to time, when removing object(s) from the SQLContainer and performing commit, a NullPointerException gets thrown at me, abruptly ending application run. The stack trace (a painfully long paste):

http://pastebay.net/1158346?p=Vaadin&submit=unlock

On selecting table row(s) and clicking a Remove button, a Set of ObjectIds is sent to the DbHelper method below. The trace specifically points to the line in bold (SQLContainer.commit method):

    public final boolean removeEmployees(final Set<?> selectedIds) {

        for (Object id : selectedIds) {
            employeeContainer.removeItem(id);
        }
        try {
            [b]
employeeContainer.commit();
[/b]
            return true;
        } catch (UnsupportedOperationException e) {
            System.out.println("Error: operation not supported, message: "
                    + e.getMessage());
            e.printStackTrace();
        } catch (SQLException e) {
            System.out.println("Error: failed to commit, message: "
                    + e.getMessage());
            e.printStackTrace();
        }
        return false;
    }

The problem is hardly reproducible. Sometimes I can perform removal of the whole table contents - 1000 entries which I have randomly generated and no exception will occur, sometimes even the first removal will end with exceptions being thrown.
It commonly occurs when deleting more rows than a buffer can hold (scrolling down the table and waiting for it to load new buffer, multiselection enabled), but it’s not a rule; it also happened when deleting as few as two rows.
Most of the cases though, the NullPointerException is joined by an IllegalStateException and the stack trace looks like this:

http://pastebay.net/1158345?p=Vaadin&submit=unlock

The IllegalStateException points to SQLContainer code.

If necessary, I can provide any other part of the code.
Any help much appreciated, thank you for your time. :slight_smile:

Edit:

I delved into the problem by myself a bit. The two IllegalStateException that sometimes accompany the NullPointerException point to beginTransaction() method of the TableQuery class:

[b]
if (transactionOpen && activeConnection != null) {
[/b]
            throw new IllegalStateException();
        }

Which is weird, as I always end adding or removing an object to or from the SQLContainer with a commit…

NullPointerException on the other hand points to the getLogger() method of the same class:

        [b]
getLogger().log(Level.FINE,
                "Removing row with id: " + row.getId().getId()[0]
.toString());
[/b]

Due to whimsical reproducibility, I could not yet trace one single row behind these exceptions. Looking at the logs of HSQLDB database, the records deleted right before the disastrous commit seem average, only some of them contain UTF-8 characters (\u0142, \u0144, etc., all Polish diacritics), sometimes at the beginning of the String, but surely that couldn’t be the cause?