Re: [sqlalchemy] lockmode

2010-07-19 Thread Michael Mileusnich
Thank you again for the prompt response. On Mon, Jul 19, 2010 at 8:46 AM, Michael Bayer wrote: > > On Jul 19, 2010, at 12:35 AM, Michael Mileusnich wrote: > > It's just a basic select statement I do not see any other parms. > > > SQL Server doesn't support "FO

Re: [sqlalchemy] lockmode

2010-07-18 Thread Michael Mileusnich
It's just a basic select statement I do not see any other parms. Thanks Michael Mileusnich On Sun, Jul 18, 2010 at 5:05 PM, Michael Bayer wrote: > What does your SQL output say? Do you see "FOR UPDATE" in the log? > > Sent from my iPhone > > > On Jul 17, 201

[sqlalchemy] lockmode

2010-07-17 Thread Michael Mileusnich
Hello, I am running Python 2.6 SQL Alchemy 0.5.8 against MS SQL Server Express 2008 with pyODBC. When I issue something like: sess.query(job).with_lockmode("update") It does not seem to be locking according to the query I am getting back from my profiler. Is this the correct usage? Thanks Mik

Re: [sqlalchemy] list filter

2010-04-23 Thread Michael Mileusnich
Hello, I believe this is what you are looking for: .filter(obj.in([1, 2, 3])) On Fri, Apr 23, 2010 at 9:33 AM, Alexander Zhabotinskiy < a.zhabotins...@gmail.com> wrote: > Hello. > > How to filter by list > may be like: > > .filter(Some.value==[1,2,3]) > > -- > You received this message because

[sqlalchemy] Before I send

2010-04-01 Thread Michael Mileusnich
Hello, I know there is documentation on this but I am still fuzzy on certain practices when using the session. In my application I have a function that returns a new non scoped session. In one method (method a) I get object o from this session. I call another method (method b) that needs to use

[sqlalchemy] Re: Threading

2009-09-11 Thread Michael Mileusnich
looking? On Thu, Sep 10, 2009 at 11:10 AM, Michael Bayer wrote: > > Michael Mileusnich wrote: > > I have a db file with a function called getsession() that returns my > > Session > > which has been established to = a scoped session. The odd thing is it > > works >

[sqlalchemy] Re: Threading

2009-09-10 Thread Michael Mileusnich
chael Mileusnich On Thu, Sep 10, 2009 at 10:10 AM, Michael Bayer wrote: > > Michael Mileusnich wrote: > > I have switched my application to use the Python multiprocessor threading > > instead if the default python gil threading. I seem to be running into > > issues. I am using

[sqlalchemy] Threading

2009-09-10 Thread Michael Mileusnich
I have switched my application to use the Python multiprocessor threading instead if the default python gil threading. I seem to be running into issues. I am using scoped sessions and in my run() function, when I try to do sess = getsession() to grab the session sql alchemy throws a large number

[sqlalchemy] cascades and mappers

2009-07-07 Thread Michael Mileusnich
To get foreign keys in my python app I am doing the following: ForeignKeyConstraint(['USERID'], ['USERS.USERID'], ondelete="CASCADE") and my mappers are nothing more than mapper(class, table). Is there anything wrong with not defining the relation in the mapper as well? Also, is there a way for

[sqlalchemy] session flush

2009-06-17 Thread Michael Mileusnich
I know I have asked this before but I would like some clarification. If I do something like : i = query(table).all for instance in i: thread_class(i.ID) thread_class.start() del thread_class and do an additional query in the init of the thread_class to pull up the entire record for i using the

[sqlalchemy] Session is already flushing

2009-06-05 Thread Michael Mileusnich
I am using a scoped session in my sql alchemy app. Can anybody help me with what this error means: Session is already flushing _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now"5 --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: pyodbc issues

2009-04-27 Thread Michael Mileusnich
I will try to come up with a test case later this week. On Mon, Apr 27, 2009 at 10:42 PM, mtrier wrote: > > On Apr 27, 9:10 pm, Michael Mileusnich wrote: > > Id like to thank you for all your help however is my solution adequate to > > use in that I perform a metadata.c

[sqlalchemy] Re: pyodbc issues

2009-04-27 Thread Michael Mileusnich
Id like to thank you for all your help however is my solution adequate to use in that I perform a metadata.create_all() in the function in my db.py python file that returns the session? On Mon, Apr 27, 2009 at 8:07 PM, Michael Mileusnich wrote: > > > On Mon, Apr 27, 2009 at 6:08 PM

[sqlalchemy] Re: pyodbc issues

