[JAVA-1605] Remove Mongo#getVersion Created: 30/Dec/14  Updated: 07/Jul/15  Resolved: 05/Jan/15

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

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on JAVA-1606 Deprecate Mongo#getVersion Closed

 Description   

We should remove Mongo#getVersion in 3.0 after deprecating in 2.13. This is not a common practice in Java libraries, and it complicates the build process.



 Comments   
Comment by Dima [ 07/Jul/15 ]

Jeff,
Sure, we could probably find ways to figure out the driver version.. but IMHO, it is rather strange that database driver doesn't come with the one. This is particularly important because driver in v3 sprang into many jars. Again, for user (like myself) we could probably find a way to deal with this, but I don't think that database driver for such a sensitive and proprietary product like MongoDB should be so "liberal" with versions. For example, our product comes with your driver but users pick their own MongoDB databases. Users can and sometimes do replace drivers on their own. Users get into problems. And one of the ways to start looking into problems is to know which version of software is being used. So, what we have now with v2 of the driver is a complete dump of what database, driver, OS and architecture are we looking at. In v3 driver version is gone. I'm not saying it's the end of the world, I am just telling you my use case

(by the way, awesome work on driver v3, we migrated from v2 without much pain)

Comment by Jeffrey Yemin [ 07/Jul/15 ]

Hi Dima,

We ripped this out for a number of reasons:

  1. Most Java software libraries that I'm aware of don't expose such a property
  2. As of the 3.0 release, the driver has been split out into multiple jar files (mongodb-driver, mongodb-driver-core, bson, etc.), so a single version number for the MongoClient may be misleading

As you ship the driver as part of the installation of your own software product, could you not give each version of the installation its own number, and derive the driver version from that (e.g version 1.4.3 of your software ships with version 3.0.2 of the Java driver)?

Comment by Dima [ 07/Jul/15 ]

Thank you Jeff,
This is what I was looking for - an alternative way. It's needed for support tasks when you must know what software versions are running at end user machine. We log (or display in about pages) the driver version, database version, OS, architecture, etc. In my particular case, we ship mongodb java driver as part of the installation. Having to know which of the drivers are being currently used is very important for support. Often users replace drivers themselves.. I don't need it to base application logic on driver version, I need it as an information only. The only choice I see so far is to look at a file name in the class path.. I'm not sure it's the best choice.

Comment by Jeffrey Yemin [ 07/Jul/15 ]

Hi Dima,

Maybe if you explain how you're using the driver version in your code, we can suggest an alternative way of accomplishing your goal.

Comment by Dima [ 07/Jul/15 ]

But what is the replacement of this? How do we to know the version of driver used with the application hosting the driver?

Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Removed Mongo.getVersion() method, which will be deprecated in the 2.13 release.

JAVA-1605
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/b72f4c0950487e34e5583b5d8eecfc209fe820b7

Comment by Githook User [ 05/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Removed Mongo.getVersion() method, which will be deprecated in the 2.13 release.

JAVA-1605
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/b72f4c0950487e34e5583b5d8eecfc209fe820b7

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