I am using Hibernate 3.6 on two different boxes, both reading from exactly the same database table. The Hibernate annotation for two fields is as such:
@Basic(fetch=FetchType.EAGER)
@Column(name="encryptedkey",length = 256)
protected byte[] encryptedKey;
@Basic(fetch=FetchType.EAGER)
@Column(name="encryptediv",length = 256)
protected byte[] encryptedIV;
Now, when loading the entity with those properties on one machine (Ubuntu Linux with Sun JDK 1.6.0_22-b04), I am able to load the 256-byte encrypted keys and IVs.
However, it is not the case on another machine (Windows 2003 server SP2 Enterprise Edition with Sun JVM 1.6.0_22-b04), I have either 0 or 511 bytes loaded for each field. Otherwise, the Jar files on both systems are the same.
The database engine is PostgreSQL 9.0 and I'm using the latest PostgreSQL JDBC driver.
Anyone has any idea what could be going wrong?
bytea