﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Why I don't like FireBird: Part II</title><description>The code isn't the best, but the error is real
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment12</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment12</guid><pubDate>Fri, 08 Aug 2008 15:18:40 GMT</pubDate></item><item><title>Ro commented on Why I don't like FireBird: Part II</title><description>Could it be a bug in your code? If I understand correctly, in the exception catch you only test for one message, for other messages control falls through to done = true and ends the loop, returning the data that was read in the first select command. 
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment11</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment11</guid><pubDate>Thu, 07 Aug 2008 22:45:45 GMT</pubDate></item><item><title>Ayende Rahien commented on Why I don't like FireBird: Part II</title><description>I'll let you guess what I am working on...
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment10</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment10</guid><pubDate>Wed, 09 Jul 2008 03:56:36 GMT</pubDate></item><item><title>The Other Steve commented on Why I don't like FireBird: Part II</title><description>This comment:
  
// someone else already grabbed and deleted this row, 
  
// so we will try again with another one
  
  
is shouting semaphore.
  
  
Even then, I'm hearing MSMQ whispering in the wind.
  
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment9</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment9</guid><pubDate>Tue, 08 Jul 2008 19:56:34 GMT</pubDate></item><item><title>Ayende Rahien commented on Why I don't like FireBird: Part II</title><description>You have the SQL there, and the table structure is 1:1 with that.
  
Make sure to run this on 3 threads, that is how I got it.
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment8</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment8</guid><pubDate>Tue, 08 Jul 2008 15:21:01 GMT</pubDate></item><item><title>Filip Kinsky commented on Why I don't like FireBird: Part II</title><description>Serializable and ReadCommited are both supported in FireBird. ReadCommited is default isolation.
  
http://www.firebirdsql.org/dotnetfirebird/blog/2005/02/transaction-isolation-levels-in.html
  
  
could you provide some really simple set of SQL/DDL commands to simulate the error behavior you describe?
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment7</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment7</guid><pubDate>Tue, 08 Jul 2008 12:07:45 GMT</pubDate></item><item><title>Ayende Rahien commented on Why I don't like FireBird: Part II</title><description>There isn't a second select, it is a delete.
  
  
Basically, I am doing:
  
  
1) give me the first row
  
2) delete the previously selected row
  
3) if successfully deleted, return row
  
4) if failed to delete, go to 1)
  
  
That is safe in read committed mode, but it fails with FireBird.
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment6</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment6</guid><pubDate>Mon, 07 Jul 2008 11:57:20 GMT</pubDate></item><item><title>Frans Bouma commented on Why I don't like FireBird: Part II</title><description>You mean, the second select shouldn't succeed if someone else already read the row which should have placed a read lock on the row? I'm not sure if Firebird sets read-locks in such a way that multiple reads of the same row isnt possible if the row was already locked for reads. 
  
  
I'm also not sure if firebird supports hints for locks. Their manual is pretty bad, to say the least. 
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment5</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment5</guid><pubDate>Mon, 07 Jul 2008 11:50:54 GMT</pubDate></item><item><title>Ayende Rahien commented on Why I don't like FireBird: Part II</title><description>Frans,
  
The code above should work with even with read committed.
  
Notice that I am explicitly checking that the row was removed, and only then moving on.
  
I still managed to get duplicate results here.
  
  
  
1) I often use this approach to handle additional concerns. Consider this as a poor man's AOP.
  
2) I disagree with that. All access to the DB should be done under a transaction.
  
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment4</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment4</guid><pubDate>Mon, 07 Jul 2008 07:51:56 GMT</pubDate></item><item><title>Frans Bouma commented on Why I don't like FireBird: Part II</title><description>Duh, firebird doesn't have that isolation mode (only some databases do). 
  
  
What I DO find disturbing in your code are:
  
1) a big chunk of code in a lambda. IMHO it's better to write a separate routine for that but alas
  
2) a fetch inside a transaction. Fetches inside transactions are a clue that something is out of order: fetch first, then start transaction. 
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment3</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment3</guid><pubDate>Mon, 07 Jul 2008 07:48:46 GMT</pubDate></item><item><title>Ayende Rahien commented on Why I don't like FireBird: Part II</title><description>That is not the issue, the issue is that there is no transaction isolation maintained
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment2</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment2</guid><pubDate>Mon, 07 Jul 2008 07:25:48 GMT</pubDate></item><item><title>Jelle Hissink commented on Why I don't like FireBird: Part II</title><description>Try 
  
e.Number or e.Errors[0].Number
  
See:
  
http://www.firebirdsql.org/dotnetfirebird/documentation/api/1.7/FirebirdSql.Data.Firebird.FbException.html
</description><link>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment1</link><guid>http://ayende.com/3407/why-i-dont-like-firebird-part-ii#comment1</guid><pubDate>Mon, 07 Jul 2008 06:19:14 GMT</pubDate></item></channel></rss>