java - unable to retrieve the new primary key from the database -


I have a gaming project, each game dynamically generates a unique ID. I use the ID using that segment Recovering the primary key from the databases I am after the game is over, the user can play the game again. The second time that game plays a new unique ID is generated. Now when I try to recover the new primary key by specifying the new primary key, instead of getting a new primary key, I'm getting the old primary key. What could be the reason for this strange behavior?

  Receive public long time Priority (string id) {query q = getSession (). CreateQuery ("From GameActivities F g, g.gameid = '" + id + "'"); Game_Answers ga = (Game_Answers) q.uniqueResult (); Return ga.getId (); }  


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -