[sqlalchemy] TPC benchmarks

2007-04-02 Thread Monty Taylor
So I'm working on porting a version of the TPC benchmarks to MySQL. I'm porting some queries by hand when it hit me - SQLAlchemy has already done this work. So I thought, why not implement the TPC benchmarks in SQLAlchemy? Then you would have a benchmark that could be run on all the databases

[sqlalchemy] Many to many optimization

2007-04-02 Thread Kaali
Hi everyone, I'm creating a web service using CherryPy + SQLAlchemy. So far, coding has been a pleasure, but it seems that i have a bit of a performance problem with my software. In short, the service is a messaging system, where users can send, receive and browse messages in different

[sqlalchemy] PYODBC make_connection_string

2007-04-02 Thread El Gringo
Port has to be added to the connection string with pyodbc, the same way as adodbapi and pymssql def make_connect_string(self, keys): connectors = [Driver={SQL Server}] if keys.has_key(port): keys[host] = keys[host] + , + str(keys[port]) del keys[port]

[sqlalchemy] Re: order_by computed on wrong table with many-to-many

2007-04-02 Thread Alexandre CONRAD
Michael Bayer wrote: use 'sites':relation(Site, backref=backref('attachments', order_by=attachment_table.c.name)) for now. Ok, should I open a ticket for that ? On Mar 30, 5:50 am, Alexandre CONRAD [EMAIL PROTECTED] wrote: Hello, I have a problem with order_by on a many-to-many

[sqlalchemy] Re: Many to many optimization

2007-04-02 Thread svilen
After getting the results, i will filter them with Python filters, as i don't know how to filter many-to-many queries directly. Should i somehow make custom queries that handles many-to-many relationships etc. or is there something else i'm missing that makes the system slow? I have ran the

[sqlalchemy] select() got multiple values for keyword argument 'from_obj'

2007-04-02 Thread Jose Soares
Hi all, I'm trying to create the following query using SA: SELECT DISTINCT operatore.id, anagrafica.nome, acl.cod_ruolo FROM operatore JOIN anagrafica ON operatore.id_anagrafica = anagrafica.id LEFT OUTER JOIN acl ON acl.id_operatore = operatore.id LEFT OUTER JOIN ruolo_permesso ON

[sqlalchemy] Re: select() got multiple values for keyword argument 'from_obj'

2007-04-02 Thread Jose Soares
King Simon-NFHD78 ha scritto: Shouldn't acl.cod_ruolo be inside the [] - part of the first parameter to 'select'? The parameters to select are 'columns=None, whereclause=None, from_obj=[], **kwargs', so your 'and_' part is going in as the from_obj parameter, and then you are supplying

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread izekia
Column('content_id', Integer, ForeignKey('contents.id'), primary_key=True, nullable=False)) 'primary_key=True' when you define one already, will work? On Apr 2, 6:44 pm, Julien Cigar [EMAIL PROTECTED] wrote: Hello, I'm playing a bit with Multiple Table Inheritance (the Non-polymorphic way)

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread Julien Cigar
izekia wrote: Column('content_id', Integer, ForeignKey('contents.id'), primary_key=True, nullable=False)) 'primary_key=True' when you define one already, will work? yep, you can have multiple primary_key for one Table() object :) On Apr 2, 6:44 pm, Julien Cigar [EMAIL PROTECTED] wrote:

[sqlalchemy] Re: PYODBC make_connection_string

2007-04-02 Thread Rick Morrison
Each of the three connection mechanisms seem to use a slightly different syntax for specifying the port in the connection string. I believe pymssql and adodbapi are all set at this point. I'll look into pyodbc later today. Rick On 4/2/07, El Gringo [EMAIL PROTECTED] wrote: Port has to be

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread Michael Bayer
defintiely do not call flush() on root_folder, call it for the session overall. thats probably the issue, since its failing to get the full set of child objects properly in the flush. On Apr 2, 2007, at 10:44 AM, Julien Cigar wrote: Hello, I'm playing a bit with Multiple Table

[sqlalchemy] new features in 0.3.6

