cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <dani...@nada.kth.se>
Subject Re: SQLTransformer and Transactions
Date Mon, 16 Dec 2002 14:38:35 GMT
Luca,

I would prefer to use stored procedures, but they are not implemented 
yet in MySQL and we use MySQL in all our applications. MySQL doesn't 
suport the begin-end; construction you used below either AFAIK.

/Daniel Fagerstrom

Luca Morandini wrote:
> Sylvian,
> 
> I'm not completely convinced a rewriting of SQLTransformer is needed to handle transactions...
I tried the following:
> 
> <sql:query isstoredprocedure="false">
> 	name="test">
> 	begin
> 		DELETE FROM CRRegion
> 			WHERE Id > 80;
> 		COMMIT;
> 		INSERT INTO CRRegion
> 			(Id, Name)
> 			VALUES
> 			('90', 'Foo');
> 		INSERT INTO CRRegion
> 			(Id, Name)
> 			VALUES
> 			('91', 'Bar');
> 		ROLLBACK;
> 	end;
> </sql:query>
> 
> And it worked just fine (both the commit and the rollback parts). I even tried
> some variations on this theme and they worked just as well.
> 
> There is a catch though: I tried on Oracle only.
> I don't know whether the begin/end statement could be used with other DBMSes.
> 
> Anyway, I agree the use of a single connection to process the complete input document
would increase performance and reduce
> side-effects.
> 
> Best regards,
> 
> P.S.
> As you may easily imagine, I consider Stored Procedures the only proper place for handling
transactions; but, if people cannot/want
> not go for SPs... let's give them some alternatives.
> 
> ---------------------------------------------
>                Luca Morandini
>                GIS Consultant
>               lmorandini@ieee.org
> http://utenti.tripod.it/lmorandini/index.html
> ---------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message