[sqlalchemy] Re: howto Sqlalchemy atomic transaction ??

2011-11-21 Thread sajuptpm
Model class VDCTemplates(DeclarativeBase): __tablename__='cd_vdc_templates' id = Column(Unicode(50), primary_key=True) vdc_id=Column(Unicode(50), ForeignKey('cd_vdc.id', ondelete=CASCADE)) template_id=Column(Unicode(50), ForeignKey('cd_account_templates.id',

Re: [sqlalchemy] Re: howto Sqlalchemy atomic transaction ??

2011-11-21 Thread Robert Forkel
DBSession.flush() after the DBSession.add call might be enough. On Mon, Nov 21, 2011 at 12:48 PM, sajuptpm sajup...@gmail.com wrote: Model class VDCTemplates(DeclarativeBase):    __tablename__='cd_vdc_templates'    id = Column(Unicode(50), primary_key=True)    

Re: [sqlalchemy] Re: partial rollback in transaction ?

2011-01-11 Thread Michael Bayer
On Jan 10, 2011, at 6:09 PM, Romy wrote: Not sure what you mean, as I've seen hybrid setups before. I'm pretty sure if you try to make a foreign key from an InnoDB table to a MyISAM table, it will fail. In any case, thanks for helping me narrow this down. I need to decide whether I'll

Re: [sqlalchemy] Re: partial rollback in transaction ?

2011-01-10 Thread Michael Bayer
One important change here is to change the engine type to InnoDB, otherwise transactions are entirely meaningless with MySQL. If I use InnoDB, the end result of used is 0 in all cases. If I don't and use MyISAM, the end result of used is 1 in all cases, regardless of whether InviteCode is

[sqlalchemy] Re: partial rollback in transaction ?

2011-01-10 Thread Romy
Face palm.. missed the forest for the trees. Does this mean both tables would need to be InnoDB ? On Jan 10, 7:10 am, Michael Bayer mike...@zzzcomputing.com wrote: One important change here is to change the engine type to InnoDB, otherwise transactions are entirely meaningless with MySQL.

Re: [sqlalchemy] Re: partial rollback in transaction ?

2011-01-10 Thread Michael Bayer
yah MySQL doesn't really operate with a mixture. On Jan 10, 2011, at 4:13 PM, Romy wrote: Face palm.. missed the forest for the trees. Does this mean both tables would need to be InnoDB ? On Jan 10, 7:10 am, Michael Bayer mike...@zzzcomputing.com wrote: One important change here is to

[sqlalchemy] Re: partial rollback in transaction ?

2011-01-10 Thread Romy
Not sure what you mean, as I've seen hybrid setups before. In any case, thanks for helping me narrow this down. I need to decide whether I'll need real transactions here. Despite being an oversight on my part, do you think perhaps the docs for rollback / commit should mention DB support ? I did

Re: [sqlalchemy] Re: partial rollback in transaction ?

2011-01-09 Thread Michael Bayer
yeah there's not really enough detail here to produce an explanation, you'd need to narrow it down into a self-contained test case. On Jan 9, 2011, at 1:45 AM, Romy wrote: I believe it's both mapped and present in the session -- the log output seems to confirm it: [I 110108 22:40:30

[sqlalchemy] Re: partial rollback in transaction ?

2011-01-09 Thread Romy
Okay. In assembling a test case I've noticed the following behavior. When the mapped object is created before the begin(), the bug is reproducible. When it's created after the begin(), the rollback happens correctly and the 'bug' disappears. Specifically: invite_code =

Re: [sqlalchemy] Re: partial rollback in transaction ?

2011-01-09 Thread Michael Bayer
On Jan 9, 2011, at 4:26 PM, Romy wrote: Okay. In assembling a test case I've noticed the following behavior. When the mapped object is created before the begin(), the bug is reproducible. When it's created after the begin(), the rollback happens correctly and the 'bug' disappears.

Re: [sqlalchemy] Re: partial rollback in transaction ?

2011-01-09 Thread Michael Bayer
I don't really understand that test since its calling first() on a nonexistent InviteCode (the table is empty), and seems to be testing something about an IntegrityError on a completely different table so I can't really see what it is you're trying to achieve. Below is a test case that

[sqlalchemy] Re: partial rollback in transaction ?

2011-01-09 Thread Romy
Sorry Michael, 'self-contained' wasn't a proper term for that test given that it required an initial DB state containing a single row. I've modified your version to try and reproduce the bug. Since yours didn't use elixir at all and I'm not familiar with elixir's internals, I was able to

[sqlalchemy] Re: Test and rollback transaction

2009-02-01 Thread Michael Bayer
somethings up with sphinxI rebuilt the docs locally since its not working on the server for some reason. doc is here: http://www.sqlalchemy.org/docs/05/reference/orm/sessions.html?highlight=active%20transaction#sqlalchemy.orm.session.Session.is_active On Feb 1, 2009, at 1:36 PM,

[sqlalchemy] Re: Is this a transaction?

2008-10-15 Thread Wayne Witzel
On Oct 15, 11:37 am, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Quick question I hope guys. If I have an object which contains a bunch of children and cascade is set on the relationships. When I add the parent object to the session and commit it, are the children saved as part of a

[sqlalchemy] Re: ProgrammingError: (ProgrammingError) current transaction is aborted, commands ignored until end of transaction block

2008-06-27 Thread Michael Bayer
On Jun 27, 2008, at 4:03 PM, Matt Haggard wrote: I'm getting a ProgrammingError (I've pasted the last part of the traceback at the bottom of the page). The error comes from my first heavy-AJAX page in Pylons (postgres backend). If I cause too many AJAX requests at a time, or even after

[sqlalchemy] Re: ProgrammingError: (ProgrammingError) current transaction is aborted, commands ignored until end of transaction block

2008-06-27 Thread Matt Haggard
INSERT or UPDATE? I don't do any inserts with this code... only changing what's already there. Is an integrity constraint a PG thing, or SQLAlchemy model thing? And can I do Session.rollback() ? Thanks! On Jun 27, 2:19 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Jun 27, 2008, at 4:03 PM,

[sqlalchemy] Re: ProgrammingError: (ProgrammingError) current transaction is aborted, commands ignored until end of transaction block

2008-06-27 Thread Matt Haggard
I've fixed it by calling Session.clear() at the end of every controller action (it's in __after__()). I'm gonna go read about what that does -- right now it's just magic as far as I can tell :) Thanks again for the help, Michael On Jun 27, 3:30 pm, Michael Bayer [EMAIL PROTECTED] wrote: On

