db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Marquard <David_Marqu...@forgent.com>
Subject RE: [OJB] Issue #OJB136 modified
Date Wed, 05 Mar 2003 22:45:38 GMT
That's not right! The patch doesn't result in double conversion. The current
(unpatched) code does something like this:

result = broker.serviceSequenceManager().getUniqueObject(fmd);
// reflect autoincrement value back into object
f.set(obj, result);
           ^^^^^^ 

As you can see, an *unconverted* object is being retrieved from the sequence
manager and set directly into a persistent field without a field conversion
being run on it. The patch changes that second line to:

f.set(obj, fmd.getFieldConversion().sqlToJava(result));

which properly converts the object before setting it in the persistent
field. The converted object *is not* returned from getAutoIncrement(), and
thus does not cause double conversions. In fact, callers of
getAutoIncrement() won't see any difference at all.

Dave

-----Original Message-----
From: Jakob Braeuchi [mailto:jbraeuchi@hotmail.com]
Sent: Wednesday, March 05, 2003 8:33 AM
To: Dave Marquard
Cc: ojb-dev@db.apache.org
Subject: [OJB] Issue #OJB136 modified



Issue OJB136 has just been modified by user brj

You can view the issue detail at the following URL:
     <http://scarab.werken.com/scarab/issues/id/OJB136>

The following modifications were made to this issue:

getAutoIncrement is called be other mehods of BrokerHelper which DO field
conversion.
applying this patch results in double conversion.  



Mime
View raw message