On Aug 14, 11:34 am, Myx <[email protected]> wrote:
> Greetings fellow Pyloneers!
>
> I have started to encounter a quite annoying problem while working on
> my current project:
> The results from database querys are different from thread to thread.
>
> My project is a server for a flash game, the server contains code for
> logging in and databaseing.
> The idea is that the user enters the page and reaches the first
> controller. This controller checks if the person is logged in and
> answers with the proper response. If the person is logged in the next
> thing to check is if the user has a game saved away in the databases.
> If there is not a game matching the user's ID the user gets a Create
> New Game page. This is where the problems start.
>
> Checking if the user has a game is done with a simple checkGame()
> function. If this check fails I do a render('/createGame.html') which
> uses formencode.
>
> When the New Game form is submitted I perform a second check in the
> submit function, identical to the the first check I performed. This
> check should never be triggered since it requires the user to have a
> Game, which is impossible because the only way to reach the submit
> function is by first making sure is that the user does NOT have a
> Game.
>
> Now doing this the first time results in no problems, all is fine and
> the new game is added. However the second time I log in I get
> presented with the Create New Game screen yet again and then the
> second check which should never be triggered informs me that I already
> have a Game.
>
> I'm fairly new to Pylons, but this sounds to me like a threading
> related problem.
> I use SQLite as a database.
> As the topic suggest I have multiple engines; I've set up two of them
> and haven't encountered any problems with them so far.
>
> All help is greatly appreciated.

You might need to call Session.remove() at the end of the request.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to