[sqlalchemy] Re: problems with session transaction in SQLAlchemy 0.4

2007-11-15 Thread Manlio Perillo
Michael Bayer ha scritto: On Nov 7, 2007, at 4:26 PM, Manlio Perillo wrote: I would like this interface to be public, so I can implement it for the Engine class in nadbapi. ok, its public, rev 3751. Great, thanks. What about _execute_compiled :-)? I have just implemented these

[sqlalchemy] Re: problems with session transaction in SQLAlchemy 0.4

2007-11-07 Thread Michael Bayer
I gleaned from your stack trace that youre using strategy=threadlocal (full test cases are much more helpful). anyway, its a bug, fixed in r3748. On Nov 7, 2007, at 9:22 AM, Manlio Perillo wrote: Hi. I'm trying to add support to SQLALchemy 0.4 in nadbapi:

[sqlalchemy] Re: problems with session transaction in SQLAlchemy 0.4

2007-11-07 Thread Manlio Perillo
Michael Bayer ha scritto: I gleaned from your stack trace that youre using strategy=threadlocal (full test cases are much more helpful). anyway, its a bug, fixed in r3748. Thanks, now finally nadbapi works with SQLAlchemy 0.4. Sorry for not having provided full test cases, I was

[sqlalchemy] Re: problems with session transaction in SQLAlchemy 0.4

2007-11-07 Thread Michael Bayer
On Nov 7, 2007, at 3:06 PM, Manlio Perillo wrote: Michael Bayer ha scritto: I gleaned from your stack trace that youre using strategy=threadlocal (full test cases are much more helpful). anyway, its a bug, fixed in r3748. Thanks, now finally nadbapi works with SQLAlchemy 0.4. Sorry

[sqlalchemy] Re: problems with session transaction in SQLAlchemy 0.4

2007-11-07 Thread Manlio Perillo
Michael Bayer ha scritto: [...] One last thing. With SQLAlchemy 0.3.x, my Engine class can be used to execute implicit queries. Now with 0.4.x this does not works, since the engine should implement additionals methods: statement_compiler and _execute_clauseelement. What's the

[sqlalchemy] Re: problems with session transaction in SQLAlchemy 0.4

2007-11-07 Thread Michael Bayer
On Nov 7, 2007, at 4:26 PM, Manlio Perillo wrote: I would like this interface to be public, so I can implement it for the Engine class in nadbapi. ok, its public, rev 3751. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the