This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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

when we using get method ,how can we use loaded JavaBeans after the transaction has been committed

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when we using get method to retrive a object ,how can we use loaded JavaBeans after the transaction has been committed ?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the associated JavaBeans are eagarly loaded, you can just access them when you call the appropriate getter. If the associated objects are lazy loaded, and getters have not been invoked while the transaction was active, you'll have Lazy Loading Exceptions.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no.I need much explain
Assume we are using get method to reterive a object from database.
Then how does we can use that object after the transaction is commited?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just call the methods in the JavaBean. You use JavaBeans after a transaction has committed just like you would use any other JavaBean.

What is the problem you are having?
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is then why can't we use it if we use load method?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samanthi perera wrote:My question is then why can't we use it if we use load method?


There isn't anywhere in the documentation that says you can't. I use it all the time. In fact, I prefer it.

-Cameron McKenzie
 
Prabhat Jha
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the problem that you are facing when using load() ?Please elaborate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic