Adding items won't update the Table after deleting items from the table

I’m trying to make an SQL table editable. Everything works as expected except when trying to add rows to table after a row has been deleted. It gets added to container and if saved, it displays correctly. But it never appears in the browser table. Also, if you save after deleting some items, and then try to add something. everything works again. Any idea why? Thanks.

For clarification:

Problem order of execution:

     [indent]

Delete one or more items from the table.

[/indent]
[indent]

Add an Item to the table (gets added to the container, but table never updates)

[/indent]

[indent]

What works:
[/indent]
[indent]

Delete one or more items from the table.

[/indent]
[indent]

Save

[/indent]
[indent]

Add an Item to the table (everything is displayed correctly)

[/indent]

Initialization

 SimpleJDBCConnection = null;
TableQuery tableQuery = null;
SQLContainer container = null;

try {
   connection = new SimpleJDBCConnectionPool( Connection Params);
   tableQuery = new TableQuery("tablename", connection);
   container = new SQLContainer(tq);
} catch {
   //Error
}

Table table = new Table();
//table.setWidth("100%");
table.setContainerDataSource(container);

Methods associated with buttons


   /**
   * Saves changes made to the database
   */
    public void save() throws Exception {
        try {
            container.commit();
            tableQuery.beginTransaction();
            tableQuery.commit();
        } catch (UnsupportedOperationException ex) {
            Logger.getLogger(EditableDatabaseTableGenerator.class.getName()).
                    log(Level.SEVERE, "At Save", ex);
            throw new  Exception(ex.getMessage());
        } catch (SQLException ex) {
            Logger.getLogger(EditableDatabaseTableGenerator.class.getName()).
                    log(Level.SEVERE, "At Save", ex);
            throw new Exception(ex.getMessage());
        }
    }

    /**
     * Adds an item to the container
     */
    public void add() {
        container.addItem();
    }
    
    public void delete(Object rowId) {
        container.removeItem(rowId);
    }

Has anyone tried this?