SQLContainer and rowIdChangeListener

Hi,

Does anybody know why rowIdChangeListener in SQLContainer behaves like this (Vaadin 7.1.12, MySQL 5)? I add new item to SQLContainer, modify it and commit. Row is OK in MySQL, no problems here. Then I have rowIdChangeListener to get the item’s new id after database commit and I the results seem unexpected, at least to me.

This code first tests if new row id is in container and then tries to fetch it. Result is

containsId = true
Item = null

sql.addRowIdChangeListener(new RowIdChangeListener() { @Override public void rowIdChange(RowIdChangeEvent row) { RowId id = row.getNewRowId(); System.out.println("containsId = " + sql.containsId(id)); System.out.println("Item = " + sql.getItem(id)); } }); Second code prints out new id and tries to fetch it. Then it lists all ids and tries to fetch those, result is

New row id = 2555
New item = null
id = 2555 item = ID:2555|id:2555|timestamp:2014-03-12 10:06:17.0|text:hello world
id = Temporary row id item = ID:Temporary row id|id:null|timestamp:null|text:hello world

sql.addRowIdChangeListener(new RowIdChangeListener() { @Override public void rowIdChange(RowIdChangeEvent row) { System.out.println("New row id = " + row.getNewRowId()); System.out.println("New item = " + sql.getItem(row.getNewRowId())); Collection itemIds = sql.getItemIds(); for(Object id : itemIds) { System.out.println("id = " + id + " item = " + sql.getItem(id)); } } }); Any ideas what’s wrong here? How can I access reliably the newly comitted item?