cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolai Raitsev" <nikolai.rait...@gmail.com>
Subject commitChanges and ValidationExceptions
Date Wed, 28 Jun 2006 07:01:18 GMT
Hello
I am new here
and sorry for my English:)

I have  searched  the mailing lists,  but not found possible answer for my
question.
Here is my question, maybe everybody can help me:

how can I execute commitChanges()-Method, with a lot of
ValidationExceptions?

For the moment I implemented validateForSave-Method for my
CayenneDataObject.

the following happens:

I have 2 tables: 1. table with 1000 datasets and 2. table without data.

on DataObject from 2. table i have validateForSave-method

if i copy data from 1.table into 2.table and make commit like this:
try
{
dataContext.commitChanges();
}
catch(ValidationException vex)
{
System.out.println(vex.getValidationResult().getFailures().size());
}
i have a correct number from validation faults... but the 2.table is empty.

if i call (before commitChanges())
dataContext.setValidatingObjectsOnCommit(false);

then i have 1000 datasets in second table, but no information above the
validation faults

Wat can I do? I need the data in 2. table and the information about
validation faults I would like only log...

i hope i have my question clear verbalized...
thanks for help,

Nikolai Raitsev

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message