Bug 180 : Update on bean with only id and byte[] blob ... when not changed gives error
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.2.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
20/11/2009
Updated 
20/11/2009
Type 
Bug
 
Attachments 
No attachments

javax.persistence.PersistenceException: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement UPDATE TBYTES_ONLY SET WHERE[*] ID=? ; expected identifier; SQL statement:
update tbytes_only set where id=? [42001-115]
at com.avaje.ebean.server.persist.dml.DmlBeanPersister.execute(DmlBeanPersister.java:107)

 
Rob 20 Nov 11:20
To reproduce

Reference the TestByteOnly testcase.

Basically the dirty checking in EntityBeanIntercept uses standard equals ... but the value changed check used to detect changed properties checks the byte[] via length and values.

This results in the update with no columns being updated ... when the value set is exactly the same as the current value.

Rob 20 Nov 11:21
Fixed in HEAD

The fix is to incorporate the more strict dirty checking in EntityBeanIntercept ... both for byte[] and char[].

Fixed in HEAD.

woResponse

Upload a file