|
Home > Archive > SQL Anywhere Mobile > May 2005 > Logging All failed Transactions to a Table
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Logging All failed Transactions to a Table
|
|
|
| Is there anyway to log all the failed transactions on the consolidate to a
table.
RAY.
| |
| David Fishburn 2005-05-05, 11:24 am |
| "RAY" <s. rayala@stanleyassoci
ates.com> wrote in
news:427a3c01$1@foru
ms-1-dub of sybase.public.sqlanywhere.mobilink:
R> Is there anyway to log all the failed transactions on the consolidate
R> to a table.
Can you give an example of what exactly was uploaded (or reported) that
you wanted logged.
I take it you are not referring to the report_error connection event?
Please ALWAYS include version and MORE importantly BUILD number
with EACH post (dbeng9 -v).
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).
EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm
Developer Community / Whitepapers
http://www.ianywhere.com/developer
CaseXpress - to report bugs
http://casexpress.sybase.com
CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
| |
|
| I would like to contine with synchronization ignoring any data constraint
errors and logging the failed transaction to a table. I can see the failed
transaction in the dbmlsrv's log file by using the appropriate switches. How
can I capture these and insert them into a table with table name, error
message, SQL Statement that caused the error. It seems that the report_error
can only capture the error_message, table name, .. but not the SQL statement
or the the statement's data.
RAY.
Version: 9.0.2.2451
"David Fishburn" <fishburn_spam@off.ianywhere.com> wrote in message
news:Xns964D7A7B415D
fishburnsybasecom@12
7.0.0.1...
> "RAY" <s. rayala@stanleyassoci
ates.com> wrote in
> news:427a3c01$1@foru
ms-1-dub of sybase.public.sqlanywhere.mobilink:
>
> R> Is there anyway to log all the failed transactions on the consolidate
> R> to a table.
>
> Can you give an example of what exactly was uploaded (or reported) that
> you wanted logged.
>
> I take it you are not referring to the report_error connection event?
>
> Please ALWAYS include version and MORE importantly BUILD number
> with EACH post (dbeng9 -v).
>
> --
> David Fishburn
> Certified ASA Developer Version 8
> iAnywhere Solutions - Sybase
> Professional Services
> Please only post to the newsgroup
> Please ALWAYS include version and MORE importantly BUILD number with
> EACH post (dbeng9 -v).
>
> EBFs and Maintenance Releases
> http://downloads.sybase.com/swx/sdmain.stm
>
> Developer Community / Whitepapers
> http://www.ianywhere.com/developer
>
> CaseXpress - to report bugs
> http://casexpress.sybase.com
>
> CodeXchange - Free samples
> [url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
>
| |
| Greg Fenton 2005-05-05, 1:24 pm |
| RAY wrote:
> It seems that the report_error
> can only capture the error_message, table name, .. but not the SQL statement
> or the the statement's data.
I think we'll need to get a better understanding of what you are trying
to accomplish. Though you will tend to get lots of errors/failed
synch's during development, I can't say that I've ever had a
*production* system that logged data to the consolidated.
What are you hoping to accomplish with the data should it be logged?
Also, are you overriding the error handling mechanism in ML with
handle_error? Though there are some cases where this makes sense, we
recommend *not* implementing handle_error. Design your system to avoid
data errors and in the event that a data error occurs, fix the data and
resynchronize. Allow the data error to fail the synch.
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
|
| I agrre with that. Right now I am only logging the failed transaction to the
log file using -vchhnpstu options. In this way I can see what transaction
are causing this failure and I can fix them in the remote and re-sync those
transactions. I agree with you if the failures are huge then it is difficult
to address them with the above method.
Also, how can we correct and re-sync the data once we know that there are
some errors in the data. i.e say I have dsiabled a foreign key constraint
and I agrree we shouldn't but for demonstration assume that it is disabled
on the remote and I have inserted one record to the referencing table that
does not have a matching record in the primary table and commit it. When I
try to sync it fails because the consolidate still checks the constraint. If
I addresses this on the remote by inserting primary record into the primary
table and after commit, still it wont sync. because mlsrv tries to apply the
first transaction first and throws error again. Scenarios like these how can
I handle?
RAY
"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:427a5469$1@foru
ms-1-dub...
> RAY wrote:
statement[color=dark
red]
>
> I think we'll need to get a better understanding of what you are trying
> to accomplish. Though you will tend to get lots of errors/failed
> synch's during development, I can't say that I've ever had a
> *production* system that logged data to the consolidated.
>
> What are you hoping to accomplish with the data should it be logged?
>
> Also, are you overriding the error handling mechanism in ML with
> handle_error? Though there are some cases where this makes sense, we
> recommend *not* implementing handle_error. Design your system to avoid
> data errors and in the event that a data error occurs, fix the data and
> resynchronize. Allow the data error to fail the synch.
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/
| |
| Greg Fenton 2005-05-05, 8:24 pm |
| RAY wrote:
> I addresses this on the remote by inserting primary record into the primary
> table and after commit, still it wont sync. because mlsrv tries to apply the
> first transaction first and throws error again. Scenarios like these how can
> I handle?
ML does *not* apply transactions. It summarizes the changes that have
occured across *all* transactions since the previous synchronization and
uploads only those changes. The order of the upload is, by default,
determined by the *defined* RI (i.e. foreign keys) between tables. ML
uploads row such that they respect RI. If you do not have declared RI,
then how would ML know the appropriate order? Well, there is the
table_order extended option you can use on the remote to force the order
in which table modifications are uploaded.
We strongly suggest that you design your schema such that you do not
need to use the table_order option.
Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
|
|
|
|
|