I'd like to set up a sharding strategy where shards are chosen based
on this code:
SHARD_COUNT = 5
databases = dict((i,create_engine('sqlite://shard_%s.db' % i)) for i
in xrange(SHARD_COUNT))
def shard_chooser(mapper, instance, clause=None):
return instance.primary_key_id % SHARD_COUNT
Ie,
On Dec 1, 7:24 pm, imgrey <[EMAIL PROTECTED]> wrote:
>
> > OK, i guess you are using the SAVEPOINT then since the postgres docs
> > seem to recommend that as a workaround for the transaction abort its
> > doing at the IntegrityError point...and the abort is bad for you
> > because you want to re
> you should select() for the record first, and if not present, insert()
> it. if youre concerned about lots of selects() you can implement a
> simple cache in your application, such as a dictionary of ids that
> already exist. if theres concern over the cache growing too large,
> you can use a
Cool, thanks!
I got it working pretty wel I think. I replaced the iterator code with
a Session.get. Check out the code here: http://paste.pocoo.org/show/13434/
The only thing I am still wondering if Session.get also returns
objects in Session.new? Otherwise this won't fix the other bug. I
think
On Dec 1, 2007, at 9:33 AM, Koen Bok wrote:
>
> This is quite hackish, but just an experiment for me.
>
> We use listen/notify in our app. A seperate thread is listening for
> notifications from updated rows in the table. If one is received I'd
> like to expire an object in the Session cache so
On Nov 30, 11:57 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> 1.2.2 over here produces regular "datetime" objects.
Ah, well, thanks for the information.
-Samuel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sq
This is quite hackish, but just an experiment for me.
We use listen/notify in our app. A seperate thread is listening for
notifications from updated rows in the table. If one is received I'd
like to expire an object in the Session cache so it gets refetched the
next time it is accessed. I have it