lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Rhoden <jrho...@unimelb.edu.au>
Subject Re: Wrapping IndexSearcher so that it is safe?
Date Wed, 11 Nov 2009 22:41:28 GMT
I knew I would have overlooked something, thanks for the help!

On 12/11/2009, at 9:21 AM, Uwe Schindler wrote:

> ....simply do not catch and rethrow the IOException, instead put  
> release in a
> finally block and let the IOException automatically go upwards.
>
>> 		this.retain();
>> 		try {
>> 			TopDocs result = searcher.search(query, limit);
>> 			return result;
>> 		} finally {
>> 			this.release();
>> 		}
>
> Less code more secure and effective :-)


____________________________________
Information Technology Services,
The University of Melbourne

Email: jrhoden@unimelb.edu.au
Phone: +61 3 8344 2884
Mobile: +61 4 1095 7575


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message