1 Reply Latest reply on Oct 1, 2003 11:29 AM by jonathantaub

    EJB-QL with a boolean field is causing problems

    jonathantaub

      I've got a simple EJB-QL:

      SELECT OBJECT(h) FROM Host as h WHERE h.isMonitored=TRUE and h.autoDiscovered=TRUE

      The 'isMonitored' and 'autoDiscovered' fields are booleans within the entity bean and the database table schema.

      When invoking the method, I get the following exception:

      getAllMonitoredAndAutoDiscoveredHosts(): Failed to retrieve hosts.
      javax.ejb.FinderException: Find failed: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-8006] (at 56): Data types must be compatible at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:194) at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:91)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:599)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:324)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:603)

      I tried setting 'h.isMonitored=1' in the EJB-QL but then I get an exception at deployment time stating it must be a boolean.

      I'm using SapDB database.
      I don't know whether the problem is in JBoss or the database.
      Any help is most welcome.