Hello all, I ran into an interesting issue in Vaadin 7.3.9 (although probably present elsewhere).
I have a buffered TextField bound to a Property implementing Property.Transactional.
I called commit() on the TextField, but found that commit() was never called on the Property.
After stepping through it, this is the code I found in AbstractField.commit()
[code]
public void commit() throws Buffered.SourceException, InvalidValueException {
if (dataSource != null && !dataSource.isReadOnly()) {
if ((isInvalidCommitted() || isValid())) {
try {
// Commits the value to datasource.
valueWasModifiedByDataSourceDuringCommit = false;
committingValueToDataSource = true;
getPropertyDataSource().setValue(getConvertedValue());
} catch (final Throwable e) {
// Sets the buffering state.
SourceException sourceException = new Buffered.SourceException(
this, e);
setCurrentBufferedSourceException(sourceException);
// Throws the source exception.
throw sourceException;
} finally {
committingValueToDataSource = false;
}
} else {
/* An invalid value and we don't allow them, throw the exception */
validate();
}
}
// The abstract field is not modified anymore
if (isModified()) {
setModified(false);
}
// If successful, remove set the buffering state to be ok
if (getCurrentBufferedSourceException() != null) {
setCurrentBufferedSourceException(null);
}
if (valueWasModifiedByDataSourceDuringCommit) {
valueWasModifiedByDataSourceDuringCommit = false;
fireValueChange(false);
}
}
[/code]It seems that commit() is never actually called on the Property.
I would expect to find something like this in the try block:
if (getPropertyDataSource() instanceof Property.Transactional)
{
getPropertyDataSource().commit();
}
Is this a bug?
Thank you,
Chris Boyd