Added a test which checks that a TX fails if a lock can not be acquired,
but succeeds before the timeout to acquire the lock is exceeded.
Further fixed the brittle tests by using a different semaphore to
synchronize the threads.
This test makes sure that updating after adding, or any other operation
in the same TX works properly. Found a problem where the
PersistenceContext didn't implement hashCode() and equals() which lead
to each operation being added even though a previous operation was
already registered
Here i found a conceptual problem where the *byId() methods didn't
properly resolve ObjectRefs and add them to the TX because, we added the
ObjectRefs to the filter, which made the TX resolve PersistenContexts by
the wrong type.
Now we always add the same type of object to the ObjectFilter; the
PersistentContext. This means that when we call ObjectDao.add(T), etc.
we must already create such the context. This helps resolve another
issue at the back of my mind: We don't want to partially commit a TX if
such a basic information as the object's CTX is not available.
Locking is not yet implemented, but is now prepared. This is once again
a major rewrite but this has lead to easier use and less if/else
constructs but far more object oriented delegation and double
dispatching where possible
it is still not really nice how one has to use the persistence layer,
thus in the test folder i am currently implementing a completely new API
where simple use is central - but not forgetting SAX and DOM being used
transparently.
Changing to the visitor pattern will make it easier to implement a SAX
reader and writer
This is a commit so that i don't loose my work. The code currently does
not compile
Moved the property helper methods from SystemHelper to a new class
PropertiesHelper and added methods where one can pass in the actual
properties thus not being restricted to the system properties
Now the objects put into the cache no longer need to implement an
interface, this makes it easier to adopt the filter in different
scenarios.
Tests written to validate that the filter works as expected. Still some
outstanding tests which currently fail