Thanks. This occurs on create/insert so I would probably remove all primary
keys. Is there a reason why a handler would work better here? I’d prefer to
keep my logic central and avoid callbacks if possible.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
I think my issue is that before the commit/rollback
Alice.id is None but after Alice.id is set to some integer. I understand the
object is transient but I wish that the primary key field was not modified in
this way because if I want to try to reinsert Alice in a new transaction I have
to write
I've noticed that if a transaction fails midway through, objects that
already have been inserted will have their primary keys set, even after
rolling back.
Partial snippet below:
-
class User(Base):
id = Column(Integer, primary_key=True)
name = Column(String(80), unique=True,
Hi Mike,
Thanks very much for the response and the clear explanation, and the link.
All of that was very helpful to me, and I'm made some changes to my code
accordingly. I am using Flask-SQLAlchemy by the way, so what you wrote
makes even more sense in that context.
Doug
On Thursday
in the right
direction, give me some suggestions or references about what I'm missing.
Thanks,
Doug
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example
On Fri, Dec 14, 2012 at 1:11 PM, Michael Bayer mike...@zzzcomputing.comwrote:
Hi list -
SQLAlchemy 0.8.0b2 is released. This is hopefully the last beta for 0.8,
as things have been mostly quiet surrounding 0.8.0b1, we had a few
regressions fixed, and a bunch of other new bugs whose fixes
in the morning
would typically fail because the connection had been dropped
overnight. I set pool_recycle to 3600 (seconds) and had no more
dropped connection problems.
As with all app tuning issues, YMMV...
Doug
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group
).
Thanks,
Doug
On Tue, Jun 28, 2011 at 12:39 PM, Michael Bayer mike...@zzzcomputing.comwrote:
On Jun 28, 2011, at 2:55 PM, Alexandre Conrad wrote:
I must have it wrong, I admit I don't quite understand the arguments
of .with_hint()
session.query(User).with_hint(User, 'WITH (nolock)').get(1
with SQLite and didn't encounter this error. I also don't
run into this error if I serve the application using paster.
Thanks for any help,
Doug
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
Seems like it is an Apache problem. This error occurred on Apache
2.2.13 but not on a system with 2.2.19.
On Jun 8, 1:57 pm, doug holt doug.h...@gmail.com wrote:
Hi,
I'm getting a strange error in sqlalchemy/engine/base.py when I try to
use a mysql table with more than 6 columns and serve
=category_association.c.ParentCategoryID ==
BankCategories.ID,
backref='children')
This does not work and I get the following error:
File '/home/doug/pyenv_svn/CreateService/surveyservice/surveyservice/
controllers/error.py', line 25 in document
cat.parents
File
,
backref='children')
Which works just dandy.
Thanks again,
Doug
On Mar 3, 3:07 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Mar 3, 2011, at 5:11 PM, Doug wrote:
Hello all,
I've just started using SQLAlchemy recently (and it's been great) but
I have run into a problem
unsubscribe
--~--~-~--~~~---~--~~
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
Michael,
Congratulations on the release! I look forward to giving it a spin!
Doug
--~--~-~--~~~---~--~~
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
@googlegroups.com
Subject: [sqlalchemy] Re: New instance ExtraStat with identity key
(...) conflicts with persistent instance ExtraStat
I keep thinking one of my relatives has emailed me when you post here
and I get all excited. Any chance you can change your name ? :-)
2008/12/2 Doug Farrell [EMAIL
Michael,
Thanks for the pointer, that makes great sense, and once again points
how my generally small database design skills. I'll update my code to
try this out.
Again,
Thanks!
Doug
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Michael Bayer
Sent: Saturday
: New instance ExtraStat with identity key
(...) conflicts with persistent instance ExtraStat
What was your justification of changing the name of my thread to a
completely different topic instead of starting a new thread?
I don't think thats good etiquette.
On Nov 29, 5:22 am, Doug
:
Sqlalchemy.orm.exc.FlushError: New instance [EMAIL PROTECTED] With identity
key (class '__main__.ExtraStat',(u'C',)) conflicts with persistent
instance [EMAIL PROTECTED]
Thanks!
Doug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
with persistent
instance [EMAIL PROTECTED]
Thanks!
Doug
--~--~-~--~~~---~--~~
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
and that I'm not missing
something. I'm guessing the Session having a strong reference keeps the
object alive even though I delete it from the list.
Again, thanks!
Doug
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Michael Bayer
Sent: Tuesday, October
where I create
the engine and the first session object. All other modules reference
this module to create their own session objects. By the way, with
locally scoped session variables should I do a session.close() or not?
Thanks,
Doug
-Original Message-
From: sqlalchemy@googlegroups.com
the traceback of the exception I'm
getting. Any help would be appreciated.
Thanks, Doug
2008-10-27 18:15:54 srsmanager ERRORunexpected error, restarting:
Traceback (most recent call last):
File c:\cygwin\home\ripadmin\dev\srsmanager\srsprocess.py, line 154,
in runjobs isActive = self
these exceptions:
Can't attach instance [EMAIL PROTECTED]; another instance with key (, (220,))
is already present in this session.
What is this trying to tell me? Does this mean that a newly created job is
trying to use the primary key of an already existing job?
Thanks in advance for your help!
Doug
the results I want from the MySQL command line against the
existing tables in the database, but I can't figure out how to construct
an equivalent SqlAlchemy version to do the same thing passing in 'A' as
the paramter.
I know I'm being dense about this, thanks in advance for the help,
Doug
on your further, how can I get the 'type' field that is
defined as a column in the press_routing_press linking table that goes
with everyting that comes back with PressRouting.code=='A' ?
Again, thanks for your help and patience, I've been using Python for
awhile, but I'm a DB novice...
Doug
about using the Association Object,
but haven't figured it out yet. I've gotten back lots of data, just not
the limited set I'm looking fore.
Thanks,
Doug
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Michael Bayer
Sent: Friday, September 26, 2008 4:10 PM
Michael,
After some tweaking around, it works! Thanks for all your help, it was
invaluable! I'm sure I'll be back for more though... J
Doug
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Michael Bayer
Sent: Friday, September 26, 2008 5:50 PM
To: sqlalchemy
really appreciate your attention
to my issues!
Thanks again,
Doug
--~--~-~--~~~---~--~~
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
against the
existing tables in the database, but I can't figure out how to construct
an equivalent SqlAlchemy version to do the same thing passing in 'A' as
the paramter.
I know I'm being dense about this, thanks in advance for the help,
Doug
--~--~-~--~~~---~--~~
You
exceptions. From
what I've read the above code looks closest to something that should
work based on what I've seen others posting.
Any help and/or guidance would be appreciated, thanks!
Doug
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Michael,
Thanks for the response and help, I made the change and the class is
populated, this is great!
Again, thanks for your help,
Doug
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Michael Bayer
Sent: Sunday, September 21, 2008 10:41
Mapper|MyTable|mytable could not
assemble any primary key columns for mapped table 'mytable'
What is this error message trying to tell me?
Thanks in advance,
Doug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
With some help from Ned Batchelder I was able to confirm that this is
a Python bug: http://bugs.python.org/issue1569356 that has been fixed
since the 2.5.2 release. Ned confirmed that the fix is included in
Python 2.6a3.
Doug
On Sep 16, 5:22 pm, Doug Latornell [EMAIL PROTECTED] wrote:
Thanks
a page about eager loading. However, it was interesting reading all
the same!
Thanks again,
Doug
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Empty
Sent: Wednesday, September 17, 2008 9:02 AM
To: sqlalchemy@googlegroups.com
Subject
, or with coverage not understanding what that
metaclass produces, or something. Or is there something else I'm
missing?
Doug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send
Thanks for the quick replies, Jason and Michael, and for the very
succinct test case. I will try to raise this with Ned Bachelor over
at http://nedbatchelder.com/code/modules/coverage.html
Doug
On Sep 16, 4:55 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Sep 16, 2008, at 7:25 PM, Doug
36 matches
Mail list logo