473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Locking tables with SQLAlchemy

6
Hi,
I need to lock a table for WRITE.
The scenario is that I have a SELECT followed by an INSERT, where the INSERT depends on the outcome of the SELECT. I have to make sure that no other process is modifying the table after my SELECT but before my INSERT.

1) How do i do it via SQLAlchemy ?
2) Is there any other method (not via locks) to achieve my goal?

TIA
Jun 29 '07 #1
3 6097
bartonc
6,596 Expert 4TB
Hi,
I need to lock a table for WRITE.
The scenario is that I have a SELECT followed by an INSERT, where the INSERT depends on the outcome of the SELECT. I have to make sure that no other process is modifying the table after my SELECT but before my INSERT.

1) How do i do it via SQLAlchemy ?
2) Is there any other method (not via locks) to achieve my goal?

TIA
SQLAlchemy looks like a very interesting and well put-together package.
I curious about what the actual database that you are using is. Am I correct in assuming that SQLAlchemy will connect to an installed database?
Jun 29 '07 #2
mcmc
6
I am using MySQL.
I did not understand the 2nd question.
Jun 30 '07 #3
bartonc
6,596 Expert 4TB
I am using MySQL.
I did not understand the 2nd question.
That answers my question and helps a lot. I'm going to check out this SA thing and see if will be appropriate for my projects. Then, perhaps, we'll be able to help each other.

It looks like a very useful tool.
Jun 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: john smile | last post by:
Hi All, I want to lock 2 tables on 2 servers using TABLOCKX hint. These tables function as semaphores in my application. It means when the tables are locked then other users will not be able to...
5
by: Chris Brat | last post by:
Hi, Is it possible to retrieve details about the database, specifically a list of the tables in the database; and then to retrieve the columns and their types for the tables? Is this...
20
by: John Salerno | last post by:
Are there any major differences between these two? It seems they can both be used with TurboGears, and SQLAlchemy with Django. I'm just wondering what everyone's preference is, and why, and if...
1
by: Karlo Lozovina | last post by:
I've installed SQLAlchemy under Windows (strangely, it didn't install inside ../site-packages/ as a directory, but rather as a SQLAlchemy-0.2.8-py2.4.egg file). I can import it with 'import...
0
by: Karlo Lozovina | last post by:
I've just upgraded to Python 2.5, SQLAlchemy 0.3.3, and py2exe 0.6.5 (the py2.5 version, yes). Simple: --- import sqlalchemy print 'Test' ---
6
by: Ilias Lazaridis | last post by:
- Ï/Ç metaperl: Ilias Lazaridis: Michael Bayer wrote within: http://groups.google.com/group/sqlalchemy/msg/9d7a096a61abfc6f I understand your elaborations.
1
by: gooli | last post by:
I have a class with a lot of attributes whose objects are accessed from multiple threads. I would like to synchronize the access to all the attributes, i.e. acquire a lock, return the value,...
3
by: Greg Copeland | last post by:
I'm using SQLAlchemy and have a need to call an Oracle function; which is not the same as a stored procedure. Can this be done directory or indirectly with SQLAlchemy? If so, can someone please...
2
by: Adam Kubica | last post by:
Hello. I have pylons 0.96 (SVN) and current SQLAlchemy (0.3.10), and I have bug that doesn't exist earlier. My connection code: <code> import sqlalchemy.mods.threadlocal from sqlalchemy...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.