Re: Bug in OJB 1.0.3 (MS SQL violation constraint on cascaded table)

2006-06-15 Thread Armin Waibel

Hi Richter,

Edson Carlos Ericksson Richter wrote:

Hi!

I discovered an interesting (bug?) behaviour in OJB 1.0.3.
I am using auto-commit false for every connection.
When I store an object that has an list with cascade all, but one object 
in the list fail to store, then I got "Primary Key violation - attempt 
to insert duplicate key on PRIMARY_TABLE" (where PRIMARY_TABLE is table 
name of object I asked to store).


I don't know why OJB is trying to insert object twice (insert main 
object with newly generated value, insert child object with error, try 
to insert main object again but with value already defined, causing PK 
violation) when error occured, but it is. Since my object is 
auto-numbered, first attemp it get one value from sequence (procedure), 
second attemp, since object already has key defined, it tries to just 
insert, causing duplicate key.


I don't know if it was clear, but this is what is happening.



Could you please run your test against latest version from SVN 
(OJB_1_0_RELEASE branch)? If the problem still happen, please open a bug 
report in JIRA (if possible with unit test or modified existing test in 
test-suite or pseudo code example to reproduce the bug).


regards,
Armin



Thanks,

Richter





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



Re: Bug in OJB 1.0.3 (MS SQL violation constraint on cascaded table)

2006-06-15 Thread Edson Carlos Ericksson Richter

No news if this is confirmed against 1.0.4?

Richter

Edson Carlos Ericksson Richter escreveu:

Hi!

I discovered an interesting (bug?) behaviour in OJB 1.0.3.
I am using auto-commit false for every connection.
When I store an object that has an list with cascade all, but one 
object in the list fail to store, then I got "Primary Key violation - 
attempt to insert duplicate key on PRIMARY_TABLE" (where PRIMARY_TABLE 
is table name of object I asked to store).


I don't know why OJB is trying to insert object twice (insert main 
object with newly generated value, insert child object with error, try 
to insert main object again but with value already defined, causing PK 
violation) when error occured, but it is. Since my object is 
auto-numbered, first attemp it get one value from sequence 
(procedure), second attemp, since object already has key defined, it 
tries to just insert, causing duplicate key.


I don't know if it was clear, but this is what is happening.

Thanks,

Richter




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

Bug in OJB 1.0.3 (MS SQL violation constraint on cascaded table)

2006-06-02 Thread Edson Carlos Ericksson Richter

Hi!

I discovered an interesting (bug?) behaviour in OJB 1.0.3.
I am using auto-commit false for every connection.
When I store an object that has an list with cascade all, but one object 
in the list fail to store, then I got "Primary Key violation - attempt 
to insert duplicate key on PRIMARY_TABLE" (where PRIMARY_TABLE is table 
name of object I asked to store).


I don't know why OJB is trying to insert object twice (insert main 
object with newly generated value, insert child object with error, try 
to insert main object again but with value already defined, causing PK 
violation) when error occured, but it is. Since my object is 
auto-numbered, first attemp it get one value from sequence (procedure), 
second attemp, since object already has key defined, it tries to just 
insert, causing duplicate key.


I don't know if it was clear, but this is what is happening.

Thanks,

Richter


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