You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Rajarshi Pain <ra...@gmail.com> on 2018/01/12 18:27:38 UTC

Exception Occuredjava.sql.BatchUpdateException: ORA-00001: unique constraint

Hi,

We were doing a POC(Ignite 2.3 - oracle) to check how cache Persistence
Store works using writeBehind, We are updating data as a batch rather than
updating one by one record.

though there are no duplication record but still getting "unique
constraint" exception.

We couldnt find any root cause for this not sure is any issue if this is a
possible ignite bug as this error is coming randomly.

Also in another POC we have seen that it's not inserting all the data to
the database.
For example we have pushed 10K but in Database we can only see 9800, though
there is no error or exception.

could you please shade some lights on these issues ?

Sample Code:

for(int i=1;i<=100000;i++)
{
frstnm="test1name"+i;
scndnm="test2name";
p1 = new Person(i, frstnm, scndnm);
cache.put((long)i, p1);
}


insert into PERSON (id, firstname, lastname) values (?, ?, ?)

*inside write: *

st.setLong(1, val.getId());
st.setString(2, val.getFirstName());
st.setString(3, val.getLastName());
st.addBatch();
if(counter==100)
{
System.out.println("Counter "+ counter);
st.executeBatch();
counter=0;
}

got exception after 11K records

Exception Occuredjava.sql.BatchUpdateException: ORA-00001: unique
constraint ​

-- 
Regards,
Rajarshi Pain

Re: Exception Occuredjava.sql.BatchUpdateException: ORA-00001: unique constraint

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

As for 9800 entries instead of 10000 - most possible that you just have
a small mistake when you work with your counter and these entries were not
written to the DB: if(counter==100)

Anyway, for both problems community need additional information for an
investigation. It would be great if you could share your full project with
all configs and code, so the community can fast reproduce your issue and
help you.

Evgenii


2018-01-14 10:32 GMT+03:00 Rajarshi Pain <ra...@gmail.com>:

> Hello,
>
> Can someone please help me on this scenario if somewhere I am making any
> mistake ?
>
> Thanks,
> Raj
>
> On Fri, Jan 12, 2018 at 11:57 PM, Rajarshi Pain <ra...@gmail.com>
> wrote:
>
>> Hi,
>>
>> We were doing a POC(Ignite 2.3 - oracle) to check how cache Persistence
>> Store works using writeBehind, We are updating data as a batch rather than
>> updating one by one record.
>>
>> though there are no duplication record but still getting "unique
>> constraint" exception.
>>
>> We couldnt find any root cause for this not sure is any issue if this is
>> a possible ignite bug as this error is coming randomly.
>>
>> Also in another POC we have seen that it's not inserting all the data to
>> the database.
>> For example we have pushed 10K but in Database we can only see 9800,
>> though there is no error or exception.
>>
>> could you please shade some lights on these issues ?
>>
>> Sample Code:
>>
>> for(int i=1;i<=100000;i++)
>> {
>> frstnm="test1name"+i;
>> scndnm="test2name";
>> p1 = new Person(i, frstnm, scndnm);
>> cache.put((long)i, p1);
>> }
>>
>>
>> insert into PERSON (id, firstname, lastname) values (?, ?, ?)
>>
>> *inside write: *
>>
>> st.setLong(1, val.getId());
>> st.setString(2, val.getFirstName());
>> st.setString(3, val.getLastName());
>> st.addBatch();
>> if(counter==100)
>> {
>> System.out.println("Counter "+ counter);
>> st.executeBatch();
>> counter=0;
>> }
>>
>> got exception after 11K records
>>
>> Exception Occuredjava.sql.BatchUpdateException: ORA-00001: unique
>> constraint ​
>>
>> --
>> Regards,
>> Rajarshi Pain
>>
>
>
>
> --
> Regards,
> Rajarshi Pain
>

Re: Exception Occuredjava.sql.BatchUpdateException: ORA-00001: unique constraint

Posted by Rajarshi Pain <ra...@gmail.com>.
Hello,

Can someone please help me on this scenario if somewhere I am making any
mistake ?

Thanks,
Raj

On Fri, Jan 12, 2018 at 11:57 PM, Rajarshi Pain <ra...@gmail.com>
wrote:

> Hi,
>
> We were doing a POC(Ignite 2.3 - oracle) to check how cache Persistence
> Store works using writeBehind, We are updating data as a batch rather than
> updating one by one record.
>
> though there are no duplication record but still getting "unique
> constraint" exception.
>
> We couldnt find any root cause for this not sure is any issue if this is a
> possible ignite bug as this error is coming randomly.
>
> Also in another POC we have seen that it's not inserting all the data to
> the database.
> For example we have pushed 10K but in Database we can only see 9800,
> though there is no error or exception.
>
> could you please shade some lights on these issues ?
>
> Sample Code:
>
> for(int i=1;i<=100000;i++)
> {
> frstnm="test1name"+i;
> scndnm="test2name";
> p1 = new Person(i, frstnm, scndnm);
> cache.put((long)i, p1);
> }
>
>
> insert into PERSON (id, firstname, lastname) values (?, ?, ?)
>
> *inside write: *
>
> st.setLong(1, val.getId());
> st.setString(2, val.getFirstName());
> st.setString(3, val.getLastName());
> st.addBatch();
> if(counter==100)
> {
> System.out.println("Counter "+ counter);
> st.executeBatch();
> counter=0;
> }
>
> got exception after 11K records
>
> Exception Occuredjava.sql.BatchUpdateException: ORA-00001: unique
> constraint ​
>
> --
> Regards,
> Rajarshi Pain
>



-- 
Regards,
Rajarshi Pain