Subject | Trigger doesn't fire |
---|---|
Author | Paweł Świerzko |
Post date | 2009-09-26T00:30:14Z |
Hi,
I have an application written in java, which saves data into firebird
database (classic 1.5.3) .
I needed extend the database a little bit.
The application modifies one field in a table. I wanted to save the
previous value of the field.
So I added a field in the table old_value
and created simple before update trigger:
as begin
new.old_value = old.myfield;
end;
When I change value of myfield in Ibexpert the trigger works and old_value
is updated.
Surprisingly the same operation through java application behaves
differently:
value of myfield changes but old_value stays unchanged.
It seems that the trigger is not fired! Is it possible to deactivate
triggers
on connect individually for connection ?
I also checked the possibility that the value is not changed but whole
record
is deleted and inserted with old pk value - i have created before insert
trigger
firing exception.
And as previous I can not insert any new record throug Ibexpert
but the application still ia able to change the value of myfield.
Maybe you can explain me what is happenig ?
Pawel
I have an application written in java, which saves data into firebird
database (classic 1.5.3) .
I needed extend the database a little bit.
The application modifies one field in a table. I wanted to save the
previous value of the field.
So I added a field in the table old_value
and created simple before update trigger:
as begin
new.old_value = old.myfield;
end;
When I change value of myfield in Ibexpert the trigger works and old_value
is updated.
Surprisingly the same operation through java application behaves
differently:
value of myfield changes but old_value stays unchanged.
It seems that the trigger is not fired! Is it possible to deactivate
triggers
on connect individually for connection ?
I also checked the possibility that the value is not changed but whole
record
is deleted and inserted with old pk value - i have created before insert
trigger
firing exception.
And as previous I can not insert any new record throug Ibexpert
but the application still ia able to change the value of myfield.
Maybe you can explain me what is happenig ?
Pawel