Search code examples
javadb4o

Serializable[] attribute in Object not stored in db4o


I ran in a strange behavior of db4o. When I persist an Object (implementing Serializable) with an attribute of Serializable[], the Array is only returned once from the store correctly then ever after only an Array with null elements.

I use db4o 7.12.

Edit

This is the POJO:

public class ResponseRowWrapper implements Serializable {

/**
 * 
 */
private static final long serialVersionUID = 1L;


private long uuid;
private long responseUuid;
private Serializable[] row;
private long timestamp;

And this the config in spring:

        <property name="transparentActivation" value="true" />
    <property name="transparentPersistence" value="true" />
    <property name="configurationCreationMode" value="NEW" />
    <property name="lockDatabaseFile" value="false" />
    <property name="callConstructors" value="true" />
    <property name="exceptionsOnNotStorable" value="true" />

and in in the db4o Config Object:

configuration.common().objectClass(ResponseRowWrapper.class).cascadeOnUpdate(true);

Solution

  • I solved it, but I can't tell what was wrong with a Serializable[] but it is not working, I need to use Object[] and just care by myself that there are only Serializables inside.