Release Notes-8.0.0
Release Notes-8.0.0
0 Release Notes
Jan Baumgarten
April 7, 2024
1 Zeos 8.0
The Zeos Team is proud to announce the availability of Zeos 8.0 as a sta-
ble release. This is the newest stable version of Zeos. It deprecates Zeos
7.2 and all prior versions of Zeos. Zeos 8.0 has seen tons of bug fixes and
improvements. We urge all people still using older versions of Zeos to up-
grade. If you have any problems with Zeos 8.0, please get in contact with
us on the forums (http://zeoslib.sourceforge.io) or on the bugtracker
(https://sourceforge.net/p/zeoslib/tickets/).
2 General Changes
OleDB
1
ODBC
For a description of these new drivers please see the respective chapters.
WebServiceProxy
SQLite
2
On the bridge drivers (ADO, OLEDB and ODBC) the feature is not
fully tested. If you use one of them, we suggest, you do some tests for your
application.
PostgreSQL
MySQL / MariaDB
For ODBC, OLEDB and ADO the DeferPrepare property can be used.
Finally there is PreferPrepared. PreferPrepared gets mapped to Defer-
Prepared for OleDB, ODBC and ADO.
3
Note: TBCDField doesn’t usually round values. Assigning 1.065 works
for a numeric(15,2) database field. This value usually will also be presented
to the user (TField.AsString). To remedy situations where the database
would round the value and Zeos and the database have a different view of
the fields value, Zeos will round assigned values to the scale defined by the
underlying database fields before writing them to the field buffer. So Zeos
will round 1.065 to 1.07 and then send 1.07 to the database.
4
2.13 Nested transactions
Zeos now supports nested transactions. TZConnection.StartTransaction on
the component layer and IZConnection.StartTransaction will return the cur-
rent transaction nesting level. If a transaction already has been started, Zeos
will use save points to create nested transactions automatically. When issu-
ing a Commit or Rollback, Zeos will act accordingly by releasing save points
or rolling back to save points.
2.15.1 TZDateTimeField
5
2.16 New parameters for handling of exceptions and
warnings
Zeos 8.0 introduces two new parameters for the handling of exceptions and
warnings: AddLogMsgToExceptionOrWarningMsg and RaiseWarningMes-
sages
2.16.1 AddLogMsgToExceptionOrWarningMsg
This is a boolean option. If set to true (default) The offending SQL will be
added to exceptions generated by the server. If set to false, SQL statements
will not be added.
On the DBC layer this option is reflected by the SetAddLogMsgToEx-
ceptionOrWarningMsg method of the IZConnection Interface.
2.16.2 RaiseWarningMessages
This is a boolean option. If set to true, warnings by the SQL server will be
raised as exceptions. Default is false.
On the DBC layer this option is reflected by the SetRaiseWarningMes-
sages method of the IZConnection Interface.
6
manually. Types and sizes of parameter need to be set accordingly. See the
following example:
Query . ParamCheck := False ;
Query . SQL . Text := ’CALL a b t e s t ( ? , ? , ? , ? , ? ) ’ ;
Query . Params . CreateParam ( f t I n t e g e r , ’ P1 ’ , ptInPut ) ;
Query . Params [ 0 ] . A s I n t e g e r := 1 0 ;
Query . Params . CreateParam ( f t I n t e g e r , ’ P2 ’ , ptInPut ) ;
Query . Params [ 1 ] . A s I n t e g e r := 2 0 ;
Query . Params . CreateParam ( f t S t r i n g , ’ P3 ’ , ptInPut ) ;
Query . Params [ 2 ] . P r e c i s i o n := 1 0 ;
Query . Params [ 2 ] . A s S t r i n g := ’ xx ’ ;
Query . Params . CreateParam ( f t I n t e g e r , ’ P4 ’ , ptOutPut ) ;
Query . Params . CreateParam ( f t S t r i n g , ’ P5 ’ , ptOutPut ) ;
Query . Params [ 4 ] . P r e c i s i o n := 2 0 ;
Query . ExecSQL ;
2.20 TZParam
Zeos now implements its own paramater type TZParam. This will lead to
problems when parameters are stored in dfm/lfm files. The new TZParam
became necessary to support batch DML statements on the component layer
- with TZQuery and TZReadOnlyQuery.
7
When using TZTransaction, it makes sense to avoid using the StartTrans-
action, Commit and Rollback methods and to use the according methods
from TZTransaction instead.
On Firebird and Interbase Zeos can use their support for having multiple
concurrent transactions per connection. On all other database systems Zeos
will create a separate connection per transaction. This can lead to problems
if your license restricts the connection count or if one uses one time passwords
to secure databases.
A simple example how to use the new TZTransaction can be seen in the
test case TZGenericTransactionTestCase.TestQueryTransaction.
3 Firebird
StatementTimeOut
SesssionIdleTimeOut
8
3.3 Usage of new interface based API
The firebird driver uses the new interface based API that was introduced
with Firebird 3.0. If the client library doesn’t support this new API, it
will automatically fall back to the ISC API. If you want to force the usage
of the old API for some reason, you can set the option ”FirebirdAPI” on
the connection properties. If you set this property to ”interface”, the new
interface based API will get used. If you set this property to ”legacy”, the
legacy ISC API will get used.
4 MySQL / MariaDB
9
In general it makes sense to check if your parameters match the MySQL
/ MariaDB documentation now.
5 PostgreSQL
10
6 SQLite
11
Mode Value
OCI DEFAULT 0
OCI MIGRATE 1
OCI SYSDBA 2
OCI SYSOPER 4
OCI PRELIM AUTH 8
Table 1: Values for OCIAuthenticateMode
7 Oracle
12
8.2 new parameter TDSVersion
FreeTDS allows to select the proper TDS protocol version for your server. See
https://www.freetds.org/userguide/ChoosingTdsProtocol.html The new
parameter TDSProtocolVersion reflects this possibility. Possible values are
”4.2”, ”5.0”, ”7.0”, ”7.1”, ”7.2”, ”7.3” and ”7.4”.
9 OleDB
Zeos now supports OleDB for Delphi as well as for Free Pascal. It is meant
to replace the ADO driver and is faster than ADO as well. To use this
driver, insert the OLE DB Connection string into the Database property of
TZConnection. The host name property doesn’t work with this driver. This
driver was mostly tested with Microsoft SQL Servers during development.
9.1 parameters
13
DeferPrepare Defer prepare? If not set Zeos tries to prepare up-
date, delete, insert and select statements immedi-
ately. Also Zeos tries to determine the parameter
types, allocates the parameter buffers once only and
does not use late binding of parameters. Thus it is
faster if NO defer prepare is used and the statement
gets used more than once. Some servers might fail to
prepare the statments (MS products are masters at
failing including unknown exceptions). Turn it off
on the DataSet or Statement level if you run into
that issue.
StatementTimeOut Execution timeout of a statement in seconds.
MarsConn Enables MARS (Multiple Active Rsult Sets) on Mi-
crosoft SQL Server drivers.
Initial Catalog The initial catalog to use for the connection.
10 ADO
ADO is deprecated. Use OleDB instead.
11 ODBC
Zeos now supports ODBC for Delphi as well as for Free Pascal. The driver
registers two drivers, namely odbc a and odbc w. This allows to use Wide
Char drivers as well as ANSI drivers. To use this driver, insert the ODBC
Connection string into the Database property of TZConnection. For ex-
amples see (https://www.connectionstrings.com/). The host name property
doesn’t work with this driver. This driver was mostly tested with Microsoft
SQL Servers during development. Support for data source names is imple-
mented in that the driver checks if there is an equals sign (=) in the database
14
property. If there is no equals sign, the driver assumes that only the name
of a DSN was given and internally converts to a connection sting in the form
”DSN=<Database>”.
11.1 parameters
15
CharacterSet Specifies the character set used to interact with the
driver. If you are accessing a CharacterSet ”NONE”
Firebird / Interbase database you should always use
the character set ”NONE” as the connection char-
acter set. In addition it is recommended to spec-
ify which character set the ”NONE” represents by
adding the Charset NONE Alias parameter. Exam-
ple: Properties.Values[’Charset NONE Alias’] :=
’WIN1251’. For odbc a and ole db(raw longvar-
char only) it is implemented as: Set a custom char-
acterset to notify Zeos about conversion routines.
Note for odbc a: This CodePage must be equal
for all fields(ODBC). Otherwise use the odbc w
driver. Here it is defined as: <Character Set
Alias>:<Codepage>/<MaxBytes>where ”Charac-
ter Set Alias” is the character set alias, ”Code-
page” is the Windows code page number to be
used and ”MaxBytes” is the maximum number of
bytes in the character set. Example: Character-
Set=latin1:1252/1 or CharacterSet=utf8:65001/4
DRIVER Specifies the ODBC driver to be used on this con-
nection.
16
Scenarios where the connection may be unstable or where the connec-
tion and IP addresses used may change. I.e. access over the internet
or mobile networks or connectrions where the client transitions from
mobile connections to wireless lan or even wired connections.
Also the web service proxy server can add a layer of security because it
can add one time password schemes to the authentication used.
For more information on the Web Service Proxy see https://sourceforge.
net/p/zeoslib/wiki/WebServiceProxyDriver/
17
Procedure OpenInBackground ;
Begin
methodthread := TZMethodInThread . C r e a t e ;
methodthread . OnError := TDummy. OnError ;
methodthread . OnFinish := TDummy. OnFinish ;
myquery . SQL . Text := ’SELECT * FROM VeryHugeTable ’ ;
methodthread . Open ( myquery ) ;
End ;
If you are using data-aware components, make sure to unassign any data-
sources before (or call .DisableControls), as the VCL thread is not blocked
and data events will be attempted to be processed at inconsistent states.
This will most probably result in access violations or other unwanted be-
havior. Proper synchronization is also needed at event handlers (like TZ-
Query.BeforeOpen, .AfterOpen, .AfterScroll, TZConnection.AfterConnect,
etc.) as if specific actions are called from a worker thread, these event han-
dlers will also run in the worker’s context!
A long running operation can be canceled in two ways:
18
14 Known Limitations
19