public void Finish_rbsReplayInternal(Sybase.Persistence.IOperationReplay _call_tmp)
        {
            YPF.Comercial.RRCC.SUP.intrnl.OperationReplay _call = (YPF.Comercial.RRCC.SUP.intrnl.OperationReplay)_call_tmp;
            com.sybase.afx.json.JsonObject parameters           = (com.sybase.afx.json.JsonObject)(com.sybase.afx.json.JsonReader
                                                                                                   .Parse(_call.Parameters));
            string exception = _call.Exception;

            YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento entity = (YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento)(YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento.__fromJSON(parameters.Get("entity")));

            //lock(typeof(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB))
            //{
            Sybase.Persistence.ConnectionWrapper conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
            Sybase.Persistence.LocalTransaction  tran = null;
            try
            {
                tran = conn.BeginTransaction();

                long ____id = entity.ReplayCounter;
                YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento _client        = YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento.Find(entity._pk());
                YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento _downloadState = null;
                if (_client != null)
                {
                    _downloadState = _client.DownloadState;
                }
                if (exception == null)
                {
                    YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.GetCallbackHandler().OnReplaySuccess(_client == null ? entity : _client);
                    YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento.GetCallbackHandler().OnReplaySuccess(_client == null ? entity : _client);
                    if ((_client != null) && _client.IsPending)
                    {
                        long _rc = _client.ReplayPending;
                        if (_rc == ____id)
                        {
                            if (_rc == _client.ReplayCounter)
                            {
                                _client._cancelPending2(false);
                            }
                            else
                            {
                                _client.ReplayPending = 0;
                                _client.ReplayFailure = 0;
                                _client.__update(true);
                            }
                        }
                    }
                }
                else
                {
                    _client.ReplayFailure = (_client.ReplayPending);
                    _client._cascadeUpdateReplayCounterPending(false);
                    if (_client != null && _client.ReplayPending == ____id)
                    {
                        _client.ReplayPending = (0);
                        _client.ReplayCounter = (YPF.Comercial.RRCC.SUP.KeyGenerator.GenerateId());
                        _client.ReplayFailure = (____id);
                        _client.__update(true);
                        if (_downloadState != null)
                        {
                            _downloadState._update_os();
                        }
                    }
                    YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.GetCallbackHandler().OnReplayFailure(_client);
                    YPF.Comercial.RRCC.SUP.SeleccionTablaRelevamiento.GetCallbackHandler().OnReplayFailure(_client);
                }
                _call.Delete();
                tran.Commit();
            }
            catch (Sybase.Persistence.PersistenceException pe)
            {
                tran.Rollback();
                throw pe;
            }
            catch (System.ApplicationException e)
            {
                tran.Rollback();
                throw e;
            }
            //}
        }