-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Session-per-user-session ok for stateful gameservers?
PostPosted: Mon Aug 02, 2010 10:13 am 
Newbie

Joined: Mon Aug 02, 2010 9:35 am
Posts: 1
Hi,

we are developing an online game using a game server written in Java.

We are wondering whether our use case of Hibernate could be one of the exception mentioned by the documentation, where the "Session-per-user-session" pattern is useful.

- The game server is stateful. All collections of a player are in the server's heap memory and stay there until the player leaves the server and by that stops playing.

- Each player has it's own thread that is associated to one permanent socket connection where the player updates come from. This connection/thread is the only source that manipulates the player's data.

- Each player has around 5 Collections like "how many enemies of what kind has this player killed" (approx. 200 entries), the player's inventory (approx. 500 entries),….. They are initialized lazily,
when the user logs into the game server.

- When using the "session-per-operation" pattern the collections get detached from the session and because updates are saved via another session, the collections are reloaded from the database when the player is merged. This reloading is unnecessary because the player's thread is the only source that changes the data for this player and could be omitted with the session-per-user-session pattern.

- To avoid OutOfMemory-errors all information queried about other players would be evicted from the session after loading

- Performance is critical and when the player is saved to the database whenever he makes progress in the game or he picks up loot, etc.

The hibernate version is 3.5.4.

What do you guys think?
Has anyone used the session-per-user-session pattern and could share some of his/her experience using it?

Thanks in advance
Monterey


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.