Table versions

User 192d91eabf

15-08-2014 13:05:21

Hi,


I'm looking at moving an application from 6.2 to a more recent build of JChem Suite (14.8.11.0 in this case), and I've noticed some oddities with regard to table version information.


In a database created with 6.2, the JCHEMPROPERTIES shows the table version as being "6400000". For such database, having been upgraded using 14.8.11.0, the table version is "6400002". For a database created with 14.8.11.0, the table version is "6.40.0.2". The table version number as reported by chemaxon.jchem.version.VersionInfo.getJChemTableVersion() is 6400004.


The application had previously been assuming that if the table version property - interpreted as an integer - was less than the table version given by VersionInfo then a database upgrade was needed. However, this doesn't work if the table version is either non-numeric or if upgrading doesn't increment it sufficiently.


So, how should I be detecting when a database needs upgrading?


Best regards,


Robin.

ChemAxon d4fff15f08

18-08-2014 09:38:15

Hi Robin,


 


You are right, with changing our release policy we have changed our version numbering and therefore the table versions too. Perhaps the latter changed in a less clear/logical manner. Thanks dragging our attention to it.


I am writing my comments inline:


In a database created with 6.2, the JCHEMPROPERTIES shows the table version as being "6400000"

This is only possible if you have already updated the 6.2-created table.


 


For such database, having been upgraded using 14.8.11.0, the table version is "6400002". For a database created with 14.8.11.0, the table version is "6.40.0.2".

This is also true. Although the table versions could be/are stored in different format (old one, new one: having dots as separator) both are handled by the API.


 


The table version number as reported by chemaxon.jchem.version.VersionInfo.getJChemTableVersion() is 6400004.

This is a bug which needs to be fixed. The expected return value would be:6400002 as this function returns integers for easy comparability. In case you would like to have the string format delimited by dots you can use toString function.


The application had previously been assuming that if the table version property - interpreted as an integer - was less than the table version given by VersionInfo then a database upgrade was needed. However, this doesn't work if the table version is either non-numeric or if upgrading doesn't increment it sufficiently.

After fixing this bug you will be able to use the same logic for deciding on table upgrade.


 


Best regards,


Norbert

User 192d91eabf

18-08-2014 09:57:21










nsas wrote:

After fixing this bug you will be able to use the same logic for deciding on table upgrade.



Cheers,


Robin

ChemAxon a9ded07333

19-08-2014 13:15:19

Dear Robin,


I have to modify a bit our answer: getJchemTableVersion() returns correctly 6400004, since reaction table version is 6.40.0.4.


Fortunately, you don't have to care about table version numbers. If you are intersted in deciding whether table should be regenerated or not, it's enough to call


RegenerationChecker.isRegenerationNeeded(String tableName, DatabaseProperties dp)

Its returning values are RegenerationConstants.TABLE_VERSION_OK, RegenerationConstants.TABLE_VERSION_OLDER or RegenerationConstants.TABLE_VERSION_NEWER.


Please let us know if you have any questions about this method.


Cheers,
Tamás

User 192d91eabf

19-08-2014 13:59:54

Thanks. It did occur to me that the code was being a bit nosey. I'll let you know if I have any problem with the method you suggested.


Thanks again,


Robin