2007-04-02 Thread Glauco
I'm working over latest version and i appreciate a lot all news... There is a lot of pretty think i'm implementing in our lib.. now some question: ---

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread Julien
OK it was that ! Thanks On Mon, 2007-04-02 at 12:19 -0400, Michael Bayer wrote: defintiely do not call flush() on root_folder, call it for the session overall. thats probably the issue, since its failing to get the full set of child objects properly in the flush. On Apr 2, 2007, at

[sqlalchemy] Database Disconnection Detection

2007-04-02 Thread Greg Copeland
I'm using sqlalcehmy 2.5 with cx_Oracle 4.2.1. What is the proper way to detect an sqlalchemy operation has lost its database connection and reconnection/retry? The manual doesn't seem to say much about the topic. When connection loss occurs, does SA throw the native dbapi exception? If not,

[sqlalchemy] Update Latest News on website?

2007-04-02 Thread Greg Copeland
Perhaps I missed it, but it would be great if you guys would update the Latest News section on the SA homepage when a new release is made available. Greg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Re: Many to many optimization

2007-04-02 Thread Michael Bayer
sqlalchemy relationships are currently only fully loading - meaning you cant directly filter on an instances collection attribute. however you can construct your own query based on the relationship and use that, and theres plenty of tools to make that easy. such as, if you set up a

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Michael Bayer
this feature is not supported right now for most DB's except mysql but is being addressed in a current ongoing ticket and will be available in the next release. however, its possible that some DBAPIs do not raise the error in a manner which can ever be consistently caught; for example

[sqlalchemy] Re: Update Latest News on website?

2007-04-02 Thread Michael Bayer
releases are announced on this mailing list as well as the Python cheeseshop (and all feeds which aggregate it, such as planet python). you can also subscribe to be a watcher on sourceforge where release emails also get sent out. im hesitant to add to the regular news sidebar on the site

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Paul Johnston
Greg, If you can send the traceback you get when such an error occurs, that would be helpful for providing Oracle support for this condition. Paul Greg Copeland wrote: I'm using sqlalcehmy 2.5 with cx_Oracle 4.2.1. What is the proper way to detect an sqlalchemy operation has lost its

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Greg Copeland
On Apr 2, 12:27 pm, Michael Bayer [EMAIL PROTECTED] wrote: this feature is not supported right now for most DB's except mysql but is being addressed in a current ongoing ticket and will be available in the next release. I'm assuming you are talking about autoreconnect here? If so, I would

[sqlalchemy] Re: new features in 0.3.6

2007-04-02 Thread Michael Bayer
heres two examples from the current unit tests: # tables: users = Table('users', metadata, Column('user_id', Integer, Sequence('user_id_seq', optional=True), primary_key = True), Column('user_name', String(40)), ) addresses = Table('email_addresses', metadata,

[sqlalchemy] Concurrency problem

2007-04-02 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello SQLAlchemists, Over in the Mailman project, we've hit a concurrency problem that we don't know how to (properly) fix. Any suggestions you might have would be greatly appreciated. The full thread starts here:

[sqlalchemy] Re: Update Latest News on website?

