Hi, I wanted to, but I can't because then I don't have the stream to close it. If I don't close the stream returned by the Ektorp getAttachment() method I will have memory leaks.
2012/8/17 Sven Meier <[email protected]> > Without looking to deep into this you should create the InputStream in > CouchDbResourceStream#**getInputStream() instead of the constructor. > > Sven > > > On 08/17/2012 04:25 PM, Michael M wrote: > >> Hi, short question this time: I have several ResourceLinks to >> ResourceStreamResources on a page. When I click on one of those links, the >> resource streams attachments dynamically out of my database. >> >> That's working quite well now, however the stream (and whatever happens in >> the method returning the streams) is called 2-4 times. E.g. opening an >> image results in 4 queries to the CouchDB database. I don't really see >> that >> happening when I'm playing an mp3 file with a flash-player pointing to the >> URL of the resource. >> >> Does anyone have an idea why? I'm only instantiating the resource once, >> for >> any link I only use that one resource. >> >> Here's my custom ResourceStreamResource: http://pastebin.com/9BB7LEiV >> >> And here my custom IResouceStream: http://pastebin.com/Z7GvzGja >> >> Thanks! >> >> > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org<[email protected]> > For additional commands, e-mail: [email protected] > >
