views:

437

answers:

2

Hi all,

Our application uses Hibernate with Sql Server 2005.

Being a DBA, I am not an expert of Hibernate yet. And our developers do not understand Sql Server very well, so I need a middle ground to make sense out of this.

I am looking for some info on how Hibernate works with Sql Server 2005. Any best practices or any issues with the combination or anything like 'lessons learnt'.

I do not have any particular question as such, but in general if there is anything that I need to know to improve the performance overall.

Please let me know if you have links to any such articles.

thanks, _UB

+1  A: 

Some titbits that i learned when i used hibernate :

  1. Dont hard code queries with params. Use named queries. For more info click here
  2. Make sure you dont append params to query strings to avoid sql injections
  3. You can use stored procedures whenever necessary to update data (AFAIK, Hibernate doesnt support nested transactions)
  4. Use the container features to Encrypt passwords needed to connect to db.

I ll add as and when i come up with certain best practices.

Cshah
Thanks a lot CShah. Looking forward to your list...
UB
A: 

I would like to add to Cshah's statement: Use caching when it is appropriate... if you are inserting a ton of items into a database that you don't plan on caching, set the Cachable attribute to false before you save.

monksy