, Alex Brasetvik a...@brasetvik.com wrote:
On Jan 29, 2010, at 15:01 , 一首诗 wrote:
What might cause this kind of problem?
Possibly waiting on locks. Do you have any concurrent transactions
modifying the same data?
When the problem appears, run `select * from pg_stat_activity` to see
fascinating stuff. But your immediate problem is very
likely just a session/connection that you forget to close.)
Regards,
- Gulli
On Jan 30, 4:53 am, 一首诗 newpt...@gmail.com wrote:
Yeah, there might be another transaction modifying the same data
(actually the same line of data in database
Today I met a strange problem with SqlAlchemy and Postgresql. The
code is like this:
def update_user(user_id, sess):
user = sess.query(User).get(user_id).one()
user.last_activity_time = datetime.now()
session.commit() It hangs here forever.
In the code above,
Brasetvik a...@brasetvik.com wrote:
On Jan 29, 2010, at 15:01 , 一首诗 wrote:
What might cause this kind of problem?
Possibly waiting on locks. Do you have any concurrent transactions modifying
the same data?
When the problem appears, run `select * from pg_stat_activity` to see whether
I occasionally got QueuePool limit of size 5 overflow 10 reached.
I don't call session.close() after I don't need them. Because I think
GC will do that.
But now, it seems that I am losting connections somewhere.
Should I call session.close after I use them?
Should I use try.. finally... to
Hi,
Usually, I only use ORM, like pyamf just as an abstraction layer of
database. So these mapping objects I wrote only contains data but not
behavior.
For example, if I have a class User, I would write another class
UserManager which with a methods like addUser, delUser. But recently
I am
-
Hash: SHA1
On 19.03.2009 5:24 Uhr, 一首诗 wrote:
This is my ORM class definition:
#=
class User(Base):
__tablename__ = 'b_taa_user'
user_id = Column(Integer, primary_key=True, autoincrement=True,
nullable=False) # 用户ID
user_name = Column
at 11:46 PM, 一首诗 newpt...@gmail.com wrote:
Hi,
I am trying to pass SqlAlchemy objects to client with XML RPC, but it
seems that that's not very easy.
It depends on what you are trying to do, and what error messages you are
getting, for anyone to help. I am using XML RPC with SQLAlchemy
?
If not, I'd suggest changing everything in it into class methods, so
that way you can call it *without* an instance at all, and don't have
to worry about connecting to the database multiple times by accident.
Just a thought.
-Jeff
On Mar 10, 10:38 am, 一首诗 newpt...@gmail.com wrote:
Hi Jeff
) are decorators for logging
and other types of error handling (like catching IntegrityErros thrown
by duplicates.) I do those things, but I might be a bit OCD :-)
-Jeff
On Mar 7, 1:41 am, 一首诗 newpt...@gmail.com wrote:
Hi, Thanks for your reply. I'm using it the way like you. The only
classes are used everywhere in my application.
On Mar 4, 7:26 pm, 一首诗 newpt...@gmail.com wrote:
Hi, all
I am using sqlalchemy in twisted in my project in the way below.
Defer any database operation so the twisted's main thread won't be
blocked.
And I use scoped_session, so that sessions
Hi all,
I have 2 user instance in a session and after I have update one of it
like this
---
u = session.merge(u)
session.commit
session.refresh(u)
The document says:
Expunge removes an object from the Session, sending persistent
instances to the detached state, and pending instances to the
transient state:
I hoped that if an
.
##
u1 = session.merge(u1)
print --
print u2
session.commit()
print --
print us
##
On Feb 26, 2:17 pm, 一首诗 newpt...@gmail.com wrote:
Hi all,
I have 2 user instance in a session and after I have update
I tried to write :
#
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
fullname = Column(String)
password = Column(String)
sons =
a
'primaryjoin' expression. If this is a many-to-many relation,
'secondaryjoin' is needed as well.
On Feb 16, 5:08 pm, a...@svilendobrev.com wrote:
put it as text, it will be eval()'uated later
On Monday 16 February 2009 10:57:11 一首诗 wrote:
I tried to write
Hi all,
I'm using sqlalchemy as my ORM library and it works fines until today
one of my test case fail
===
sqlalchemy.exc.ProgrammingError: (ProgrammingError) You must not use
8-
bit bytestrings unless you use a text_factory that can interpret
Hi all,
I'm using sqlalchemy as my ORM library and it works fines until today
one of my test case fail
===
sqlalchemy.exc.ProgrammingError: (ProgrammingError) You must not use 8-
bit bytestrings unless you use a text_factory that can interpret
18 matches
Mail list logo