views:

69

answers:

4

Has anybody used ajax in hibernate project ? Any pointers, help will be appreciated.

+4  A: 

You might be referring to the open session in view problem, but your question is a bit too minimal at this point.

As for me: Yes I have used Ajax & Hibernate in the same project using Wicket, and I haven't run into any problems (when taking the above into account).

Tim
Thanks Tim, No I am not running into any problem. But I want to use ajax in hibernate for the first time, so I was looking for documentation.
yogsma
+1  A: 

We use both every day.

However, the two technologies are not related, they don't interact.

So there is nothing specific, you can just use each... ;-)

KLE
+3  A: 

AJAX and Hibernate are not related almost at all. They might become partially related in the context of one framework or another. The flow would look like that:

Hibernate (fetches entities) -> service layer (manipulates the result) -> controller (serializes the objects to xml/json/whatever) -> ajax (displays the result dynamically)

You see, there are many steps between hibernate and ajax. You will eventually bump into a problem, which was already mentioned and is solved by the open-session-in-view.

Bozho
I never said they are related. I want to use ajax in my hibernate project. How does that mean they are related?
yogsma
because they appear in the same question. If you want to know how to use either of them separately, mention it explicitly. Would it make sense if I ask you "how to use transactions and html" ?
Bozho
Well , my question is straight forward if someone has used Ajax in hibernate project. Neither of them separately because I know how to use them separately. I am using hibernate for web application with plain javascript till date. I wanted some dynamic features and that's why I turned to Ajax.
yogsma
Yeah, I've done that. And I'm sure lots of people have done it. And you've got some pointers already. The ones that say "There's no relationship between the two" are good pointers. Because AJAX is Javascript. It doesn't make the least bit of difference to code running on the server (i.e. Hibernate) how the HTTP requests were generated on the client. So the only possible "pointer" is to ask why you think there's a question.
Paul Clapham
A: 

I guess this is the best link https://blueprints.dev.java.net/ajax-faq.html

yogsma