Skip to content
jyemin edited this page Apr 8, 2013 · 48 revisions

Java Driver 2.11.1 (April 8, 2013)

The 2.11.1 Java driver fixes a regression introduced in 2.11.0 that can affect clients that authenticate against sharded clusters.

Downloads

maven central and driver-downloads.mongodb.org

###Docs http://api.mongodb.org/java/2.11.1/

Bugs:

  • JAVA-793: Race condition in com.mongodb.DBTCPConnector#authenticate method

Improvements

  • JAVA-802: Use $query and $orderby in query document instead of query and orderby

Java Driver 2.11.0 (March 19, 2013)

The 2.11.0 Java driver fully supports the MongoDB 2.4 security enhancements, which include:

Downloads

maven central and driver-downloads.mongodb.org

Docs

http://api.mongodb.org/java/2.11.0/

New Features:

  • JAVA-691: Authentication enhancements
  • JAVA-431: the find() method of GridFS should allow specification of sort criteria

Improvements:

  • JAVA-673: MongoURI should allow configuring default SSL socket factory
  • JAVA-725: Deprecate MongoURI, MongoOptions, and Mongo constructors
  • JAVA-728: Improve logging of Mongo instance construction
  • JAVA-733: JSON.parse() should handle $binary object correctly
  • JAVA-734: JSON.parse() should handle $timestamp correctly
  • JAVA-735: Binary class should implements Equals and HashCode
  • JAVA-741: Ability to disable validation for illegal characters in keys
  • JAVA-743: JSONCallback should apply decoding hooks for all supported types
  • JAVA-744: Add convenience methods for MongoClientOptions
  • JAVA-757: Exceptions throws for GLE should contain the entire GLE document
  • JAVA-768: Use ReadPreference.primaryPreferred() for authentication
  • JAVA-780: Expose MongoClientURI constructor for overriding default options
  • JAVA-785: Improve logging of socket errors

Bugs fixes:

  • JAVA-595: With redeploy web app created a ThreadLocal but failed to remove it when the web application was stopped
  • JAVA-641: JMX registration error
  • JAVA-657: ReadPrefs ignored for some commands due to case-sensitive comparison
  • JAVA-703: GridFS List find( DBObject query ,...) should close cursor
  • JAVA-705: Query commands like aggregate and mapReduce don't pick up the read preference set on the collection
  • JAVA-708: ReadPreference.nearest() does not count primary in expected way
  • JAVA-720: DBCursor.next() throws the wrong Exception
  • JAVA-722: Errors when DBRef's $id is Object instead of simple value
  • JAVA-753: Java Driver sending reads with NEAREST preference to nodes in RECOVERING state
  • JAVA-772: If cursor is not found by the server, report in the exception the cursor that was requested
  • JAVA-787: DBTCPConnector._checkWriteError () consume a PoolOutputBuffer not returned to SimplePool

Java Driver 2.10.1 (December 3, 2012)

Bug fixes:

  • JAVA-706: Aggregate and mapReduce commands sent to mongos break when setting read preference

###Downloads github and maven central

###Tickets Jira release notes

###Docs http://api.mongodb.org/java/2.10.1/

Java Driver 2.10.0 (November 27, 2012)