2009-04-27 Thread Michael Mileusnich
conn: pass > >> > >> Not sure this is related though (or if this is a good solution), just > >> thought I'd let it know in case it helps. > >> > >> greetings, > >> > >> Steven > >> > >> > >> > >>

[sqlalchemy] Re: pyodbc issues

2009-04-25 Thread Michael Mileusnich
I added the metadata.create_all() to me function that returns the session and everything seems to insert...I thought the metadata.create_all was only used to create the tables? On Sat, Apr 25, 2009 at 8:05 AM, Michael Trier wrote: > > On Apr 24, 2009, at 7:50 PM, Michael Mileusnich &

[sqlalchemy] Re: pyodbc issues

2009-04-24 Thread Michael Mileusnich
Wow..your example worked for me. Could the kwargs the issue? On Fri, Apr 24, 2009 at 3:14 PM, mtrier wrote: > > > > On Apr 24, 2009, at 4:02 AM, Michael Mileusnich wrote: > > > > > I have formated my PC with Vista 32. I also Installed SQL Server 2008 > > >

[sqlalchemy] Re: pyodbc issues

2009-04-24 Thread Michael Mileusnich
Mine code looks the same except for: def __init__(self, **kwargs): for my ACTIONS. Should I try emailing pyodbc about this issue? On Fri, Apr 24, 2009 at 3:14 PM, mtrier wrote: > > > > On Apr 24, 2009, at 4:02 AM, Michael Mileusnich wrote: > > > > > I have forma

[sqlalchemy] Re: pyodbc issues

2009-04-24 Thread Michael Mileusnich
yes On Fri, Apr 24, 2009 at 8:47 AM, Michael Bayer wrote: > > On Apr 24, 2009, at 4:02 AM, Michael Mileusnich wrote: > > I have formated my PC with Vista 32. I also Installed SQL Server 2008 > Express. Installed Python 2.6 and pyodbc...SAME ISSUE. I would be willing >

[sqlalchemy] Re: pyodbc issues

2009-04-24 Thread Michael Mileusnich
ry to test it myself tonight. >> >> Sent from mobile >> >> On Apr 20, 2009, at 10:45 PM, Michael Mileusnich >> wrote: >> >> Any update on this? >> >> On Fri, Apr 17, 2009 at 6:07 PM, Michael Mileusnich < >> justmike2...@gmail.com> w

[sqlalchemy] Re: pyodbc issues

2009-04-21 Thread Michael Mileusnich
about that table. then I run a file which makes a server object, adds to session, flush... On Tue, Apr 21, 2009 at 10:42 AM, Michael Trier wrote: > The trace looks fine to me. I'll try to test it myself tonight. > > Sent from mobile > > On Apr 20, 2009, at 10:45 PM, Michael

[sqlalchemy] Re: pyodbc issues

2009-04-20 Thread Michael Mileusnich
Any update on this? On Fri, Apr 17, 2009 at 6:07 PM, Michael Mileusnich wrote: > Actually I made a mistake in running some of these py files manually. The > tables exist now and this is what I receive: > > 2009-04-17 19:04:59,780 INFO sqlalchemy.engine.base.Engine.0x...1230 () >

[sqlalchemy] Re: pyodbc issues

2009-04-17 Thread Michael Mileusnich
> tables? > > Sent from mobile > > On Apr 17, 2009, at 7:31 PM, Michael Mileusnich > wrote: > > C:\Dev\pysched>python createservers.py > > D:\Python26\lib\site-packages\sqlalchemy-0.5.3-py2.6.egg\sqlalchemy\databases\ms > sql.py:977: DeprecationWarning: object.__new_

[sqlalchemy] Re: pyodbc issues

2009-04-17 Thread Michael Mileusnich
?, ?, ?, ?, ?, ?, ?, ?)' ['agent1', '192.168.0.100', 2000, 0, None, 1, 1, 1 , 1, 0] C:\Dev\pysched> On Fri, Apr 17, 2009 at 5:05 PM, Michael Trier wrote: > > On Apr 17, 2009, at 5:46 PM, Michael Mileusnich > wrote: > > First, thanks for being patien

[sqlalchemy] Re: pyodbc issues

2009-04-17 Thread Michael Mileusnich
les here ... etc mapper(action, action_table) here is my create: new_action = action(ACTIONID = '500', CMDLINE = 'sol') session.add(new_action) session.flush() also how do I turn on echo? On Fri, Apr 17, 2009 at 3:24 PM, Michael Trier wrote: > On Fri, Apr 17, 2009 at 2:01 AM, M

[sqlalchemy] Re: pyodbc issues

