-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Spring and Hibernate - Pros & Cons
PostPosted: Mon May 22, 2006 11:11 am 
Beginner
Beginner

Joined: Wed May 17, 2006 3:38 am
Posts: 45
I worked on some sample code available on the web(http://www.shoesobjects.com/blog/2004/1 ... 42880.html)...and it appears, spring-hibernate is a fruitful combine.

Some advantages of this combine as it is said are:
1.
Bringing Spring into the mix will allow you to reduce the amount of plumbing code required for hibernate by a factor of 50% or more.

2.
Using spring isn't merely about reducing code, it's about keeping your projected managable, scalable, flexible, and uncoupled.


If somebody can reflect further on spring-hibernate combine(advntage/disadvantage and others)...it would be worth considering...


Top
 Profile  
 
 Post subject: my 2c
PostPosted: Mon May 22, 2006 12:23 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
It is fine combination as long as you do not use HibernateTemplate but stick to the session injection techniques.

http://sandbox.sourcelabs.com/kosta/hib ... /haop.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: my 2c
PostPosted: Mon May 22, 2006 1:29 pm 
Beginner
Beginner

Joined: Tue Jun 28, 2005 4:33 pm
Posts: 21
kgignatyev wrote:
It is fine combination as long as you do not use HibernateTemplate but stick to the session injection techniques.

http://sandbox.sourcelabs.com/kosta/hib ... /haop.html


I'll second that... to a degree. I've been doing some tests over here, and trying to do native sql with the HibernateTemplate is a pain.


Top
 Profile  
 
 Post subject: Re: my 2c
PostPosted: Tue May 23, 2006 9:06 am 
Beginner
Beginner

Joined: Wed May 17, 2006 3:38 am
Posts: 45
Hi Constantin,

I downloaded the source code from the url you mentioned....however it would have been probably useful if the docs(available in the source-bundle) mentioned the libraries required(of course I am NOT speaking of the spring and hibernate libraries)....I had to find out the libraries required by taking cue from the compilation error I got in my IDE....for example I found out that the "apache commons IO" and "iBATIS" libraries are requied for compiling the com.sourcelabs.hibernate.bhw.haop package....am I missing something?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 11:55 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
It look like you did now follow all the instructions or try to compile it not from Ant because all the necessary libraries will be downloaded automatically via transitive dependencies. Please read and follow carefully to the #3 http://sandbox.sourcelabs.com/kosta/sas ... arted.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: sashstarter & others not working
PostPosted: Wed May 24, 2006 8:52 am 
Beginner
Beginner

Joined: Wed May 17, 2006 3:38 am
Posts: 45
kgignatyev wrote:
It look like you did now follow all the instructions or try to compile it not from Ant because all the necessary libraries will be downloaded automatically via transitive dependencies. Please read and follow carefully to the #3 http://sandbox.sourcelabs.com/kosta/sas ... arted.html


At the outset let me mention, I am using apache-ant-1.6.5, java 5.0, and I tried to build from dos console(xp)...this time I did not use IDE(Netbeans 5.0) though, read #3 carefully as you mentioned:

I tried to run 2 things:
1)application:sashstarter-1.0
I visited the above url u gave...however the page do not contain any link to the sample sashstarter-2.0 application....Hence I tried to find a source for the relevant sample code...and I found the file "sashstarter-1.0-src.zip" which I downloaded from http://www.sourcelabs.com/?sidemenu=4&p ... ingstarted".....However none of the build files are working(for 1.0).....I feel that sashstarter-1.0 is not the right application…so where is the source cde link for sashstarter-2.0?

2)application:hb-beyond-hw
The file hibernate_bhw.zip which I downloaded from http://sandbox.sourcelabs.com/kosta/hib ... /haop.html here is the build error..

E:\dev\java\hb-beyond-hw>ant
Buildfile: build.xml
Downloading: postgresql/postgresql/8.1-404.jdbc3/postgresql-8.1-404.jdbc3.pom
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies] Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Unable to get dependency information: Unable to read the metadata file for artifact 'postgresql:postgresql:jar': Error getting POM
…………...
…………...
BUILD FAILED

So what am I missing?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 24, 2006 9:42 am 
Beginner
Beginner

Joined: Wed May 17, 2006 3:38 am
Posts: 45
Hi,

I had to do a simple google search(since I could not get in getStarted docs..it is possible that the link is in the page you mentioned but I could not find it) to find the file sashstarter-2.0-src.zip...However I get a similar build error as I got for the appliction hb-beyond-hw as follows:

E:\sashstarter-2.0>ant
Buildfile: build.xml
[artifact:dependencies] Downloading: javax/servlet/servlet-api/2.3-1/servlet-api-2.3-1.pom
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies] Diagnosis:
[artifact:dependencies] Unable to resolve artifact: Unable to get dependency information: Unable to read the metadata file for artifact 'javax.servlet:servlet-api:jar': Error getting POM for 'javax.servlet:servlet-api' from the repository: Error transferring file
[artifact:dependencies] javax.servlet:servlet-api:2.3-1:pom
[artifact:dependencies] from the specified remote repositories:

Is the remote-repository down, or is it a firewall poblem or a something else?

I get a different error when I run the follwoing command:

E:\sashstarter-2.0>ant -f build-antdep.xml
Buildfile: build-antdep.xml
[typedef] Could not load definitions from resource dependencies.properties. It could not be found.

BUILD FAILED
E:\dev\java\sashstarter-2.0\build-antdep.xml:10: Could not create task or type of type: dependencies.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual solutions are
.................

Now from the usual solutions, I did not find anything worthwhile

Also, I implemented the following as mentioned in docs:
"Download maven-dependencies jar and place it in the ${ANT_HOME}/lib directory"

Also there is no file called dependencies.properties
So where lies the problem?


Top
 Profile  
 
 Post subject: ant working now
PostPosted: Wed May 24, 2006 10:22 am 
Beginner
Beginner

Joined: Wed May 17, 2006 3:38 am
Posts: 45
Sorry, I did not see the proxy related stuff in the doc......Now the initial build failure on running the command ant for sashstarter-2.0 is gone with the addition of the line:
<setproxy proxyhost="" proxyport=""/>
with information specific to my connection settings....


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 24, 2006 11:19 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
That is really strange, I just verified that everything compiles and works fine. All the dependencies were also successfully resolved.
Couple of suggestions:
- purge your .m2 directory;
- make sure that you are using Ant 1.6.5 and that in its lib directory there is maven-artifact-ant-xxx-dep.jar from http://dist.sourcelabs.com/sash/tools/a ... .0-dep.jar do NOT use current maven dependencies ant tasks (2.0.4) because there is annoying bug related to the multiple repositiories use;
- then type ant and everything should be downloaded and compiled;
- type ant -projecthelp to see options;
- I suggest then typing ant help-quickstart and following instructions;

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.