I'm confused - please excuse me for being a novice. All of my repository read / write code uses Interfaces form javax.jcr.* imports. So I am importing the JCR spec Interfaces... but where is the Jackrabbit implementation? I assume there is some magic that I cannot comprehend going on behind the scenes, driven by the Jackrabbit configuration file.
Just as a sanity check, would someone be kind enough to have a look at some of my sample code? I pasted it up here: http://pastebin.ca/1510143 I just want to be sure that I am doing things right (and using Jackrabbit properly!) :D Thanks again for you time! Cheers, James Vijay Pandey wrote: > > 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 -- thats what spec is all about -- it doesnt 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. > > Thanks > Vijay > -----Original Message----- > From: Gadbury [mailto:[email protected]] > Sent: Tuesday, July 28, 2009 11:06 AM > To: [email protected] > 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, > > James > > > > Alexander Klimetschek wrote: >> >> On Tue, Jul 28, 2009 at 4:51 PM, Gadbury<[email protected]> 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: >>> >>> 4.9.1.1 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 >> [email protected] >> >> > > -- > View this message in context: > http://www.nabble.com/User-Managed-Transactions...-tp24687924p24702610.html > Sent from the Jackrabbit - Users mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.com/User-Managed-Transactions...-tp24687924p24703684.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
