SQLContainer remove item

Hi:

I’m trying to delete an item from a MySQL table using this code:

public void buttonClick(ClickEvent event) {
		Button boton=event.getButton();
		if (boton==deleteItem){
			container.removeItem(target);   //target from an action
			try {	
				container.commit();
			} catch (UnsupportedOperationException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			close(); //cloese the window where the button is
		}

but I get this error:

any Ide awhy is this happening?

Hi,

have you set up a correct Version Column to your SQLContainer?
For testing purposes you can take the primary key column.

bye
Chris

Hi:

thnaks for your answer…That is what I’m doing, but it doesn’t seem to work…

I think I ran into this and had to make sure the versionColumn was not Null or any other fields not Null before removing.

Dana