-
1. Re: boolean CMP fields not sticking...
jeremy Oct 11, 2001 7:34 PM (in response to thorinside)Hey All,
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,
Jeremy -
2. Re: boolean CMP fields not sticking...
thorinside Oct 15, 2001 1:08 PM (in response to thorinside)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.
-Neal -
3. Re: boolean CMP fields not sticking...
admiyo Oct 16, 2001 4:30 PM (in response to thorinside)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?