db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Gilbert" <agilb...@soundbite.com>
Subject RE: Rev 1.13 of Identity - Conversion Test Failures
Date Thu, 20 Feb 2003 18:42:30 GMT
Following up on this, looks like the PK is never getting converted. Change 1.13 prevents this
from happening when the Identity is init'ed, the StatementManager doesn't appear to check
for conversion inside bindSelect().

Our test case and stack trace follow. Campaign is a pretty simple class which happens to require
a custom conversion for it's primary key.

   /**
    * Test create
    */
   public void testCreate() throws Throwable {
      Campaign c = new Campaign();
      c.setName("TestCreate-1");
      pb.beginTransaction();
      pb.store(c);
      pb.commitTransaction();
   }


1) testCreate(COM.soundbite.biz.campaign.CampaignTestCase)
java.lang.ClassCastException
        at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:1934)
        at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2052)
        at org.apache.ojb.broker.platforms.PlatformDefaultImpl.setObjectForStatement(PlatformDefaultImpl.java:229)
        at org.apache.ojb.broker.platforms.PlatformOracleImpl.setObjectForStatement(PlatformOracleImpl.java:126)
        at org.apache.ojb.broker.accesslayer.StatementManager.bindSelect(StatementManager.java:539)
        at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(JdbcAccessImpl.java:493)
        at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:641)
        at org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:152)
        at COM.soundbite.biz.campaign.CampaignTestCase.testCreate(CampaignTestCase.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at COM.soundbite.biz.campaign.CampaignTestCase.main(CampaignTestCase.java:27)


> -----Original Message-----
> From: Andrew Gilbert 
> Sent: Thursday, February 20, 2003 1:20 PM
> To: OJB Developers List
> Subject: Rev 1.13 of Identity - Conversion Test Failures
> 
> 
> This change has broken our use of custom FieldConversion for 
> a PK when creating or updating the persistent object. It also 
> seems to introduce a hard error in the unit tests.
> 
> Not too familiar with the code yet but would seem something 
> is amiss here.
> 
> Thanks
> 
> Index: Identity.java
> ===================================================================
> RCS file: 
> /home/cvspublic/db-ojb/src/java/org/apache/ojb/broker/Identity.java,v
> retrieving revision 1.13
> diff -r1.13 Identity.java
> 195,196c195
> <                 // BRJ: do not convertToSql
> <                 this.pkValues = 
> targetBroker.serviceBrokerHelper().getKeyValues(cld, 
> objectToIdentitify,false);
> ---
> >                 this.pkValues = 
> targetBroker.serviceBrokerHelper().getKeyValues(cld, 
> objectToIdentitify);
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

Mime
View raw message