Hi all,

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.

Question:

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.

asked 01 Jul '10, 10:40

Volker%20Barth's gravatar image

Volker Barth
39.9k360547816
accept rate: 34%

edited 08 Jul '10, 07:14

Has your database been rebuilt to be a v11 database? The v11 dbtools will not be able to process an 8.0.3 database.

(01 Jul '10, 12:21) Mark Culp

Yes, I have rebuild the database both for SA 11.0.1 and SA 12 and tested with logs of the according migrated dbs. The DBTools effect is similar to DBTRAN (which is understandable as DBTRAN uses DBTools itself, AFAIK): DBTRAN v8 and DBTRAN v11 can't translate a v12 log (which is understandable). In contrast, DBTRAN v12 can translate a v11 log.

(01 Jul '10, 12:28) Volker Barth

I have just replaced the v11 lib file (in my case dbtlstm.lib from the x86 dir) with the v12 version, and now it works (as dbtool12.dll is loaded instead of dbtool11.dll). Seems logically that the lib file defines which DLL is loaded. - For a "load the DLL version of the engine" system, I guess the DLLs would have to use generic names (just Dbtool.DLL) instead of the version-specific ones. But that might prevent several versions being in use at the same time...

(01 Jul '10, 12:40) Volker Barth

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.

permanent link

answered 14 Jul '10, 17:10

Volker%20Barth's gravatar image

Volker Barth
39.9k360547816
accept rate: 34%

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.

permanent link

answered 14 Jul '10, 19:59

Karim%20Khamis's gravatar image

Karim Khamis
5.7k53870
accept rate: 40%

Karim, I have read that part of the docs (and guess it hasn't generally changed compared to older versions - I have used DBTools since SA 5.5). But as stated, my observations with DbTranslateLog() and V11/V12 seem to imply that I can't use my DLL compiled against V11 to translate a V12 log - and neither can DBTRAN V11. (And when I were to migrate a V11 application to V12 and would replace the V11 software with V12, how could the app load the DbTools11.dll when it would be uninstalled?)

(14 Jul '10, 20:07) Volker Barth

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):

Der Server, der das Transaktionslog erstellte, hatte eine andere Version (Funktionalität 70 fehlt).

translated:

The server who created the transaction log had a different version (capability (or facility?) 70 is missing).

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:)

permanent link

answered 16 Jul '10, 07:42

Volker%20Barth's gravatar image

Volker Barth
39.9k360547816
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×143
×15
×13
×11

question asked: 01 Jul '10, 10:40

question was seen: 3,254 times

last updated: 16 Jul '10, 07:42