Highlights:

  • JAVA-682: Add new MongoClient class, to supersede existing Mongo class, with a default WriteConcern.ACKNOWLEDGED (see MongoClient Javadoc

###Downloads github and maven central

###Tickets Jira release notes

###Docs http://api.mongodb.org/java/2.10.0/

Java Driver 2.9.3 (October 30, 2012)

This is a recommended update for anyone running with 2.9.2.

Bugs fixed:

  • JAVA-680: Secondary reads on lists of mongos fail until first write

###Downloads github and maven central

###Tickets Jira release notes

###Docs http://api.mongodb.org/java/2.9.3/

Java Driver 2.9.2 (October 23, 2012)

This is a critical update for anyone running with 2.9.0 or 2.9.1.

Bugs fixed:

  • JAVA-660: Concurrency issue can cause corrupted messages to be sent to the server
  • JAVA-641: JMX registration error
  • JAVA-658: DBTCPConnector ignores readprefs for combination of legacy settings
  • JAVA-656: Don't checkMaster on slaveOk queries
  • JAVA-666: Don't rely on MXBean

###Downloads github and maven central

###Tickets Jira release notes

###Docs http://api.mongodb.org/java/2.9.2/

Java Driver 2.9.1 (September 9, 2012)

Bugs fixed:

###Downloads github and maven central

###Tickets Jira release notes

###Docs http://api.mongodb.org/java/2.9.1/

Java Driver 2.9.0 (August 29, 2012)

Highlights:

###Downloads github and maven central

###Tickets Jira release notes

###Docs http://api.mongodb.org/java/2.9.0/

Java Driver 2.8.0 (June 18, 2012)

Highlights:

  • JAVA-458: With slaveOk, query distribution to slaves is not even
  • JAVA-429: Allow DBCollections to be modified using raw/binary BSON.
  • JAVA-509: ClassMap synchronization is a major source of contention
  • JAVA-249: Java Driver cannot connect to "localhost" when mongod is listening only on 127.0.0.1 (or "localhost")
  • JAVA-488: Support serialization to Mongo extended JSON format
  • JAVA-561: Add getX with default methods for missing values
  • JAVA-332: GridFS: Allow seek/reads (get part of a chunk) on stream interface
  • JAVA-272: OSGi Manifest is incorrect

Tickets

Full ticket information can be seen at https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10006&version=10980

Java Driver 2.7.3 (January 30, 2012)

  • JAVA-505: Performance regression due to increased memory allocation

Tickets

Full ticket information can be seen at https://jira.mongodb.org/browse/JAVA/fixforversion/11002

Java Driver 2.7.2 (November 10, 2011)

  • JAVA-467: Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers

Tickets

Full ticket information can be seen at https://jira.mongodb.org/browse/JAVA/fixforversion/10997

Java Driver 2.7.0 (November 4, 2011)

  • JAVA-439: Embedded Map allows dot in key names
  • JAVA-427: Support ContinueOnError Flag for bulk insert
  • JAVA-393: add support for "j" option to WriteConcern
  • JAVA-333: Allow bson decoder per operation (find/cusor)
  • JAVA-404: Allow inline M/R w/SlaveOk go to secondaries
  • JAVA-461: the logic to spread requests around slaves may select a slave over latency limit
  • JAVA-448: Tailable Cursor and awaitdata
  • JAVA-428: Support new ReadPreference semantics, deprecate SlaveOK
  • JAVA-459: smooth the latency measurements
  • JAVA-425: Support MongoDB Server 2.0 getLastError Changes (j, w=string/number)
  • JAVA-462: GridFSInputFile does not close input streams when constructed by the driver
  • JAVA-363: NPE in GridFSFile.validate
  • JAVA-364: MapReduceOutput sometimes returns empty results in a replica set when SLAVE_OK=true
  • JAVA-323: when executing a command, only top level object returned should be a CommandResult, not sub-objects
  • JAVA-444: make ensureIndex first do a read on index collection to see if index exists
  • JAVA-356: JSONParseException class not public

Tickets

Full ticket information can be seen at https://jira.mongodb.org/browse/JAVA/fixforversion/10480

Java Driver 2.6.5 (August 09, 2011)

  • JAVA-411: Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException )

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10684

Java Driver 2.6.4 (August 08, 2011)

  • JAVA-319: JSON parser to not require quotes around keys
  • JAVA-382: NPE in ReplicaSetStatus.ensureMaster
  • JAVA-387: DBCollection#findOne(DBObject o, DBObject fields) doesn't markAsPartialObject
  • JAVA-390: Make it possible to override the bson decoder, not just the callback
  • JAVA-396: improve javadocs for connection options, they confuse people
  • JAVA-397: authentication for replica set fails frequently because 'getnonce' and 'authenticate' command is issued to different server
  • JAVA-398: Configure max connection retry time
  • JAVA-406: Java driver does not accept empty keys
  • JAVA-407: some source files do not include licence information
  • JAVA-409: when creating Mongo to single server, its address appears twice (ipv4/ipv6) and it gets exploded into a replica set
  • JAVA-410: if using DBAddress instead of ServerAddress, server matching in replica set doesnt work
  • JAVA-395: Date Time values do not preserve milliseconds when serialized to or deserialized from JSON

