[Dbix-class] Problem with DBIC::PK::Auto::Oracle
and compositetriggers
Jess Robinson
castaway at desert-island.demon.co.uk
Sat Jan 7 10:24:01 CET 2006
On Tue, 3 Jan 2006, James FitzGibbon wrote:
> The biggest problem I have with separate triggers (in Oracle) is that the
> firing order is undefined for triggers of the same type. So if one BEFORE
> INSERT trigger populates your primary key and another BEFORE INSERT trigger
> inserts a record in an audit table, you have no guarantee that your audit
> record will contain your primary key value. Which would be, well, bad. 8-)
>
> Oracle recommends one large trigger to ensure that the order is the one you
> want, and while you can make that trigger call out to separate PL/SQL
> procedures for the purposes of keeping things "clean", there is a whole bag
> of other problems that come along with (such as the pseudo-collections 'new'
> and 'old' which can't be passed as a collection to another procedure).
>
> It's all doable, just proportionately ugly.
>
> I'll probably stick with the subclass "LIKE '%INSERT%'" solution.
>
Yeah, Oracle is annoying like that.
You missed out an option, since you know the sequence name (I would hope
;), just set it using ->sequence('myseq'), and it wont have to do any
searching at all.
Jess
More information about the Dbix-class
mailing list