Hi,
----- Original Message -----
From: "shivaken" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Thursday, July 31, 2003 5:43 AM
Subject: Problem: autoincrement can broke 1:1 relation


> Hi, I posted a mail about this problem before.
>
> But I want to let you know and evaluate my patch.
>

thanks for the patch. Please, can you send me a patch for
SequenceManagerNativeImpl (see CVS) too. Because
I don't want to support SequenceManagerMySQLImpl
any longer (to check your patch you can find a simple test case
called NativeIdentifierTest). thanks.

> To use db naive autoincrement, we use SequenceManagerNativeImpl and
> SequenceManagerMySQLImpl with access="readonly".
>
> But, in this way, auto incremented value can be modified when you do
> 'store, delete, store'.
>
exotic! ;-)

> This is caused like below
> ------------------------------------------------------
> // a.getId() == 0;
> broker.store(a);
>
> // a.getId() is setted;
> int aId = a.getId()
>
> // check restore value.
> a.equals(A.restoreByID(aId));
>
> broker.delete(a);
>
> broker.store(a);
> // a.getId() != aId;  other value, autoincremented one;
> ------------------------------------------------------
>
> This effect make treating foreign key harder wrong.
> 1:1 relation can be broken.
>
> This is not usual stuation. But, This is not the same behavior as
> SequenceManagerHighLowImpl.
>

hmm, your are right, this is different from using other sequence manager
implementations

> To fix this, SequenceManage has to update auto increment field only
when
> auto incremented by DB. the value must be changed when inserted.
>
> Please try my patch for MySQLImpl. Though that implementation is
ad-hoc.
> It behaves like HighLowImpl.
>
await eagerly your patch for SequenceManagerNativeImpl ;-)

regards,
Armin

> -- shivaken
> antshell: Ant command line front end
> http://www.antshell.org
>


------------------------------------------------------------------------
--------


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to