Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate session per database user

 
Lukasz Kaleta
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to run hibernate with my web application. First I create DataSource object by get user login and password from web form (url and driver property I get from xml).
Next I try to get connection for each user by :

And then I try to create Session object by:

And then when I try to read data from db I get the following exception:


And in my logs:
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"llllll lllll"

Welcome to JavaRanch!

Can you please change your display name to one that matches our Naming Policy. You can change it here.

Thank you.
 
Lukasz Kaleta
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. I change my display name.
 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
scrollable result sets are not enabled
I don't see what this error message has to do with users. What makes you think that? To me it is saying something about the configuration of your database.
 
Prashanth Talapala
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code as to how you are reading the code? If you created a statement object from the connection u may need to specify what kind of a resultset it needs to return (i.e; scrollable etc.)

-Prashanth.
 
Lukasz Kaleta
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Prashanth Talapala
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok three things seem odd here:

1. You dont need a transaction when you are reading from a db (i.e; using select queries). Transaction is required only when an update is done. So remove the transaction related code from your code.

2. Try setting a scroll mode in the query. i,e; instaed of query.scroll() try using something like query.scroll(ScrollMode.SCROLL_INSENSITIVE)

3. I guess scrollable resultset support in hibernate is dependent on the jdbc driver support. So i donno check your jdbc driver if it supports scrollable resultset.

I feel it may be a session related problem so try removing transaction related code and see how it goes. Let me know if it works ... or it doesnt

-Prashanth.
 
Lukasz Kaleta
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use MS SQL. I use it with latest jdbc driver.
I change my code; still dont work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic