I'm looking for a way to have my DB replicated in REAL TIME to be used
in case I lose my primary copy.
I saw that the two phase commit exist but I'm not sure if that is the
correct option. I have the feeling that it would be abusing a
mechanism purposed for correlating to separate DBs and not
On May 6, 9:07 am, Vic vctr...@gmail.com wrote:
I'm looking for a way to have my DB replicated in REAL TIME to be used
in case I lose my primary copy.
I saw that the two phase commit exist but I'm not sure if that is the
correct option. I have the feeling that it would be abusing a
If it helps, I have finally got my system working, now using FreeTDS
0.82, SQLAlchemy 0.5.3, pymssql, Python 2.5, (all on Mac Leopard) and
SQL Server 2005 (on an WinXP vm).
With this setup, your test passes without any problems.
I also tried it out using pyodbc 2.1.5 and the test failed
Hello,
I would like to implement typical Save / Cancel dialog operating on
normal SQLA objects.
For that purpose, the most convenient way is to make a shallow copy of
an object using copy.copy(obj), let the user edit this object, and on
user pressing OK in dialog replace it in SQLA, e.g.
u'd better edit a new copy and on save copy all back into original
then commit that one, on cancel abandon the new one (but beware of
m2m relations if u have them).
all else isn't safe/nice IMO.
On Wednesday 06 May 2009 17:25:47 Marcin Krol wrote:
Hello,
I would like to implement typical
a...@svilendobrev.com wrote:
u'd better edit a new copy and on save copy all back into original
then commit that one, on cancel abandon the new one (but beware of
m2m relations if u have them).
all else isn't safe/nice IMO.
To make it specific, should I do smth like:
1. on beginning of
sqlalchemy objects always log change events when things are modified.
when i need a throwaway version of an object I often use a separate
class for that, sometimes just a vanilla object subclass that I set
attributes on, i.e.
class Lightweight(object):
def __init__(self, **kw):
the copy can be a dummy non-db-aware - if that is ok in your case
there's yet another option; u can just go all over the original
object, and on cancel do a rollback, and restore all changed stuff
back by hand (eventualy looking at object-state's history). But this
assumes short
Michael Bayer wrote:
sqlalchemy objects always log change events when things are modified.
when i need a throwaway version of an object I often use a separate
class for that, sometimes just a vanilla object subclass that I set
attributes on, i.e.
class Lightweight(object):
def
Hello az,
thanks for answer,
a...@svilendobrev.com wrote:
the copy can be a dummy non-db-aware - if that is ok in your case
there's yet another option; u can just go all over the original
object, and on cancel do a rollback, and restore all changed stuff
back by hand (eventualy looking
Marcin Krol wrote:
Michael Bayer wrote:
sqlalchemy objects always log change events when things are modified.
when i need a throwaway version of an object I often use a separate
class for that, sometimes just a vanilla object subclass that I set
attributes on, i.e.
class
if you're looking for state between requests you can use an HTTP session
for that
*SMACK* forehead... Right.. Mental block..
and lightweight objects are great for those since they are
easily serializable and use minimal space.
Im a little confused, did you originally intend to persist
Marcin Krol wrote:
if you're looking for state between requests you can use an HTTP session
for that
*SMACK* forehead... Right.. Mental block..
and lightweight objects are great for those since they are
easily serializable and use minimal space.
Im a little confused, did you originally
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi.
I have noted that with this query:
# query is the original query
# query_aux is the query required to compute the number of rows returned
# by the original query
query_aux = sql.select(
[sql.func.count()], from_obj=[query])
I get, with
one2many are the tricky ones - there's no copy as semantics,
there's move.
Say again? I can't (shallow) copy one-to-many object to another? Or
do you mean: I can't copy it to another object, modify it and then
copy it back?
shallow?
if A points to B1, copying B1 to B2 is ok, but u lose
Hello all,
I'm creating a SA model of a many to many relationship, where the
association has a particular weight.
I've always used straightforward association tables for this task
before (with an extra column in the association table for the weight
in this case), but was wondering if the
the implicit behavior might lead to confusion later on. such as:
from sqlalchemy import *
from sqlalchemy.sql import table, column
t1 = table(t1, column(c1), column(c2))
t2 = table(t2, column(c1), column(c2))
s1 = select([t1, t2], use_labels=True)
s2 = select([t1, t2],
I have a session created this way:
Session = scoped_session(sessionmaker(autoflush=True,
transactional=True))
Then I have this piece of code:
print User.query().count()
u = User(name='Jim')
Session.flush([u])
print User.query().count()
Session.rollback()
Session.clear()
print
are you using MyISAM tables ?
naktinis wrote:
I have a session created this way:
Session = scoped_session(sessionmaker(autoflush=True,
transactional=True))
Then I have this piece of code:
print User.query().count()
u = User(name='Jim')
Session.flush([u])
print User.query().count()
Oh.. Yes, sorry. That's my mistake, because testing engine created
MyISAM tables (they were default) and it broke the tests.
Thanks!
On May 7, 12:39 am, Michael Bayer mike...@zzzcomputing.com wrote:
are you using MyISAM tables ?
naktinis wrote:
I have a session created this way:
Session
20 matches
Mail list logo