You don't say whether you commit the transaction on the first thread or not. And whether that makes a difference to the behavior you see
I suspect you are deadlocking in the db. I don't have any personal experience with that db but have heard of some apps using it that had to set the isolation level to read uncommitted to avoid deadlock. I think they make liberal use of table or page locks at higher isolation levels.