Relative Content

Tag Archive for hibernate

Hibernate set up for beginner

I am learning Hibernate (OR Mapping). I am using Maven for project management. However, I am currently reading a Hibernate book by O’Reilly, and they use ANT for their example. So my question is are there any difference between setting up hibernate with ANT and Maven?

Sorting rows off an autoincrementing primary key

Is it a bad practice to rely on an auto-incrementing primary key to sort rows in a table? A coworker and I were having an argument about this subject. We need to be able to find the last-inserted row in a table, and we have no create/update time columns (which might be considered a bad practice in itself, but that’s a different argument). We obviously can’t rely on the natural order of the rows, since that can be inconsistent. Is there anything inherently wrong with using the primary key in this way, given that it’s an immutable value?

SQL W/ hibernate vs in-memory solution

I recently posted a question here: Methods to share memory or state across JVMs? and appreciate the answers. However, as I read the code and learned the system better I learned I was over complicating the problem. Only one of the JVM’s really care about the dynamic data so there is no need to pass dynamic data across memory boundries. However, we still have a problem that they are manually maintaining state between in-memory and sql; the manual code isn’t perfect and doesn’t protect against stale data, data races, etc etc and I want to remove it entirely one way or another so I can feel more secure about the overal stability.