[JAVA-1441] Make RawBsonDocument implement Closeable Created: 12/Sep/14  Updated: 03/Jan/17  Resolved: 03/Jan/17

Status: Closed
Project: Java Driver
Component/s: API, BSON
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently RawBsonDocument just has a byte[] so there is no need to close it. But in the future it might be given a slice of a larger buffer that is checked out of the buffer pool. In that case, making RawBsonDocument Closeable will allow it to release its reference to the slice.



 Comments   
Comment by Jeffrey Yemin [ 16/Sep/14 ]

The danger of doing this is that there are circumstances where close() might not be called: for example, a cursor of RawBsonDocument where the user breaks out early.

Generated at Thu Feb 08 08:54:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.