FrontBase problems, Boolean mapping
bvpaj Sep 11, 2002 11:22 AMHi, I'm a total EJB/JBoss newbie and I'm trying to configure jboss to work with FrontBase. I've learned a lot about jboss over the last week, but I've got a long way to go.
So now I've got it able to connect to FrontBase, create a table and insert some data, but I've got some problems yet.
The biggest problem, so far, is that I cannot get it to map a boolean (or Boolean) entity bean attribute to a BOOLEAN column in FrontBase. I'm using a CustomerEJB bean from a tutorial. Its remote interface defines the following attribute:
public boolean getHasGoodCredit() throws RemoteException;
public void setHasGoodCredit(boolean flag) throws RemoteException;
I've also tried changing this to
public Boolean getHasGoodCredit() throws RemoteException;
public void setHasGoodCredit(Boolean flag) throws RemoteException;
just to see if I'd get different results.
For my mapping in standardjbosscmp-jdbc.xml, I've tried:
<java-type>java.lang.Boolean</java-type>
<jdbc-type>CHAR</jdbc-type>
<sql-type>BOOLEAN</sql-type>
with the above "boolean" method declarations and
<java-type>java.lang.Boolean</java-type>
<jdbc-type>BIT</jdbc-type>
<sql-type>BOOLEAN</sql-type>
and
<java-type>java.lang.Boolean</java-type>
<jdbc-type>BOOLEAN</jdbc-type>
<sql-type>BOOLEAN</sql-type>
with the above "Boolean" method declarations
This first gave me an exception "Semantic error 231. INSERT value doesn't match column: HAS_GOOD_CREDIT." and the latter 2 gave me an exception "Semantic error 217. Datatypes are not comparable or doesn't match."
Any idea what how to fix this?
Another problem that I'm having is when it creates a table (my bean's jbosscmp-jdbc.xml is configured as <create-table>true</create-table>), it successfully creates the table, but follows this with a "ResourceException" indicating "Exception condition 246. Invalid transaction state." This indicates to me that jboss was trying to close down a connection to FrontBase while FrontBase thought it was in the middle of a transaction. Any idea how to resolve this problem? This isn't a critical problem for me, as it does create the table and in any event, I probably wouldn't end up using it to create tables in a finished product, but I'd still like to know what is going on and getting it working correctly...
Thanks in advance for any help.