I have just migrated a DLL that uses the DBTools API from ASA 8.0.3. to SA 11.0.1. It is implemented as a SQL Anywhere external call library.
Among others, it has a function to verify the validity of a transaction log. It does so by using the DbTranslateLog() API.
As stated in the docs, the DBTools API is generally compatible w.r.t. to different versions when the according version number is set correctly in the DBTools structures.
But running the DLL against a SA 12 transaction log does not work - it gives a version mismatch error. However, the same error is displayed when running v11 DBTRAN against a v12 transaction log.
AFAIK, there are a few utilities that must be used in the same version (including build number, methinks) as the database engine, particularly DBUNLAOD and DBXTRACT. DBTRAN might be one of them, too.
Is the general DBTools compatibility limited for those API calls that require to be the same version as the database/log they work on?
In other words: Do I have to build different DLLs for different (major/minor) versions then?
(If so, that ought to be documented somewhere...)
EDITED: Note that this is not a problem to solve but just something I try to understand. As it is our own development, it's no problem to build version-specific DLLS.
Since no real answer has arrived yet:
Studying the DBTools header files for SQL Anywhere 11 and 12, it seems that several structures have changed significantly.
As such, I have the impression that the DbTools API is primarily compatible within the same base version (i.e. between major versions like 11.0.0 vs. 11.0.1). It seems not to be generally compatible between, say version 11 and 12. And this would make sense IMHO, as an application is usually linked statically against a particular versioned DLL, i.e. against dbtools11.dll vs. dbtools12.dll.
As said, no real answer - just my observations:)
Feel free to confirm or correct these assumptions.
answered 14 Jul '10, 17:10
From the documentation:
SQL Anywhere Server - Programming >> Database tools interface (DBTools) >> Using the database tools interface >> Version numbers and compatibility
Version numbers and compatibility Each structure has a member that indicates the version number. You should use this version member to hold the version of the DBTools library that your application was developed against. The current version of the DBTools library is defined when you include the dbtools.h header file.
To assign the current version number to a structure Assign the version constant to the version member of the structure before calling the DBTools function. The following line assigns the current version to a backup structure:
backup_info.version = DB_TOOLS_VERSION_NUMBER;
Compatibility The version number allows your application to continue working against newer versions of the DBTools library. The DBTools functions use the version number supplied by your application to allow the application to work, even if new members have been added to the DBTools structure.
When any of the DBTools structures are updated, or when a newer version of the software is released, the version number is augmented. If you use DB_TOOLS_VERSION_NUMBER and you rebuild your application with a new version of the DBTools header file, then you must deploy a new version of the DBTools library. If the functionality of your application doesn't change, then you may want to use one of the version-specific macros defined in dbtlsvers.h, so that a library version mismatch does not occur.
answered 14 Jul '10, 19:59
Note: This is more a verbose comment than an answer - I just wanted to use formatting...
Just to confirm the version mismatch:
When using the DLL linked against the DBTools V11 API with the V12 engine and database, the actual error message running DBTranslateLog() is (German locale):
Calling DBToolsVersion() returns 11000 as expected.
Therefore I have still the strong impression that there is no overall version compatibility w.r.t. to the DBTools API.
Any more insights are still welcome:)
answered 16 Jul '10, 07:42