Hi Florent,

I didn't really have a much better solution, I was just putting more calls to the SPI at the beginning of methods and closing them at the end, but what is really need is a more "transversal" solution, something like what you would do using AOP to only close the session once you leave a certain "level" of API calls.

The biggest problem is really that all of Jackrabbit's implementation is tied to sessions. You cannot keep a reference to a Jackrabbit object and close it's session, the object will not be usable outside of a session. So either we need to make sure that we have sessions that live long enough, or we would need to copy data out of the JCR objects.

I will try to see if I can put together a test, but I need to first update to the new tests and find some time:) I was actually testing against an external tool : CMISSpacesAir when I initially saw the problems. You could use that to see the session problems quite easily, but it's true that unit tests would be much better.

Regards,
  Serge Huber.

On 14 déc. 09, at 15:44, Florent Guillaume wrote:

Ok I roughly see what you mean. Yes the lifecycle of the SPI in these
methods is likely problematic.

However opening the SPI in the constructor makes it practically
immortal which is too much. The correct way would be to open it at the
start of the request and close it after the response has been sent,
unfortunately Abdera is not very extensible that way. I hope I find
the time to ditch Abdera in the coming weeks...

Anyway if you have a stack trace *please* provide it, this will help
me pin down which of the calls have to be using a single SPI object,
and at least we can avoid some of the errors — Serge seemed to have
found a working way but I'm lacking information.

If someone can provide a unit test (sorry to be insisting) that would
help fix all that. Apparently you guys are using Chemistry on top of
an existing Jackrabbit database, without attempting document creation.
So a simple static method comparable to BasicHelper that creates the
appropriate JCR nodes using the JCR APIs and then exposes that using a
JcrRepository would go a long way toward having something more
resilient.

Cheers,
Florent


On Mon, Dec 14, 2009 at 2:45 PM, Florian Roth <florian.r...@in- gmbh.de> wrote:
Hi,

this is happening because you get a node in one session close the session, node is still in memory, then you open new spi session and want to fetch properties of the in-memory node from the previous session. All this has to be done in one session. So I think opening (only) one session for every request is good. It's fixed with a protected SPI in CMISObjectCollection. And use this spi in every subcollection. So you are save that all operations in one request are done in one session, and you don't have to take care to close the spi session in every method.

Best regards


-----Ursprüngliche Nachricht-----
Von: Florent Guillaume [mailto:[email protected]]
Gesendet: Montag, 14. Dezember 2009 14:22
An: chemistry-dev
Betreff: Re: AW: AW: atompub jcr bug with last commit

Hi folks,

Regarding these "javax.jcr.RepositoryException: this session has been
closed" problems, I would like to fix it but need a unit test to know
when it happens and to know what we're dealing with here. Can anyone
provide that?

Florent


On Mon, Dec 7, 2009 at 4:11 PM, Florian Roth <florian.r...@in- gmbh.de> wrote:
Very cool. I will try this these days.

Best regards

-----Ursprüngliche Nachricht-----
Von: Serge Huber [mailto:[email protected]]
Gesendet: Montag, 7. Dezember 2009 16:09
An: [email protected]
Betreff: Re: AW: AW: atompub jcr bug with last commit


Hi Florian,

I have just created CMIS-73 (https://issues.apache.org/jira/browse/CMIS-73
). Hopefully this patch will work properly. I did it against the trunk.

Regards,
  Serge Huber.

On 7 déc. 09, at 15:39, Florian Roth wrote:

Hi,

it would be very nice if you could add an patch in JIRA with your
jcr test cases. I wanted to write some too. But if you have some.
Its great.
I don't know if somebody is developing at the chemistry-jcr
subproject but I think many are interested in it.

Best regards

Florian

-----Ursprüngliche Nachricht-----
Von: Serge Huber [mailto:[email protected]]
Gesendet: Montag, 7. Dezember 2009 15:32
An: [email protected]
Betreff: Re: AW: atompub jcr bug with last commit


Hi Florian,

Thanks, I could send out a patch attached to a JIRA, or just out to
the list (not sure it would like the attachement though), or privately
to you if you want to have a look.

Regards,
  Serge Huber.

On 7 déc. 09, at 15:21, Florian Roth wrote:

Hi Serge,

Thank you.

My way is a protected SPI in CMISObjectsCollection.
Spi=repository.getSPI() in constructor and a destructor with
spi.close() it works. But don't know if that is a good way.

I am very interested in jcr tests

Chears Florian


-----Ursprüngliche Nachricht-----
Von: Serge Huber [mailto:[email protected]]
Gesendet: Montag, 7. Dezember 2009 14:37
An: [email protected]
Betreff: Re: atompub jcr bug with last commit


Hi Florian,

I have seen the same thing, I sorta modified CMISChildrenCollection
to
get around a few, but I must say I'm no expert in this area as I am
just starting. Basically what I did was put the calls to the SPI
inside getFeed which is the only public method and all protected
methods that need references will get the SPI as a parameter.

Regards,
 Serge Huber.

On 7 déc. 09, at 14:12, Florian Roth wrote:

Hi,

the commit from 02.12.2009 [886201] makes problems with chemistry- jcr. Something is wrong with Session closing (spi.close()). Got lots
of javax.jcr.RepositoryException: this session has been closed
exceptions.


Chears

in-integrierte informationssysteme GmbH
Am Seerhein 8 . 78467 Konstanz
http://www.in-gmbh.de/ . mailto:[email protected]

Telefon: +49 7531 8145-0
Telefax: +49 7531 8145-81


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren
sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e- mail in error) please notify the sender immediately and destroy this e-
mail. Any unauthorised copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Sitz der Gesellschaft: Konstanz . Amtsgericht Freiburg i.B. .
Registernummer: HRB 380976 . Geschäftsführer: Siegfried Wagner










--
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87




--
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

Reply via email to