Category Archives: Developer Tools

CopyCat Developer 3.8.1

New error handling mechanism:
  • Removed RPL$ERRORS table and TCcReplicator.LogErrors property.
  • Added some new fields to RPL$LOG (ERROR_MESSAGE, ERROR_CONTEXT).
  • Rows that cannot be replicated are now left in RPL$LOG with their ERROR_MESSAGE and ERROR_CONTEXT set.
New option to keep rows in RPL$LOG
  • A new property TCcReplicator.KeepRowsInLog allows you to keep replicated rows in RPL$LOG. This gives you a very detailed trace of everything that took place, and can be used instead of the depecated RPL$TRACE mechanism for debug purposes, or for auditing.
  • Rows that have been replicated will have their RPL$LOG.REPLICATION_STATE set, so if you want to see the rows that need to be replicated, you check where REPLICATION_STATE is null.
  • TCcReplicator: If a row can’t be replicated due to an error, we now place it in a list of failed rows, and continue to replicate. If the same row was changed again at a later point in the repliaction cycle, we skip it and leave it unreplicated. This is particularly important when using the new ReplicateOnlyChangedFields option, as data changes could otherwise get lost (and to avoid such problems, it would have been necessary to perform the entire replication cycle within a single transaction).
  • TCcReplictor: Added a new SkipToRemote option in OnReplicationError event allowing you to skip replication of local rows if an error occurs, but to continue replicating the remote changes to the local database. This feature makes sense only if using ReplicateOnlyChangedFields. Using this option, you can ensure consistency (by rolling back when there is a replication error) without aborting replication altogether.
  • TCcReplicator: Added queryPerformed parameter to OnRowReplFinishing and OnRowReplicated events, so that you can know what type of action was performed on the row (delete, update, or insert).
  • TCcConnection: fixed a bug that sometimes caused an access violation when destroying a TCcConnection.
  • Fix for SQL Server to correctly handle primary key fields of date or timestamp type.
  • TCcConfig: fixed a bug causing the OnExecute event of the TCcConnection not to fire while using TCcConfig.
  • TCcConfig: Added OnProgress event allowing you to keep the GUI active (using an Application.ProcessMessages for example) while configuring the databases.
  • TCcConfig: Some internal meta-data caching during configuration so as to improve performance over slow connections.
  • TCcConflictMgr: fixed a bug causing all the rows in RPL$LOG for a given row/table to be set to conflicted state rather than just the rows being replicated.
  • FIREBIRD ONLY: Fixed a bug causing the new ReplicateOnlyChangedFields feature to fail when replicating floating point values on systems using a decimal separator other than ‘.’.
  • FIREBIRD ONLY: Added a new RPL$NO_REPLICATION context variable. If you set this variable to ‘True’, the replication triggers will be by-passed. This is very useful if you want to execute a script that will cause massive updates to a large table.
  • TCcLog: fixed a bug that caused the conflict detection mechanism to fail sometimes.
  • TCcLog: fixed a bug that caused very bad performance when detecting a conflict using ReplicateOnlyChangedFields, in cases where there were a lot of changes in RPL$LOG.
  • TCcQuery: Fixed a bug causing the OnExecute event not to get fired.

CopyCat Developer v.3.7.1

We’re pleased to announce the release of CopyCat Developer version 3.7.1! The changes in this release are as follows: – XE7 support – Major performance and memory management improvements of big logs. Instead of loading the whole list of changes to replicate into memory at once, it is now streamed in row by row. – The UPDATE OR INSERT statement is now used in FB 2.1+, in order to reduce the number of statements needed and thus optimize performance. – Internal changes enabling the use of prepared queries during replication, thus again dramatically improving performance. – Improved performance of TCcConnection.GetFieldType – Fixed a memory leak that caused problems with long-running replication cycles. – Fixed a bug in the millisecond handling in Firebird.

CopyCat Developer v. 3.06.1

