you might want to use a SELECT....FOR UPDATE so that the selected rows
are locked for the duration of that transaction.


On Oct 6, 2:19 pm, coder_gus <[EMAIL PROTECTED]> wrote:
> Hi, I am writing an application server using twisted and sqlalchemy.
>
> On the server - database relation I use a pool of threads each with its
> own database connection, session etc.
>
> The problem is that I have 2 tables (one with products and one with
> events that might happen to a product) and I think I might have
> concurrency problems with them (i.e: when selecting a chunk of 50
> products from the first table, I need to know for certain that another
> thread is not inserting the same event in the second table as I am doing
> with the already selected chunk from the first table).
>
> I am using a transactional, autoflushing session. I was thinking about
> table locking but, it doesn't seem like a good option.
>
> Any advices?
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to