Hi, You can try creating a Singleton session at server end that would register the event listener and do the image processing. We are also working on achieving this thing.
On Thu, Jun 10, 2010 at 3:28 PM, danisevsky <[email protected]> wrote: > Hello, > I want to build a wicket (brix) photo gallery with jackrabbit backend. This > gallery automatically creates different size images whenever an image is > uploaded. For instance, you upload an image, and it will create a > thumbnail, > a mid-size preview, a larger image, and of course still store the original. > Or it may watermark images. > > So I added EventListener: > > session.getWorkspace().getObservationManager().addEventListener(listener,.. > > and this EventListener creates thumbnails after image upload. > > Here's my problem: EventListener creates only one (sometimes none) of three > thumbnails and then throws javax.jcr.RepositoryException: this session has > been closed. > > because my wicket application close all alive sessions on the end of > request > cycle and EventListener is asynchronous. Synchronous event listener is not > part of jcr API and in addition I read that synchronous event listener > should never write to the repository using the same session that was used > to > create it. > Could someone give me a advice what is the best way to solve it? >
