geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivanrc <iri...@indra.es>
Subject Booleans in CMP EJB2.1 with Geronimo 2.0.2 and Sql Server
Date Mon, 19 Nov 2007 09:41:24 GMT

Hello,

I´m using Apache Geronimo 2.0.2 and DataBase pool with SQL Server 2005. I´ve
got this remote interface defined in my EJB2.1 CMP...

/* Generated by Together */

package test;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;
import javax.ejb.EJBException;

public interface TestEntity extends EJBObject {
	Long getId() throws RemoteException, EJBException;

    void setId(Long param) throws RemoteException, EJBException;

    void setActive(Boolean active) throws RemoteException, EJBException;

    Boolean getActive() throws RemoteException, EJBException;
    
}


Boolean named "Active" is mapped with a BIT column type named "ACTIVE" into
SQL server data base, and then, the first time I invoke create() method of
my home interface, I obtain this exception...

10:23:16,453 ERROR [OpenEJB] The bean instances business method encountered
a system exception: Syntax error: Encountered "BIT" at line 1, column 56.
{stmnt 4757738 CREATE TABLE BOOLEAN_TABLE (ID BIGINT NOT NULL, ACTIVE BIT,
PRIMARY KEY (ID))} [code=30000, state=42X01]
<openjpa-1.0.0-r420667:568756 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: Syntax error:
Encountered "BIT" at line 1, column 56. {stmnt 4757738 CREATE TABLE
BOOLEAN_TABLE (ID BIGINT NOT NULL, ACTIVE BIT, PRIMARY KEY (ID))}
[code=30000, state=42X01]
	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:549)
	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:449)
	at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:170)
	at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:130)
	at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:186)
	at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
	at
org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createEntityManager(CMPEntityManagerTxScoped.java:74)
	at
org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getEntityManager(CMPEntityManagerTxScoped.java:55)
	at
org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getDelegate(CMPEntityManagerTxScoped.java:315)
	at
org.apache.openejb.core.cmp.jpa.JpaCmpEngine.registerListener(JpaCmpEngine.java:128)
	at
org.apache.openejb.core.cmp.jpa.JpaCmpEngine.getEntityManager(JpaCmpEngine.java:109)
	at
org.apache.openejb.core.cmp.jpa.JpaCmpEngine.createBean(JpaCmpEngine.java:140)
	at
org.apache.openejb.core.cmp.CmpContainer.createEJBObject(CmpContainer.java:638)
	at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:290)
	at
org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbHome_CREATE(EjbRequestHandler.java:240)
	at
org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:125)
	at
org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
	at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
	at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
	at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
	at org.apache.openejb.server.ServiceLogger.service(ServiceLogger.java:73)
	at
org.apache.openejb.server.ServiceAccessController.service(ServiceAccessController.java:55)
	at org.apache.openejb.server.ServiceDaemon$1.run(ServiceDaemon.java:117)
	at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Syntax error:
Encountered "BIT" at line 1, column 56. {stmnt 4757738 CREATE TABLE
BOOLEAN_TABLE (ID BIGINT NOT NULL, ACTIVE BIT, PRIMARY KEY (ID))}
[code=30000, state=42X01]
	at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
	at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$800(LoggingConnectionDecorator.java:57)
	at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:754)
	at
org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:114)
	at
org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1185)
	at
org.apache.openjpa.jdbc.schema.SchemaTool.createTable(SchemaTool.java:949)
	at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:526)
	at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:344)
	at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:321)
	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:497)
	... 25 more

As exception tell me, table named BOOLEAN_TABLE exist (with the same format)
before I invoked create method the fist time. The second time that I invoke
create method of home works well. I using SQL Server 2005 JDBC Driver 1.0
downloaded from Microsoft web page.

Do Anybody know how to I can solve this poblem?. How can I disable this
previous check of Table format?

Thanks.
-- 
View this message in context: http://www.nabble.com/Booleans-in-CMP-EJB2.1-with-Geronimo-2.0.2-and-Sql-Server-tf4834404s134.html#a13830532
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message