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,
, 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):

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) {
        try {
            return true;
        } catch (UnsupportedOperationException e) {
            System.out.println("Error: operation not supported, message: "
                    + e.getMessage());
        } catch (SQLException e) {
            System.out.println("Error: failed to commit, message: "
                    + e.getMessage());
        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:

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:


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:

if (transactionOpen && activeConnection != null) {
            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:

                "Removing row with id: " + row.getId().getId()[0]

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?