On 11/01/2013 11:21, Fabio Martelli wrote:
Il giorno 11/gen/2013, alle ore 11.00, Andrei Shakirin ha scritto:
Hi,
Working on integration tests improvement (1), I discovered that almost all
persistence beans have TABLE generated Id strategy defined in orm.xml: user,
role, membership, mapping, connInstance, attr.
Anyway AUTO generated Id strategy is defined for following of the persistence
beans: AbstractDerAttr, AbstractVirAttr, Notification, UserRequest.
Is there good reason to keep it differently?
Hi Andrei,
I cannot remember the good reason for this differences but it there was ...
In our experience with Apache Syncope (especially at the beginning) there are
troubles with AUTO generated id in case of high concurrence.
Not only: some specific table generator associated to a given entity (or
set of entities) were defined, and defined in orm.xml, not by
annotations - in order to give more flexibility when dealing with
specific requirements in id generation.
From my PPOV you can try to change this implementation but you have to verify
your fix with all the supported databases generating a lot of concurrent
accesses to the entities interested by your changes.
Actually I am struggling with strange effect in NotificationTestITCase:
create() and issueSYNCOPE83() work successfully ONLY if delete() removes
Notification with id=101.
If delete() is marked with @Ignore - create() and issueSYNCOPE83() throw
DataIntegrityViolation exception.
Even more strange: if previously running tests: AuthenticationTestITCase,
ConfigurationtestITCase, ConnInstanceTestITCase, DerivedSchemaTestITCase are
deactivated, problem is not reproducible anymore - create() and
issueSYNCOPE83() work successfully without delete().
I guess the problem is caused Id generation, will investigate it a little bit
more.
Have anyone other ideas what could be the reason?
I cannot be sure about the reason but, please, consider that integration tests
are interdependent: the order and the existence of a certain test are often
fundamental.
Exactly, here's why text execution order is fixed.
Consider that integration tests were added over time and that their
number is starting to be quite considerable...
Regards.
Cheers,
Andrei.
(1) https://issues.apache.org/jira/browse/SYNCOPE-268
--
Francesco Chicchiriccò
ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/