We’re pleased to announce a new minor release of CopyCat Developer, containing the following changes :
  • Added method ConnectAndRemoveConfig to TCcConfig, allowing to entirely remove all replication meta-data (that is, the RPL$ tables, the triggers, etc) from the database. (Firebird/Interbase only).
  • Added packages for NexusDB connector for old Delphi versions (D5 to XE4).
  • Improved timestamp formatting when timestamp fields are used as part of a primary key, so that milliseconds and 100 microseconds are included. (Firebird/Interbase only).
  • Improved floating point formatting when numeric fields are used as part of a primary key, so that the decimal formatting settings of the machine have no impact on the formatting used. (Firebird/Interbase only).
  • Fixed a bug sometimes causing some of the tables of the database not to be found (Firebird/Interbase only).
  • Added FireDAC connector package for XE4.

CopyCat Replication Engine v. 3.06.0 released!

We are pleased to announce a new release of CopyCat Developer Tools, version 3.06.0! Registered users can download it from their private download page. Changes in this release include : 
  • XE6 support
  • NexusDB support
  • Support for mobile platforms (iOS / Android)
  • Added IBDAC connector
  • Added DataSnap transport
  • Added FireDAC connector
  • Added new Demo project in Examples\Demo
  • Added index on RPL$LOG.PRIMARY_KEY_VALUES in Firebird 2.5+ for the sake of optimization
  • Added support for replicating tables with no primary key : in such cases, CopyCat will first look for any unique index to use instead of the PK, and if none are available, then rows will be identified based on all the fields of the table (excluding varchars longer than 200 characters and blobs).
  • Added support for various field types that were missing (ftGuid in ADO connector, ftTimeStamp, ftFmtBCD, ftWord, ftLongWord…)
  • Added TFDMemTable as an optional ancestor for TCcMemoryData, activated by setting compiler conditional CC_MEMDS_FIREDAC in CC.INC. Using this feature is necessary on mobile platforms, as the built-in memory dataset does not support the nextgen compiler.
  • Added PKSynchronization property to TCcReplicator. If set to false (the default), the primary key synchronization system is disabled, which allows some optimizations of the code internally.
  • Added Priority property in TCcConfigTable so you can set the replication priority of a table through the TCcConfig.Tables property.
  • TCcReplicator.Log is now reinitilized at the very start of replication, before the log is loaded. That way, if replication is aborted and then restarted, the TCcLog.LineCount and CurrentLine properties will be correct.
  • TCcReplicator now automatically disconnects if Replicate is called with a connection is already open, unless that connection had been opened by the replicator itself (using KeepConnection for example). That addresses a common mistake people made when trying to replicate, as a connection open outside of TCcReplicator will cause the rows replicated to bounce back and forth between nodes.
  • Fixed problem in the installer causing the components to not be installed in the IDE
  • Changed date format used for MS SQL to ‘YYYY-MM-DDThh:mm:ss[.mmm]’, so that it works in all locales.
  • Fixed bug causing empty string to convert to NULL in some cases.
  • Fixed several bugs causing binary blob data to get replicated incorrectly for ADO, RTC and XMLRPC connectors
  • Fixed bug causing XMLRPC server to fail completely when using Indy 10 in the newer IDE versions
  • Changed TCcConnection.InTransaction property to reflect value of underlying transaction object : thus, if a connection was lost, CopyCat will not erroneously consider the transaction to still be open.
  • Fixed a bug causing the TCcReplicator.AutoCommit property to fail
  • Fixed bug that caused replication of ftWideString fields to fail when using versions of Delphi older than BDS 2006.
  • Various other minor bug fixes

New demo project

By popular request, I’ve created a new demo project, that should serve as an easy introduction into using CopyCat Developer edition. The code is very simple, with ample comments, so I think it should be easy to use. This new demo is based on the new features of TCcConfig that were introduced a few versions ago, and which the old example projects didn’t take advantage of, and that has allowed us to greatly simplify the code. The demo will be included in future releases of CopyCat Developer, but for now, you can get a hold of it here. Please let us know what you think of it in the comments or in the forum, and if you have any other ideas of things you would like to see examples of, we’re eager to hear your suggestions!