Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Problem with tr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15519 of 17437
Post > Topic >>

Problem with transaction isolation level

by Michal Szymanski <dyrex@[EMAIL PROTECTED] > May 13, 2008 at 01:26 AM

Hi,
I develop telecommunication software and I have encountered problem
with isolation level in Postgres.
Our database receive special packets that informs about end of call,
and from time to time (it happens when such packets arrive almost in
the same time e.g 8ms difference) one call  charge user account twice.
Look at following diagram that clarify what exactly happen:

http://gdn.superhost.pl/pub/RozjazdKontWyjasnienie.jpg

I think problem is because we use default Read Commited isolation
level. In presented example value of credit should be changed only if
call_status<>FINS and first transaction after modification of credit
value set call_status to FINS. This should prevent from second
modification of  credit (bacause call_status=FINS), but in our systems
sometimes such protection does not work. I think that between check of
call_status and update of credit is small window that cause that
second transaction cannot see results of first transaction (=second
transaction cannot 'see' that call_status=FINS)

I think that switching to serializable level can fix this issue but we
cannot do this because we afraid of side effects of such strict
isolation level. Second thought is to use explicitly ACCESS EXCLUSIVE
lock on CDR table but does it help?

Michal
http://blog.szymanskich.net
 




 3 Posts in Topic:
Problem with transaction isolation level
Michal Szymanski <dyre  2008-05-13 01:26:20 
Re: Problem with transaction isolation level
pavan.deolasee@[EMAIL PRO  2008-05-15 14:20:14 
Re: Problem with transaction isolation level
Michal Szymanski <dyre  2008-05-16 14:11:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 13:03:41 CST 2008.