2007-04-02 Thread Greg Copeland
Well, according to the website, Version 3.0 of SQLAlchemy is the latest exciting release. ;) And that was was October 2006. As is, I have to go to the download page to see if a new release is available. Then I have to download the release to see if any of the features/ fixes interest me. One

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Greg Copeland
Frankly I'm very surprised this class of error has not been previously addressed. I'll have to test and see what happens. I was planning on doing the defensive coding, followed by the testing to make sure it is caught and recovers correctly. Greg On Apr 2, 12:36 pm, Paul Johnston [EMAIL

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Michael Bayer
if you care to view trac, its ticket #516. also, reasons like these are why i keep SA at a relatively low version number (0.3) despite some saying this is underestimating. in any case, as the experience with psycopg2 is illustrating, i am not totally confident the state of DBAPI is going to

[sqlalchemy] Re: Concurrency problem

2007-04-02 Thread Michael Bayer
On Apr 2, 2007, at 1:46 PM, Barry Warsaw wrote: The problem is that if we call session.expire(mlist) /after/ the MailList.__lock attribute gets set, it appears as though SA 'messes' with this attribute. I've proven that if the session.expire() gets called after MailList.Lock(), during the

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Greg Copeland
Please don't take my comment the wrong way. It's actually an off handed compliment. SA seems fairly robust and developmentally strong. As such, it's just surprising that something like error handling doesn't have comprehensive coverage. Now I can certainly understand why, since the DBAPI

[sqlalchemy] Re: Update Latest News on website?

2007-04-02 Thread Michael Bayer
On Apr 2, 2007, at 1:51 PM, Greg Copeland wrote: I must say, it's very strange to go to a product's website to find out I have to go elsewhere to find out the latest skinny... Or that I have to download it to find out if I'm interested in it. The last thing I want is to subscribe to yet

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Michael Bayer
On Apr 2, 2007, at 2:31 PM, Greg Copeland wrote: Okay, so what's SA's take on this problem domain? Applcation executes a query but the database has died between the time the connection was established and the time the query was executed. Does SA attempt to return an SA specific exception

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Greg Copeland
On Apr 2, 12:36 pm, Paul Johnston [EMAIL PROTECTED] wrote: Greg, If you can send the traceback you get when such an error occurs, that would be helpful for providing Oracle support for this condition. Paul I assume this means that the exception is not being caught and wrapped by an

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Michael Bayer
we should probably be wrapping the commit()/rollback() etc methods for DB exceptions as well, currently its just execute() and cursor() AFAIK. On Apr 2, 2007, at 3:41 PM, Greg Copeland wrote: On Apr 2, 12:36 pm, Paul Johnston [EMAIL PROTECTED] wrote: Greg, If you can send the

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Paul Johnston
Hi, I assume this means that the exception is not being caught and wrapped by an SQLAlchemy.exceptions exception? We're going to identify the exception in a database-specific bit of code. cx_Oracle.DatabaseError: ORA-03114: not connected to ORACLE Excellent, that's the snippet I need.

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Greg Copeland
connection, I then pulled my network cable and issued the execute on my connection. Nice. I've been restarting the database server (for MSSQL, MySQL, Postgres) but I wonder if that will yield slightly different results. If you need me to shutdown the database and retry, I can try that

[sqlalchemy] PyInstaller Support

2007-04-02 Thread Greg Copeland
If anyone cares, the next release of PyInstaller has have support for SQLAlchemy. I tested with version 3.5 of SQLAlchemy and 1.3 of PyInstaller. Support has already been checked into the RC system. So look for any release newer than 1.3 of PyInstaller. If you don't already know, PyInstaller

[sqlalchemy] Re: Database Disconnection Detection

2007-04-02 Thread Michael Bayer
our current work with auto-reconnect is checked in to the trunk, including exception catches around rollbacks and commits. so far it does seem to work with postgres, in a rudimental test. the oracle routine is still not checked in. On Apr 2, 2007, at 5:21 PM, Greg Copeland wrote:

[sqlalchemy] Re: PyInstaller Support

2007-04-02 Thread Michael Bayer
thats great. we are going to be checking in some code soon that will look for alternate database modules via pkg_resources...is that supported by PyInstaller also ? On Apr 2, 2007, at 5:32 PM, Greg Copeland wrote: If anyone cares, the next release of PyInstaller has have support for

[sqlalchemy] Re: PyInstaller Support

2007-04-02 Thread Greg Copeland
I hate to say it, but I honestly don't know. I've seen mention of pkg_resources in various blogs and messages but I've never bothered to learn exactly what it is. As such, I can't answer your question. I did some quick googling and found mention that pkg_resource datafiles are known to work.

[sqlalchemy] how to do many-to-many on the same table?

2007-04-02 Thread tml
Hi, I want to make a relation such that.. i have users post some articles.. and can link them as relatd to other articles. I have the Article table like this: articles = Table('articles', metadata, Column('id', Integer, primary_key=True), Column('topic', Unicode(256), nullable=False),