I found the cause. It's because that Derby treats "null" as a normal value in its unique indice implementation. If you create an unique index, derby will set the unique constraint on whole combination of all index fields no matter the value of one field is null or not.
e.g. table 'test' has two columns (a int not null, b int) with unique index on (a, b), then value combination (1, null) can be inserted into table once and only once. Workaround: set use-indices-unique="false" explicitly in entityengine.xml for derby database. to Jacques, Not test it on Postgres yet, but I think Postgres should be ok since Postgres doesn't allow nullable column in unique indice. That means (1, null) can be inserted to test table twice without unique index violation in previous example. to adnane, That's great. I need such detail document. I'm evaluating the feasibility to migrate the mysql database to postgres. The most important reason is Timestamp type of mysql does not support milliseconds. So, thank you in advance ^^. You can send it to 'sun.hao' at 'labwayit' dot 'com'. -- View this message in context: http://ofbiz.135035.n4.nabble.com/Exception-occured-when-I-try-to-add-a-new-person-tp3494394p3497786.html Sent from the OFBiz - User mailing list archive at Nabble.com.
