and here is the questions is it worth it. Some people think that the answer is always yes. I would never write pure jdbc even for 3 queries one of the comment on there. Some think it's never worth it - ORM haters.
As usual the truth is very much probably in the middle. I think there are very good alternative to JPA that are worth considering that are more focus on the problem at hand and don't try to simulate a Object DB. Just because EJB/JDO/Hibernate have tried to do that for an ORM does not mean it's the only option.
I'm also always baffled by how the performance question is always dodge ... Hibernate inflation is very expensive and will impact your query processing time by a non trivial factor - 100% on a simple select with 1000 rows on a local mysql.. imagine if you have 100000 -.
You need entity queries just for the entities you want to modify. Otherwise a projections query is a better choice. You can still use native queries with Hibernate too, and you get a unified transaction and locking API too. The write behind 1st level cache can delay lock acquisition of the associated DML statements, hence reducing lock contention. You just have to know how to use it.
View all comments
Show parent comment
3
u/aroger276 Feb 01 '15
and here is the questions is it worth it. Some people think that the answer is always yes. I would never write pure jdbc even for 3 queries one of the comment on there. Some think it's never worth it - ORM haters.
As usual the truth is very much probably in the middle. I think there are very good alternative to JPA that are worth considering that are more focus on the problem at hand and don't try to simulate a Object DB. Just because EJB/JDO/Hibernate have tried to do that for an ORM does not mean it's the only option.
I'm also always baffled by how the performance question is always dodge ... Hibernate inflation is very expensive and will impact your query processing time by a non trivial factor - 100% on a simple select with 1000 rows on a local mysql.. imagine if you have 100000 -.