[sqlalchemy] ObjectDeletedError: Instance 'xxx' has been deleted

2012-11-16 Thread sajuptpm
The code bellow throwing error ObjectDeletedError: Instance 'xxx' has been deleted. when an exception throwing from method1. How fix this issue. def main_method(): DBSession.add(db_obj1) DBSession.fush() for x in lst: method1(db_obj1.id) def method1(id): try:

[sqlalchemy] Re: ObjectDeletedError: Instance 'xxx' has been deleted

2012-11-16 Thread sajuptpm
The code bellow throwing error ObjectDeletedError: Instance 'xxx' has been deleted. when a exception throwing from method1. Eroor in line method1(db_obj1.id), db_obj1.id failing. How fix this issue. def main_method(): DBSession.add(db_obj1) DBSession.fush() for x in lst:

[sqlalchemy] Zope-SQLAlchemy extension

2012-11-16 Thread Clemens Herschel, III
In a pyramid application: In models.py: DBSession= scoped_session(sessionmaker(extensions=ZopeTransactionExtension())) In view: dbsession = DBSession def add(request): #get implant1 dbsession.add(implant) transaction.commit()

[sqlalchemy] sqlalchemy.exc.DBAPIError: (Error) ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)') None None

2012-11-16 Thread Lukasz Szybalski
Hello, Any idea what this error message means. I'm trying to execute this: s=session.execute(assp_Checks @begin_date=:start, @end_date=:end,@company_id=1,params={'start':date_to_process,'end':date_to_process}).fetchall() I get: Traceback (most recent call last): File stdin, line 1, in module

Re: [sqlalchemy] _DBProxy.dispose() doesn't actually dispose of the pool/connections?

2012-11-16 Thread Carl Meyer
Thanks Michael. On 11/15/2012 08:41 PM, Michael Bayer wrote: that's possible, it's a pretty old, little used, API, and that document probably assumes GC will pick up on it, and it would be better if dispose() was called on the pool all the way through. But the garbage collector should be

[sqlalchemy] Re: Is it possible to define multiple model objects that refer to the same table?

2012-11-16 Thread Rob Crowell
On Nov 15, 10:48 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 15, 2012, at 7:33 PM, Rob Crowell wrote: Sorry, that got cut off at the end. class IssueTag(Base):     __tablename__ = 'issue_user_tag' sqlalchemy.exc.InvalidRequestError: Table 'issue_user_tag' is

Re: [sqlalchemy] Re: Is it possible to define multiple model objects that refer to the same table?

2012-11-16 Thread Michael Bayer
On Nov 16, 2012, at 2:59 PM, Rob Crowell wrote: Thanks for the help so far Michael! I can explain a little more about what I'm trying to do (I'm using a fictional application here but I think it pretty accurately translates into my actual application). BACKGROUND -- Let's

Re: [sqlalchemy] sqlalchemy.exc.DBAPIError: (Error) ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)') None None

2012-11-16 Thread Michael Bayer
On Nov 16, 2012, at 11:44 AM, Lukasz Szybalski wrote: Hello, Any idea what this error message means. I'm trying to execute this: s=session.execute(assp_Checks @begin_date=:start, @end_date=:end,@company_id=1,params={'start':date_to_process,'end':date_to_process}).fetchall() I get:

Re: [sqlalchemy] Re: ObjectDeletedError: Instance 'xxx' has been deleted

2012-11-16 Thread sajuptpm
H, Michael Bayer Thanks You are correct, the rollback in method1 rollbacking transaction in main_method. I want to isolate transaction in main_method from rollback in method1. I attached more code. from sqlalchemy.orm import scoped_session, sessionmaker maker = sessionmaker(autoflush=True,