SQLContainer throws a Duplicate Entry Exception when commit

Hi,
Solved: Okay, I have forgotten to set the Version Column. Now it works. Thanks for reading.

Update: I figured out, that I have a generally problem, to commit changed itmes in my SQLContainer to the Database, so I made a small Example. I made a Button which just should change a property in the last item and commit this to the database.


Button resetButton = new Button("Change Property",new Button.ClickListener() {

            @Override
            public void buttonClick(Button.ClickEvent event) {
                Object lastId = app.getDbHelp().getSQLContainer().lastItemId();
                app.getDbHelp().getSQLContainer().getItem(lastId).getItemProperty("name").setValue("TEST");
                try {
                    app.getDbHelp().getUserContainer().commit();
                } catch (UnsupportedOperationException ex) {
                    Logger.getLogger(UserManagementPanel.class.getName()).log(Level.SEVERE, null, ex);
                } catch (SQLException ex) {
                    Logger.getLogger(UserManagementPanel.class.getName()).log(Level.SEVERE, null, ex);
                    getWindow().showNotification("SQLException" + ex.toString());
                }
            }
        });

The Database (MySQL) Table has several Columns, where “name” is the primary key. But it doesn’t matter if I change the Primary Key Column or any other, I get an Exception, that there is a duplicate Entry for Primary Key Value. When I make a table and add the SQLContainer as Datasource, it shows up as I want it and no duplicate entries.

What am I doing wrong?

bye
Chris