You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@continuum.apache.org by Brent Atkinson <ba...@usm.maine.edu> on 2010/01/16 07:26:15 UTC

Continuum 1.3.5 on Postgresql JDO boolean mapping

Hi,

Can anyone explain why some boolean fields on SystemConfiguration are encoded as booleans, while distributedBuildEnabled is encoded as Y/N string? 

The modello configuration for SystemConfiguration shows multiple boolean fields:
trunk/continuum-model/src/main/mdo/continuum.xml@899327 (lines 1280-1350)

But for some reason distributedBuildEnabled is overridden to be of type CHAR:
trunk/continuum-model/src/main/resources/package-default.orm@899322 (lines 6-12)

It's causing the following error when attempting to upgrade a continuum database from 1.2.3 to 1.3.5. Is there a good reason why distributedBuildEnabled is explicity encoded as a CHAR?

Thanks,

Brent

Exception in thread "main" javax.jdo.JDODataStoreException: Insert request failed: INSERT INTO "SYSTEMCONFIGURATION" ("SYSTEMCONFIGURATION_ID","WORKING_DIRECTORY","DEPLOYMENT_REPOSITORY_DIRECTORY","DEFAULT_SCHEDULE_DESCRIPTION","NUMBER_OF_BUILDS_IN_PARALLEL","DEFAULT_SCHEDULE_CRON_EXPRESSION","RELEASE_OUTPUT_DIRECTORY","BUILD_OUTPUT_DIRECTORY","BASE_URL","GUEST_ACCOUNT_ENABLED","DISTRIBUTED_BUILD_ENABLED","INITIALIZED") VALUES (?,?,?,?,?,?,?,?,?,?,?,?)
        at org.jpox.store.rdbms.request.InsertRequest.execute(InsertRequest.java:455)
        at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java:2519)
        at org.jpox.store.StoreManager.insert(StoreManager.java:920)
        at org.jpox.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:3647)
        at org.jpox.state.StateManagerImpl.makePersistent(StateManagerImpl.java:3626)
        at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1198)
        at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1261)
        at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:97)
        at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:78)
        at org.apache.maven.continuum.management.JdoDataManagementTool.restoreDatabase(JdoDataManagementTool.java:263)
        at org.apache.maven.continuum.management.DataManagementCli.processDatabase(DataManagementCli.java:314)
        at org.apache.maven.continuum.management.DataManagementCli.main(DataManagementCli.java:189)
NestedThrowablesStackTrace:
org.postgresql.util.PSQLException: ERROR: column "DISTRIBUTED_BUILD_ENABLED" is of type character but expression is of type boolean
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1548)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1316)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:191)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305)
        at org.jpox.store.rdbms.RDBMSManager.executeStatementUpdate(RDBMSManager.java:572)
        at org.jpox.store.rdbms.request.InsertRequest.execute(InsertRequest.java:328)
        at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java:2519)
        at org.jpox.store.StoreManager.insert(StoreManager.java:920)
        at org.jpox.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:3647)
        at org.jpox.state.StateManagerImpl.makePersistent(StateManagerImpl.java:3626)
        at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1198)
        at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1261)
        at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:97)
        at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:78)
        at org.apache.maven.continuum.management.JdoDataManagementTool.restoreDatabase(JdoDataManagementTool.java:263)
        at org.apache.maven.continuum.management.DataManagementCli.processDatabase(DataManagementCli.java:314)


Re: Continuum 1.3.5 on Postgresql JDO boolean mapping

Posted by Brett Porter <br...@apache.org>.
On 16/01/2010, at 5:26 PM, Brent Atkinson wrote:

> Hi,
> 
> Can anyone explain why some boolean fields on SystemConfiguration are encoded as booleans, while distributedBuildEnabled is encoded as Y/N string? 
> 
> The modello configuration for SystemConfiguration shows multiple boolean fields:
> trunk/continuum-model/src/main/mdo/continuum.xml@899327 (lines 1280-1350)
> 
> But for some reason distributedBuildEnabled is overridden to be of type CHAR:
> trunk/continuum-model/src/main/resources/package-default.orm@899322 (lines 6-12)
> 
> It's causing the following error when attempting to upgrade a continuum database from 1.2.3 to 1.3.5. Is there a good reason why distributedBuildEnabled is explicity encoded as a CHAR?

http://svn.apache.org/viewvc?view=revision&revision=766106

It was added to make the automatic upgrades work on MySQL - it was also attempting to insert 'false' into a CHAR field (which it uses for booleans). Why the Postgres one isn't using the value from the package file I'm not sure.

- Brett

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/