Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Conexión con bases de datos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Conexión con bases de datos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 31-08-2011
El_Raso El_Raso is offline
Miembro
 
Registrado: oct 2003
Posts: 135
Poder: 21
El_Raso Va por buen camino
Question En FIBPlus uso de autocommit

Un Saludo a la comunidad....

Tengo una duda... uso las FIBPlus la 6.9.5 con Delphi 7 (este componente es excelente), si uso AutoCommit como True en la Propiedad de una Tabla debo de iniciar la transaccion tambien, osea, la propiedad StarTransaction = True

O digame alguien cual es la forma correcta.

Gracias.
Responder Con Cita
  #2  
Antiguo 31-08-2011
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
No conozco los componentes FibPlus pero el Commit cierra la tabla.
Verifica que exista en ese componente el CommitRetaining que lo que hace es hacer un commit pero sin cerrar la tabla.
Saludos
__________________
Siempre Novato
Responder Con Cita
  #3  
Antiguo 31-08-2011
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.040
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
En la web de fibplus puedes descargar unos tutoriales (FIBplus devguide1.pdf y FIBplus devguide2.pdf), en uno de ellos dice:

Cita:
Working with transactions
A transaction is an operation of database transfer from one consistent state to another.
All operations with the dataset (data/metadata changes) are done in the context of a
transaction. To understand special FIBPlus features completely you need to know about
InterBase / FIBPlus transactions. Please read the topic «Working with Transaction» in
ApiGuide.pdf for InterBase.
All the changes done in the transaction can be either committed (in case there are no errors) by
Commit or rolled back (Rollback). Besides these basic methods TpFIBTransaction has their
context saving analogues: CommitRetaining and RollbackRetaining, i.e. on the client side, these
will not close a TpFibQuery or TpFibDataset.
To start the transaction you should call the StartTransaction method or set the Active property
to True. To commit the transaction call Commit/CommitRetaing, to roll it back -
Rollback/RollbackRetaining.
TpFIBQuery and TpFIBDataSet components have some properties which help to control
transactions automatically. In particular they are: the TpFIBDataSet.AutoCommit property; the
poStartTransaction parameter in TpFIBDataSet.Options; qoStartTransaction and
qoCommitTransaction in TpFIBQuery.Options.
How to set transaction parameters
Transaction parameters are not a trivial topic and require much explanation, so FIBPlus
DevGuide won’t cover the subject in detail. We highly recommend you to read InterBase
ApiGuide.pdf to understand how transactions work.
Nevertheless in most cases you do not need to know about all peculiarities of transaction control
at the API level. FIBPlus has a number of mechanisms which help developers’ work easier. I.e.
TpFIBTransaction has three basic transaction types: tpbDefault, tpbReadCommited,
tpbRepeatableRead. At design time you can also create special types of your own in the
TpFIBTransaction editor and use them as internal ones. Set the transaction type to set its
parameters::
TpbDefault – parameters must be set in TRParams
tbpReadCommited – shows the ReadCommited isolation level
tbpRepeatableRead – shows the RepeatableRead isolation level
Planning to use transactions in the application
Efficient InterBase/Firebird applications depend heavily on correct transaction use. In a multi-
generation architecture (record versioning) Update transactions retain record versions.
So in general try to make the Update transactions as short as possible. Read-only transactions
can remain open because they do not retain versions.
Responder Con Cita
  #4  
Antiguo 01-09-2011
Avatar de Chris
[Chris] Chris is offline
Miembro Premium
 
Registrado: abr 2007
Ubicación: Jinotepe, Nicaragua
Posts: 1.678
Poder: 19
Chris Va por buen camino
Cita:
Empezado por El_Raso Ver Mensaje
Un Saludo a la comunidad....

Tengo una duda... uso las FIBPlus la 6.9.5 con Delphi 7 (este componente es excelente), si uso AutoCommit como True en la Propiedad de una Tabla debo de iniciar la transaccion tambien, osea, la propiedad StarTransaction = True

O digame alguien cual es la forma correcta.

Gracias.
Todo depende! AutoCommit se utiliza para hacer "commit" automáticamente luego de que guardas el cambio a un registro o lo eliminas. Normalmente, para que te funcione de maravillas debes utilizar la propiedad UpdateTransaction y asignarla a un componente de transacción que no sea el mismo utilizado en la propiedad Transaction.

StartTransaction se utiliza para iniciar automáticamente la transacción cuando abres la tabla, si es que la transacción aún no se ha iniciado.

En resumen, activa ambas propiedades y utiliza dos transacciones independientes. Una transacción para lectura y otra para escritura.


Saludos,
Chris
__________________
Perfil Github - @chrramirez - Delphi Blog - Blog Web
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ibx a FibPlus raistware Conexión con bases de datos 6 05-01-2007 14:21:53
FIBPlus emeritos Lazarus, FreePascal, Kylix, etc. 3 19-06-2004 16:56:40
FibPlus Malon Conexión con bases de datos 4 22-04-2004 01:41:49
IBX, IBO, Fibplus raul_sal Conexión con bases de datos 6 04-06-2003 00:50:45
FibPlus y las Dll Erik_Magnus Firebird e Interbase 0 23-05-2003 06:44:25


La franja horaria es GMT +2. Ahora son las 16:33:13.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi