How to synchronize the Java Object and Hibernate table

I have a game (like chess) , I persist as sequence of steps (as Step object, Game is a set of Steps).

Board the game board where it will hold 28 positions (64 positions for chess).which is not persisted entity.

when player does a move it updates one position and I persist step.

Now when second users plays I need to load the game ( need to populate all the steps happen till now ) and ask him to play.

In this way , I am always loading game by populating the game from steps.

Is there any way in hibernate or java applications , I keep the gameBoard object in memory and I do merge the step so as not to populate the board every time.?

I wanted to load game only when it is not available in java heap as object?

Can anybody suggest me or guide me if I am thinking wrong?


Download how.to.synchronize.the.java.object.and.hibernate.table.zip
Direct Link


Download


Download how.to.synchronize.the.java.object.and.hibernate.table.zip
Mediafire


Download


Download how.to.synchronize.the.java.object.and.hibernate.table.zip
FileJungle


Download