db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TINO SCHÖLLHORN <tschoellh...@tiscali.de>
Subject Re: Patch for PlatformMsAccessImpl
Date Thu, 27 Nov 2003 21:14:31 GMT
Hello Jakob,

first - of course the implementation should use the operator instanceof. The
comparison I sent to you was quite stupid. But - second - I tried to use

ps.setLong(index,((Long)value).longValue());

instead of the conversion to an int value but again I got the error
"Optionales Feature wurde nicht implementiert". I remember that Access
cannot store primary key values greater than 2^32 - so the
PlatformMsAccessImpl doesn't have to care about it, because the underlying
"database" cannot handle the data anyway.

So I think the conversion to an int-value suggested from me has to be used.

Tino
----- Original Message ----- 
From: "Jakob Braeuchi" <jbraeuchi@gmx.ch>
Newsgroups: gmane.comp.jakarta.ojb.devel
Sent: Thursday, November 27, 2003 8:37 PM
Subject: Re: Patch for PlatformMsAccessImpl


> hi tino,
>
> i remember once having the same problem. and im it can be solved by
> using setLong instead of setObject:
>
> ..
>   ps.setLong(index,((Long)value).longValue());
> ..
>
> could you please verify ?
>
> jakob
>
> Jakob Braeuchi wrote:
>
> > hi tino,
> >
> > what about using instanceof ?
> >
> > ....
> > // that the conversion fails - but I don't think that is an issues with
> > Access anyway.
> > else if (value instanceof Long)
> > {
> >         ps.setObject(index, new Integer(((Long)value).intValue()));
> > }
> > else
> > ....
> >
> > does this also solve your problem ?
> >
> > jakob
> >
> > TINO SCHÖLLHORN wrote:
> >
> >> Hi,
> >>
> >> I am not quite sure if this is the right place for posting this
message.
> >>
> >> I found a bug in rc4 in the PlatformMsAccessImpl: When trying to delete
a
> >> n:m-relation between two classes OJB assumes that the values in the
> >> intermediary table are represented as longs and passes the value as
> >> java.lang.Long to the method setObjectForStatement.
> >> But ODBC can't handle this. I attached a quite simple fix of the
> >> PlatformMsAccessImpl which handles this case correctly (at least it
work
> >> fine with me).
> >>
> >> As I tried to lock down this error I came yet to another topic: it
> >> would be
> >> quite handy if one could plug-in other Platform-Implementations without
> >> having to recomple the complete package again. I think you could easily
> >> change the PlatformFactory that it uses a value from the repository.xml
> >>
> >> cheers
> >> Tino
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> >> For additional commands, e-mail: ojb-dev-help@db.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-dev-help@db.apache.org
> >
> >



---------------------------------------------------------------------
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