GoogleIt Mail IT Print IT PermaLinkSNTT: Don't Forget To Close That Stream!
10:06:39 PM

Julian flagged this almost three years ago, but it bears repeating. I just got bit by this issue today. I did figure out the problem before finding Julian's solution, but not before a few more hairs were pulled out. And Julian mentions that the problem occurs with Domino 6.5.1, and I can confirm that the problem still exists in Domino 7.0.2.

Here's the problem. The help doc for the InputSource property of the EmbeddedObject Java class in the Lotus Domino back-end classes says:


EmbeddedObject.getInputStream creates a temporary file. The file is deleted when EmbeddedObject is recycled.

What it really should say is this:


EmbeddedObject.getInputStream creates a temporary file. The file is deleted when EmbeddedObject is recycled, but only if the close() method of the InputStream object returned by this property has been called before the EmbeddedObject is recycled. Failure to explicitly close the InputStream object will result in the temporary file remaining in the filesystem, which can cause the system to run out of disk space when running an agent that processes many EmbeddedObjects.

Please note: when I referred above to the fact that "the problem still exists in Domino 7.0.2", I was referring to the fact that the critical information is still missing from the documentation. I'm not trying to imply that failure to delete the file is a bug, because I recognize that still open files can not be deleted by the recycle() method. And even if the InputStream object has gone out of scope by the time the EmbeddedObject.recycle() method has been called there is no guarantee that the InputStream has been garbage-collected and closed yet, so the close really has to be done explicitly.

On the other hand, recycle has void return type, and it doesn't throw an error if you call it for an EmbeddedObject whose InputStream temporary file can't be closed; so the fact that there is no way to detect this problem really should be considered a design flaw in the Domino Java classes. And the fact that the InputStream object requires a temp file in the first place... well, that's an unfortunate design limitation. It would be so much better if you could just stream the data directly to memory from the NSF representation, instead of having to absorb the overhead of writing the temp file.

And by the way: although I haven't tested this, I'm reasonably sure that all of the above information also applies to the getInputSource property of EmbeddedObject as well.

This page has been accessed 412 times. .
Comments :v

1. tom10/18/2007 07:51:31 AM

Dr. Egon Spengler: There's something very important I forgot to tell you.
Dr. Peter Venkman: What?
Dr. Egon Spengler: Don't cross the streams.
Dr. Peter Venkman: Why?
Dr. Egon Spengler: It would be bad.
Dr. Peter Venkman: I'm fuzzy on the whole good/bad thing. What do you mean, "bad?"
Dr. Egon Spengler: Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.
Dr Ray Stantz: Total protonic reversal.
Dr. Peter Venkman: Right. That's bad. Okay. All right. Important safety tip. Thanks, Egon.

2. Richard Schwartz10/18/2007 08:11:01 AM

Thanks, Tom. Important safety tip, indeed!

Blocked Response!11/28/2007 09:32:01 AM

This response from IP Address was blocked by the owner of this blog.

4. pietre10/04/2016 06:20:41 AM

There is ample evidence that drugs such as , , Cialis and Levitra do work for many men.

5. leilei391502/28/2017 02:26:25 AM

20170228 leilei3915

6. zzzzz02/28/2017 08:51:09 PM

7. chenlixiang08/11/2017 08:56:39 AM lauren.html

8. dongdong811/17/2017 11:21:26 PM

9. yaoxuemei11/29/2017 12:55:11 AM

10. chenlixiang12/08/2017 05:47:37 AM

11. lzm00312/27/2017 01:15:14 AM kate spade outlet online pandora jewelry tory burch Jewelry Armoire - Official Wholesale Outlet Sale coach outlet burberry outlet kate spade outlet online coach outlet online kate spade outlet jimmy choo shoes yeezy boots 350 Nike Air Max Enfant Wave Prophecy 2 Shoes shop mlb oakley outlet chrome store nike outlet michael kors outlet ray ban sunglasses sale Ray Ban sunglasses Chaussures pour Femme ray-ban sunglasses prada outlet sale Nike Air Max Enfant coach outlet Air Jordan 11 Femme Wholesale womens autumn winter clothing jimmy choo uk coach outlet jimmy choo australia Nike Air Jordan Enfants ray ban australia coach outlet Nike Air Max Femme Nike Free Run burberry sale yeezy shoes boulder shoes sew repair Nike Air Max 1 coach outlet online michael kors handbags puma sneakers michael kors bags coach outlet online kate spade outlet sale rayban sunglasses Air Max 90 rayban prescription glasses birkenstock sandals canada goose outlet backlink burberry outlet sale armani outlet Louis Vuitton handbags louis vuitton outlet coach outlet store michael kors outlet online ugg boots Jordan Fusion Femme nike outlet Wedding Rings- Official rolex watch prada outlet online Nike Air Max 2017 hermes outlet michael kors bags online nike jordan shoes puma shoes breitling watches prada outlet online clearance school bags on sale michael kors outlet pandora australia Nike Air Force 1 Homme nike factory outlet Nike Free Run Lunette Oakley Nike Air Max Chase black friday michael kors Air Max Enfants under armour burberry factory outlet burberry outlet Brighton Jewelry - Official Brighton Jewelry - Official kate spade outlet Nike Air Max chaussure pas cher pandora bracelets charms pandoracharms kate spade outlet online handbags online sale ray ban australia michael kors gucci watches michael kors bags black friday kate spade outlet bags pandora jewelry uk timberland outlet michael kors factory outlet Premier Jewelry - Official Green Cleaned The Retail Compliance Association China wholesale kate spade outlet cheap ray bans Nike Air Max 90 pandora australia louis vuitton outlet ray ban polarized coach outlet online sale nike running nike outlet online versace outlet payless shoes online Family Name Research kate spade outlet store Adidas Outlet pandora australia mode damenschuhe tory burch Nike Air Jordan Enfants

12. chenlina02/04/2018 09:24:34 PM


Enter Comments^

Email addresses provided are not made available on this site.

You can use UUB Code in your posts.

[b]bold[/b]  [i]italic[/i]  [u]underline[/u]  [s]strikethrough[/s]

URL's will be automatically converted to Links

:-x :cry: :laugh: :-( :cool: :huh: :-) :angry: :-D ;-) :-p :grin: :rolleyes: :-\ :emb: :lips: :-o
bold italic underline Strikethrough

Remember me    

Monthly Archive
Responses Elsewhere

About The Schwartz


All opinions expressed here are my own, and do not represent positions of my employer.