Seamus Minogue

Ranch Hand
+ Follow
since Jun 24, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Seamus Minogue

http://www.thaiopensource.com/relaxng/trang.html

this should do the trick :-)

Usage:
$ java -jar /s/java/lib/trang.jarxmlfile.xml xsdfile.xsd
Santosh,

Actually transaction handling is being done at the service level. The reason being:

My service may call multiple DAO's and if any of them throw and error I want to rollback the transaction. Here is my DAO:




And here is the snippet from my applicationContext which does the transaction stuff:



Hope that helps.
oops... copy paste error.

I think you're right

Sorry about that
13 years ago
Create a property called build.tests which has a value that is the same as where your javac command compiled your test classes to and it should work
13 years ago
looks like you need to tweak that classpath entry I gave you so that junit.jar is on it.

^^ Idiocy please ignore


Actually im sorry I am seeing things. Your test case is called JUnit!

Ok well THAT isnt on the classpath...
13 years ago
Ok so I worked this out and thought I would share with all those who have suffered as I have suffered.

applicationContext.xml:




Games.hbm.xml:



JUnit Test Class:



The key seemed to be removing the catelog attribute of class tag in the hibernate-mapping file.

I dont really know why this broke things... But removing it fixed the problem. I dont know if its required when the application actually connects to my real database rather than this one in memory. This is part of a utility jar file and the mappings will be external to it when I actually deploy.

Anyway, my 81 tests went from like 8.5 seconds to execute down to 3.106 seconds. BIG improvement :-)

Hope this helps someone.

-Seamus







13 years ago


Think you might be missing this...

From my build file
13 years ago
Santosh,

This is from my appContext file which works. Thought it might help you out




And then my RoleDao class extends org.springframework.orm.hibernate3.support.HibernateDaoSupport;



Other than that my context is pretty much the same as yours.


Although, now that I look at it I dont do things like



I get the session from the HibernateDaoSupport class. Take a look at the API
http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/orm/hibernate/support/HibernateDaoSupport.html


example:



Hope that helps


Preferences is under the Eclipse menu on the mac.

You can also right click on the project and go to Build Path -> Configure Build Path

Good Luck :-)
13 years ago
http://ant.apache.org/manual/OptionalTasks/junit.html


is also another good source for you with a nice little example at the bottom.
13 years ago
Well running jboss from the command line is not going to make it visible to eclipse.

The steps you followed to add the jboss runtime to eclipse look correct.

Shutdown the jboss instance you started on step 1.

Go to window -> show view -> Servers

A tab should have opened (for me its at the bottom of the screen, but I dont know where its default is) called Servers. This SHOULD list all the installed server runtimes.

Right click on your jboss server and look at that menu.

You can start the server normally, start it in debug, clean, add and remove projects, etc. Anyway you get the idea.

This is where you want to control your jboss server from :-)

Hope that helps
13 years ago
First off if this is the wrong place... sorry. I didnt think it really fit in the Hibernate area of the forum.

I am writing test cases for DAO's in a project. Rather than simulate the database access I really am going to a database.

My application will eventually be running on a MySql database, but I dont want to use that for testing. So at present when my test cases run spring calls derby which creates a new database. By using Hibernate's HBM2DDL.auto property I am creating my table structure and everything works fine happiness, right?

So my problem is (other than derby creating this annoying directory in my project for the database) derby seems very slow. At present my project is executing 81 tests of the DAO's in just over 8.5 seconds. Now I can live with 8.5 seconds delay in the build. The problem is I am only testing about 33% of the DAO. So I expect that number to probably triple. Again, 25 seconds delay during build is something I can live with. I am thinking down the road when I start testing other things like the service layer of my application (which trickles down to the DAO and DB) that number is going to go up. I really dont want to end up having a build which takes several minutes to execute!

So I have been looking at switching from derby (file based) to H2Database which according to their website (they wouldn't stretch the truth would they?) is the fastest in memory DB solution out there.

The problem I am running into is that when I execute my tests I get an error that my schema does not exist and my tests fail.

Has anyone gotten this to work? If not has anyone done something similar and can tell me what in memory DB they used and how?

Thanks



13 years ago
Which logs are you interested in?

I looked in the application log and jboss server log after recreating the problem and there are no errors logged.

But if there is some other log I should be interested in?
13 years ago
JSF
All,

I am having some problems with the valueChangedListener for multiple selectOneMenu's in a Tomahawk DataTable.





is the jsf snippet which is creating my selectOneMenu items.



The myproject.listeners.StatusListener is a class which implements the ValueChangedListener interface and has a method:



The problem is that the multiple selectOneMenu's display fine. And when I change the value of the FIRST one it triggers the processValueChange method. Unfortunately all the other selectOneMenu's simple cause the page to reload and the processValueChange method does not execute.


I have been grappling with this for the past few hours and am sure that it is some simple incredibly obvious thing I am overlooking?

Any guidance would be greatly appreciated.
[ November 19, 2008: Message edited by: Seamus Minogue ]
13 years ago
JSF