[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[postgresql-it] Aiuto su isolation level
- From: "Andrea Veggiani" <sviluppo@xxxxxxx>
- Subject: [postgresql-it] Aiuto su isolation level
- Date: Thu, 26 Apr 2012 17:29:20 +0200
Ciao a tutti,
Abbiamo dei problemi nella gestione delle transazioni:
il seguente codice:
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN TRANSACTION;
update miatabella
set numero = ((select MAX(numero) AS numero from miatabella where anno
= '#arguments.anno#' and sigla = #arguments.Sigla#')+1)
where id = '#arguments.id#';
COMMIT;
dovrebbe garantire l'univocità del valore creato nel campo numero ma così
non è; in alcuni casi è capitato che venissero
generati due record con valore coincidente del campo numero.
La versione di PostgreSQL che stiamo usando è la 9.0 su Windows.
Grazie mille per l'aiuto.
Saluti
Andrea Veggiani