2009-04-17 Thread Michael Mileusnich
I add my object to the session and flush. No insert happens. Works fine with SQL-LIte. I have have tried adding a commit also but that does not help. On Fri, Apr 17, 2009 at 10:02 AM, Michael Bayer wrote: > > > can you be more specific what "will not insert" means. >

[sqlalchemy] Re: pyodbc issues

2009-04-17 Thread Michael Mileusnich
I do not recall having installed FreeTDS. On Fri, Apr 17, 2009 at 9:56 AM, Michael Bayer wrote: > > > are you using FreeTDS ? there's a known issue with FreeTDS and SQLA 0.5. > > > Michael Mileusnich wrote: > > I am still having issues with pyodbc on Python 2.6. >

[sqlalchemy] pyodbc issues

2009-04-16 Thread Michael Mileusnich
I am still having issues with pyodbc on Python 2.6. Platform: Windows XP SP3 32 bit Python 2.6 SQLAlchemy 0.5.3 pyodbc 2.1.3 When I use SQL-Lite, my tables are created and all my data is inserted. When I use MS SQL, the tables get created but my data will not insert. Here is my session: Session

[sqlalchemy] Re: SA and python 26

2009-04-05 Thread Michael Mileusnich
e: > On Sun, Apr 5, 2009 at 9:46 PM, Michael Bayer wrote: > >> and i would also suggest investigating if the DBAPI you're using is >> somehow different than the one you've used with 2.5, or unsupported on >> py2.6. >> >> On Apr 5, 2009, at 7:59 PM, Michae

[sqlalchemy] Re: SA and python 26

2009-04-05 Thread Michael Mileusnich
be no > difference in behavior between py2.5 and 2.6. The code you have below > may not necessarily create any data if you didn't commit your > transaction. > > On Apr 5, 2009, at 6:05 PM, Michael Mileusnich wrote: > > > I have been working with Python 2.5 and SQLAlchemy. I rec

[sqlalchemy] SA and python 26

2009-04-05 Thread Michael Mileusnich
I have been working with Python 2.5 and SQLAlchemy. I recently upgraded to Python 2.6 on my Windows machine and I receive the following message: D:\Python26\lib\site-packages\sqlalchemy-0.5.3-py2.6.egg\sqlalchemy\databases\ms sql.py:977: DeprecationWarning: object.__new__() takes no parameters

[sqlalchemy] Re: POSTGRE Error with scoped sessions.

2009-01-07 Thread Michael Mileusnich
ithout a lot more context. > > On Jan 7, 2009, at 8:17 PM, Michael Mileusnich wrote: > > Hello, I am writing some code using SQLAlchemy and have been testing that > code against a number of databases. Everything seems to work except in > POSTGRE. This is a threaded app and I use a sco

[sqlalchemy] POSTGRE Error with scoped sessions.

2009-01-07 Thread Michael Mileusnich
Hello, I am writing some code using SQLAlchemy and have been testing that code against a number of databases. Everything seems to work except in POSTGRE. This is a threaded app and I use a scoped session. When the app spawns under ~20 threads everything seems cool but when the app spawns more th

[sqlalchemy] Re: cascade

2008-12-23 Thread Michael Mileusnich
de does not > work, are two different issues. Which are you experiencing, and if the > latter, how is the issue manifesting itself ? Can you produce sample code > which reproduces your issue ? > > > > On Dec 23, 2008, at 10:19 PM, Michael Mileusnich wrote: > >

[sqlalchemy] Re: cascade

2008-12-23 Thread Michael Mileusnich
Yea I do the ondelete and onupdate in ForeignKey, creates tables and all but does not do the cascade or at least not in MSSQL. On Tue, Dec 23, 2008 at 7:42 PM, justmike2...@gmail.com < justmike2...@gmail.com> wrote: > > I seem to be running into a problem with implementing cascades in > sqlalch.

[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Mileusnich
I will try that. I appreciate your help. Thanks! On Tue, Dec 23, 2008 at 12:40 PM, Michael Bayer wrote: > > > On Dec 23, 2008, at 1:29 PM, Michael Mileusnich wrote: > > > I have a py file that creates my tables. It does MetaData = > > queue.metadata. metadata.create

[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Mileusnich
present in the MetaData when > used. Ultimately your application can't run unless both "queue" and > "filequeue" have been imported in some way. > > > On Dec 23, 2008, at 1:21 PM, Michael Mileusnich wrote: > > I am not sure based on the project if I can

[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Mileusnich
I am not sure based on the project if I can have a module that imports both of them. How can I use the string based ForeignKey? I may be doing it in correctly because it says the table does not exist that I try to reference. On Tue, Dec 23, 2008 at 12:18 PM, Michael Bayer wrote: > > ForeignKey