Tickets

Full ticket information can be seen at https://jira.mongodb.org/browse/JAVA/fixforversion/10490

Java Driver 2.6.3 (June 08, 2011)

This release addresses bug fixes only.

  • Connector does not get started in one of the constructor, so replica set thread is not activated

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10486

Java Driver 2.6.2 (June 02, 2011)

This release addresses bug fixes only.

  • Fixed GridFS file issues stemming from the default default byte[] encoding
  • Unclosed background connections connecting to replicasets (only an issue if not using Mongo as a singleton)
  • Race-condition on Mongo constructor with replicasets

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10484

Java Driver 2.6.1 (May 29, 2011)

This release addresses bug fixes only.

  • Fixed incorrect implementation of the Binary/byte[] encoding (from the 2.6 release).

Java Driver 2.6 (May 27, 2011) (removed)

This release addresses bug fixes and includes some minor improvements.

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10249

Breaking Changes

  • Changed default binary type (for java byte[]) from subtype 2->0. The will save 4 bytes but uses a different storage format on the server so it is not compatible for existing data; you will be able to save and read data without problem but searching against the data will result in inconsistent results. As you read and save data (using a byte[]) this will update the old subtype to the new one.

These are all bug-fixes but may affect your code if you depend on the buggy behavior.

  • JSON parser treated int/long values as longs -- reverted back to old behavior of converting to best fit
  • query/DBCursor.hint(DBObject) created an index name; very unlikely to be breaking in any way.

Java Driver 2.5.3 (Apr 6, 2011)

This is a minor release to fix some bugs introduced with other fixes in 2.5; no major functionality has changed.

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10272

  • JAVA-315 Sometimes connections aren't returned to the pool; pool can be emptied incorrectly
  • JAVA-287 TCP_KEEPALIVE option
  • JAVA-313 WriteResult.getLastError().throwOnError() doesn't throw sometimes
  • JAVA-318 Support JMX on similar ServerAddresses
  • JAVA-312 JSON support for UUID

Java Driver 2.5.2 (Mar 24, 2011)

This is a minor release to fix some bugs introduced with other fixes in 2.5; no major functionality has changed.

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10265

  • JAVA-304 Problems closing cursors with ids < 0

Java Driver 2.5.1 (Mar 23, 2011)

This is a minor release to fix some bugs introduced with other fixes in 2.5; no major functionality has changed.

Tickets

Full ticket information can be seen at http://jira.mongodb.org/browse/JAVA/fixforversion/10262

  • JAVA-278 findAndModify should not throw exceptions when no docs found
  • JAVA-301 replicaset w/auth warnings.

Java Driver 2.5 (Mar 10, 2011)

This release fixes many bugs reported against previous versions of the driver, and also introduces many improvements.

Changes include:

  • Mongo URI; The Mongo URI describes a set of servers with parameters which control the behavior of the driver in a single connection string; this string will be supported in other drivers.
  • ObjectId generated is now unique for each class loaders; this avoids possible collisions in some Java web servers and environments.
  • Replicaset Improvements: the driver now removes unused servers, detects passive nodes, and supports authentication.
  • Map/Reduce: supports the new Mongo 1.8 features, like advanced post-processing on results (replace, merge, reduce, inline).
  • Host-name resolution is now updated every 5min, making it possible to change the IP of mongod servers without restarting the client application.
  • Several Java properties were added to control the behavior of the driver (slave selection for reads, replica set check interval, etc).
  • Javadocs were thoroughly updated and now cover most of the driver.

Important Notes

  • The Mongo constructors have been simplified to only perform local initialization. As a result, no more network I/O is attempted in the constructor, and it is always possible to obtain a Mongo Instance even if no server is reachable. This follows the philosophy that constructors should be simple and errors should be handled when actual operations are called. In turn, if an application relied on the constructor throwing an exception, it should be modified.

