This question is not directly GWT-specific but more on the integration
aspects. Most developers use JDBC/MySQL combination for integration
with back-end server side code.
Now, the JDBC code required to execute SQL statements tend to get very
bloated. While JDBC is a powerful, low level API for accessing and
manipulating a myriad of SQL databases1, it is so low level that it
requires:
1. Writing verbose finally blocks to close database connections
2. Writing catch blocks for all checked exceptions, even if they can't
be reasonably recovered from
3. Adding clumsy if else or switch statements that examine SQLState or
error code values to determine the type of exception generated
4. Writing custom connection or connection pooling code
I am wondering what kind of integration frameworks others are using to
effectively integrate JDBC/MySQL combination for back-end server side
code with GWT-client code-base.
Any wrapper class and/or pointers to address this is highly
appreciated.
Joster
Search the forums here, there are several examples of people using JPA
on the backend of a GWT app. And, all over the interwebs you will
find many good examples of JPA in general (http://java.sun.com/
developer/technicalArticles/J2EE/jpa/).
There seem to be multiple frameworks, has someone done any comparisons
between multiple frameworks and outlined pros/cons of each. And/or
know any external links which provides info on this.
Moreover digging into this forum, it looks like there are known issues
in integrating Hibernate backend with GWT. Will GWT 1.5 (future)
release ease things up? And/or are there technical problems within GWT
which prevents from having a seamless integration.
Joster
On Aug 31, 6:12 am, "charlie.coll...@gmail.com"
GWT is a client side technology, for the most part. You can use any
server side technology you want - the only thing GWT requires for its
own RPC mechanism is a servlet (but you can use a different RPC
mechanism if desired). Many people use Hibernate without a hitch -
the only problems occur when you try and send Hibernate objects to
GWT, which is usually very bad design to begin with. GWT really could
care less about the back end components you use, so there are no known
"issues" between it and GWT - the only problems you will have are the
ones you create for yourself! A lot of people seem to get mixed up
about this stuff - GWT has no relation to JDBC or database
technologies, except insofar as GWT can use data and a database can
provide it - they are no more coupled than Javascript is to MySQL.
Make sense?
-krispy
Thanks. Appreciate your comments. I am able to better understand.
Could you please elaborate on your comment "the only problems occur
when you try and send Hibernate objects to GWT, which is usually very
bad design to begin with."
What should the correct design look like? Should there be a DTO class
which will take care of mapping Hibernate objects to DTO class,
serialize them and send it back to client?
Joster
For information, I wrote a small article about Hibernate and GWT
cohabitation issues : http://hibernate4gwt.sourceforge.net/hibernate_gwt_problem.html
About the DTO design, the convesion between Hibernate entities and DTO
is not as simple as you may think, especially if you are dealing with
partially loaded objects (filled with Hibernate proxies).
Hope this helps !
Bruno
Do you know if anything is being done in the upcoming GWT 1.5 release
to help with issues you have highlighted in your package
(hibernate4gwt)? Most large web-apps do interact with a database
server - having a solid integration framework which works seamlessly
with GWT (client-side technology) will immensely useful to many.
Joster
The only goal of GWT 1.5 is Java 5 support, with no additional feature
such as proxy support or JRE enhancement.
IMHO, the integration of GWT (a client-side, presentation library)
with a server library such as Hibernate or JPA, is out of scope for
both teams. That's the reason why I wrote hibernate4gwt, and will try
to make it as seamless as possible.
Regards
Bruno