We are seeing the same problem with boolean cmp fields not sticking after jboss bounces. This is for postgres with JBoss 2.4.1A. Would using the Boolean wrapper class work better?
Thanks in advance for any help,
Well, I figured out that booleans stick just fine with the Hypersonic database, so I've switched over to using that since my data requirements are quite lean. Hypersonic seems to be much faster for what I need, as well.
I've noticed this as welll (and looking for a solution to this problem brought me to this forum). I think the problem might stem from the fact that JDBC does not define a Boolean type. If you look in the Postgres Section of the standardjaws.xml, you will notice that they mapped boolean to the int2 SQL type and the SMALLINT JDBC type. THE JDBC types are defined in the Class Types (a pseudo enumeration) defined in the java.sql package.
However, I notice that they seem to update the DB correctly while running (assuming 1 is true and 0 is false). It just seems to get wiped out when it redeploys. I wonder if the Cache in the EJB which get's flushed when it is redeployed is incorrectly overwriting the value.
In some code we've implemented in the Struts layer, we do a direct JDBC call that reads the values out of the DB. This is reading both 0 and 1 as false. Could this be a problem in the PostgreSQL jdbc driver? Or is this mapping not supported somehow?