On Thu, Jan 20, 2011 at 09:23, Vincent Massol
<vincent(a)massol.net> wrote:
Hi Caleb,
On Jan 19, 2011, at 7:54 PM, Caleb James DeLisle wrote:
On 01/19/2011 12:13 PM, Vincent Massol wrote:
> Hi Caleb,
>
> I see you're excited, that's good! :)
>
> Some general comments:
> * This looks more like a design for a transaction module than for a
persistence engine. I don't see anything related to persistence in your
proposal below. Your proposal could work on stuff others than storage,
right?
Yes, this proposal only covers the transaction
sub-module of the
persistence engine. The so far
un-proposed modules include
xwiki-store-serialization,
xwiki-store-filesystem and a legacy
attachment storage module:
xwiki-store-filesystem-attachments.
Ok I was misled by the title of your mail "Introduce a new persistence
engine". I guess it could/should have been "Introduce a generic transaction
API independent of the underlying storage implementation", right?
So if we focus purely on the transaction part here are some questions:
* Why don't we use existing standards such as JTA/JTS? See
http://en.wikipedia.org/wiki/Java_Transaction_API
* If we were to define our own API, would we be able to implement it using
JTA, ie is it a higher level transaction API than JTA?
* Imagine we decide to use JCR as the storage implementation, how would
this transaction API integrate with it knowing that JCR integrates with JTA?
(
http://www.day.com/specs/jcr/2.0/21_Transactions.html)
Anything which requires transactions could use
the TransactionRunnable
although I'm at a loss to
think of anything other than storage which would
require transactions.
> * I was expecting to see some Store/Storage/Persistence interfaces with
proposed APIs and explanation on how they could be implemented both with
Hibernate and JCR for example. And the relationship with the proposed new
Model defined.
I don't like to propose an interface until I
have tried to implement it.
Also I do not like to
propose an implementation until I have tried to
use it. At this point
it's far enough off that I
would rather wait than propose APIs blind.
My experience with attachment store has shown that what we want is a set
of
functions which provide
TransactionRunnables to do various things:
aka:
TransactionRunnable<T> getDocumentSaveTransactionRunnable(XWikiDocument
toSave);
In a hibernate implementation it would return
TransactionRunnable<HibernateTransaction> and in a JCR
it would return
TransactionRunnable<JCRTransaction>.
We cannot have APIs like this until TransactionRunnable is agreed upon
these will
return instances
of it.
> * I was also expecting a strategy defined to migrate users from the
current
implementation of the storage to the new one
IMO we should change the persistence engine and
implement the same
schema, once the persistence
engine is rebuilt, then we can consider modifying
the schema. The schema
is a specification, it may
not be perfect but it is something to comply
with. It is important to me
that a we prove that a new
persistence engine is able comply with existing
specifications before we
start designing new ones
around it.
I don't quite agree with this since it assumes this schema is universal
which it definitely is not. It's only a schema that works with RDBMS. It
wouldn't work with an ODBMS or a file system implementation.
The proposal of Caleb is not RDBMS related at all. He first use it for the
filesystem persistence of attachement.