Backward Compatibility

  • Map/Reduce: the simple M/R method was removed since it is now required to either specify an output collection, or select "INLINE" type.
  • GridFS: previously the driver would incorrectly store the "metadata" user-supplied object at the root of the gridfs file object. This has been fixed to store it under the "metadata" field, as described in the gridfs specs. This change is backward breaking for applications that stored metadata with previous drivers.
  • The ObjectId class has been refactored to fix several flaws notably for its compareTo() operator. As a result, the underlying BSON encoder/decoder was modified to write/read the ObjectID as big endian, as described by the BSON spec (as opposed to other data written little endian). This enabled to clean up the ObjectID class and improve its behavior. If using auto-generated ObjectID or ones created from String, the change in driver will not be noticeable. But if retrieving a record written with a previous driver and inspecting its machine ID or increment value, they will appear different with the new driver.
  • The exception hierarchies have changed and you should check that you are catching MongoException and not MongoInternalException as that is not thrown in the same places anymore.
  • findAndModify now returns the error from the server if no matching documents can be found for the update.

Tickets

Full ticket information can be seen at http://jira.mongodb.org

  • JAVA-263 NullPointerException due to race condition during concurrent access to DBTCPTransport
  • JAVA-85 CompareTo of ObjectId java driver returns different value than MongoDB implementation
  • JAVA-255 DBCollection.save(obj) does not use the default write concern
  • JAVA-151 Dot allowed in key names
  • JAVA-231 Failed to retrieve any result when using SlaveOK with all slaves are down
  • JAVA-248 For GridFS, driver should ensure indexes at startup on both files and chunks collection, when collection is small
  • JAVA-270 If authentication is on for a replica set, then most likely all writes will always fail once primary server dies
  • JAVA-224 Java driver doesn't automatically discover replica set passive nodes
  • JAVA-251 MapReduceOutput should support getting results inline, or from a collection in another db
  • JAVA-240 Mongo constructor should not attempt network connections and potentially throw exception that prevents app from starting
  • JAVA-227 NPE when replica set is down
  • JAVA-266 Need to update the IP resolved for hosts frequently enough to pick up dns changes
  • JAVA-269 NullPointerException when authentication used with replica sets not logged correctly
  • JAVA-241 driver has a bunch of hardcoded timing settings that many customers want to tweak
  • JAVA-276 findAndModify does not throw MongoException on error, fails silently
  • JAVA-256 fix all javadoc
  • JAVA-239 make sure src/main/org/bson has no mongodb deps
  • JAVA-273 many db commands (stats, list db, group, etc) should succeed if slaveOk=true and at least one server is up
  • JAVA-282 on ioexception, call to port.close() after putting back port in the pool, may break other thread that is using port
  • JAVA-281 when dropping a database or a collection, they remain in the driver cache, which can lead to problems
  • JAVA-257 when getLastError() is called on a WriteResult, behavior has several flaws
  • JAVA-275 with default write concern (no getLastError), if master changes in repl set, small edge case where writes will fail undetected
  • JAVA-258 Need oid in WriteResult
  • JAVA-174 prevent stack overflow in case of erroneous cyclic reference
  • JAVA-264 Deprecate DBCollection.getCount methods
  • JAVA-261 GridFSInputFile.getMetaData() returns wrong value
  • JAVA-279 ObjectId could generate duplicate ids if used in different classloader
  • JAVA-237 Should only have 1 DBCleanerThread per Mongo instance
  • JAVA-238 add optional parameter dropTarget to DBCollection.rename()
  • JAVA-247 authenticate method declares throw MongoException but doesn't actually throw it
  • JAVA-252 clean up the list of servers in replica based on list returned from isMaster
  • JAVA-267 update DBCusor .next() .hasNext() javadoc to say it can throw an exception WAS: MongoInternalException from DBCursor.hasNext() is inappropriate
  • JAVA-196 ReplicaSetStatus does not remove dead nodes automatically
  • JAVA-244 MongoURI for Java Driver should support all speced options (e.g. w, fsync, etc)
  • JAVA-289 driver does not allow doc sizes matching the server limit, for both insert and find