Hi,
I'm trying to load my database with fixtures, but it fails with "database
is locked" error.
The setup is the following:
1. I set up database connection, sessions and create the tables
2. I run a post setup script to add some relationships and other data that
were not known before
3. I load the fixtures
I've tracked down that the database is locked error comes from my post
setup scripts. (If I leave it out, the fixtures don't use those tables)
The blocking call is:
PUBLIC_GROUP_ID = 0
def get_public_group(settings):
global PUBLIC_GROUP_ID
if PUBLIC_GROUP_ID:
return PUBLIC_GROUP_ID
group_name = settings.get('messageboard.public_group_name', 'public')
group = GroupModel.get_or_create(name=group_name)
PUBLIC_GROUP_ID = group.id
return PUBLIC_GROUP_ID
where get_pr_create is a simple method like in Django's ORM, where the
create part is used (simple object creation, session.add, session.flush).
I've created a more detailed, but still stripped down version of my full
setup at: http://pastebin.com/HAseVtqB
Could someone help me out? I'm running my tests with sqlite, but I guess
this should be database independent anyway.
Viktor
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.