jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay Pandey <VPan...@mdes.ms.gov>
Subject RE: User Managed Transactions...
Date Tue, 28 Jul 2009 16:22:44 GMT
JCR (http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html) is
the spec (99% java interfaces, may be few abstract/final classes along with
exceptions -- that’s what spec is all about -- it doesn’t provide any
implementation) while JackRabbit is one of its implementation. So when you
are using Jackrabbit -- you should be fine with UUID's (the way you are
using it) as mentioned by Alex. If you think you will be replacing
Jackrabbit in future with some other JCR implementation then you need to be
careful while using the additional/advances features from that
implementation, in your case Jackrabbit.

-----Original Message-----
From: Gadbury [mailto:gadbury@googlemail.com] 
Sent: Tuesday, July 28, 2009 11:06 AM
To: users@jackrabbit.apache.org
Subject: Re: User Managed Transactions...

Thank you for the clarification Alex, and for adding the info to the Wiki.

I am using Jackrabbit 1.4 - does it still apply?

When you mention 'in Jackrabbit', do you mean when using Jackrabbit
implementations such as org.apache.jackrabbit.core.SessionImpl and
org.apache.jackrabbit.core.NodeImpl , rather than the core JCR?

I must admit the only Jackrabbit I am currently using is the configuration,
registration of custom node types and registration / unregistration of the
repository in JNDI.

Should I be replacing all of my JCR with Jackrabbit?  I'd like to be sure
that I am using Jackrabbit to ensure UUIDs are already assigned when the
node is created and don't change upon save.

Can JCR and Jackrabbit be interchanged?  i.e. could I use a Jackrabbit
PropertyImpl with a JCR Node?

Sorry for the silly questions!

Kind regards,


Alexander Klimetschek wrote:
> On Tue, Jul 28, 2009 at 4:51 PM, Gadbury<gadbury@googlemail.com> wrote:
>> If I am within a user managed transaction's scope, and I have added a
>> node
>> and then call session.save(), is it safe to rely on that node's UUID or
>> would I have to wait until the transaction has been committed?
>> Here is the excerpt from the JCR 1.0 specification:
>> When UUIDs are Assigned
>>        In some client-server implementations the assignment of a
>> permanent UUID
>> may be done on the server.
>>        In these cases it is not practical for a newly created
>> referenceable node
>> to be given a UUID upon creation.
>>        Rather, it makes more sense for the UUID to be assigned upon save
>> of that
>> node.
>>        In such cases a “dummy UUID” may be assigned on creation of a new
>> node
>> while the real UUID assignment takes place later, upon save.
>>        Applications should not, therefore, rely on the UUID of a node
>> before that
>> node is saved for the first time.
> The spec only talks about creating node vs. save(), but since in case
> of transactions a tx commit comes after a save(), you can be sure that
> the "final" UUID is assigned after your save - you don't have to wait
> for the commit.
> In Jackrabbit, UUIDs are already assigned when the node is created and
> don't change upon save. I added this implementation choice item to
> http://wiki.apache.org/jackrabbit/JcrSpecImplementation
> Regards,
> Alex
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com

View this message in context:
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message