Hello,

I wanted an in-depth understanding of what goes on in connection
management in sqlalchemy.  I want to use sqlalchemy for it's
connection management but I'm planning on building my own custom orm.
I just can't deal with assign_mapper and the stuff that goes on
underneath the covers.  I've been bitten way too many times and it's
really sucking time out of development.  I do want to use sqlalchemy
for connection management.  I'm using pylons as my framework and am
hoping to get rid of sqlalchemy sessions etc..

I want to do the following and wanted advice on whether this makes
sense:

I want to use MetaData() to return an object passed in it is the db
uri.  I want the connection object returned back to me from the meta.

meta = MetaData(db_uri)

#getting the connection object
conn = meta.connect  <-- is this correct

Now, I want to start a transaction and then commit or rollback upon
exception using the connection object versus using
session.create_transaction.

Would this work?  Does calling meta = MetaData(db_uri) in the module
make it so that we don't end up calling create_engine multiple times
and creating connections multiple times?  Will connection management
be handled for me?  Am I getting the connection object in the right
way?

What if I were to do the following in my module:

engine = create_engine(...)
connection = engine.conn....
connection.create_trans...

connection.close()

Would this create a new connection everytime, or would it fetch it
from the connection pool since these are more like dbapi than
sqlalchemy.

Could somebody please help me understand all of this?

Much appreciated,

Sam


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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