[hibernate-dev] Help with first patch

Steve Ebersole steve at hibernate.org
Wed Jul 8 21:40:55 EDT 2009


There is a "Developer Resources" page I started on the wiki @
https://www.hibernate.org/436.html

But, well, we've all seen the stability of that site over the past few
weeks...

So I am trying to hols off on any changes to this kind of "project
content" (as compared to more transitional community wiki content) until
we get everything moved over to the new shiny (yet to be discovered
unstable) JBoss infrastructure.  

As for adding a new database, well that is a particuklar rub with Maven
itself and a particular point I am not happy about.  Amazingly there
seems to be no easy way to accomplish this seemingly simply feat in
Maven.  Instead the maven devs want you to set up your testsuite module
such that yet another module depends on it and supplies the needed jars
and hibernate/jdbc config...


On Wed, 2009-06-17 at 10:47 -0400, Nikolas Everett wrote:
>                 I have another question.  The particular bug I wrote a
>                 patch for only
>                 comes up with MySQL.  Is there some way to test
>                 hibernate against
>         
>         
>         Yes. On Hibernate Core, you can override the
>         appliesTo(Dialect) method and return "true" for MySQL-based
>         dialects and false for the others.
> 
> If I wanted to write a test that ensured that transactions aren't
> accidentally committed during a polymorphic delete when a database
> constraint is violated, where would I put it?
> org.hibernate.test.ops.DeleteTest has a number of tests relating to
> the delete operation but none of the mappings in the
> org.hibernate.test.ops package have any joined-subclasses in them.
> 
> I've attached a diagram of the schema I'd create.  My test would:
> 
> 1. Create a Child and a KeyHolder with a reference to it
> 2. Commit
> 3. Delete the Child
> 4. Catch the expected constraint exception and fail if no exception
> was thrown
> 5. Query for the Child and ensure that its type is still Child and not
> Parent
> 
> Step 5 would fail for MySQL with InnoDB at this point.
> 
> I think if I did override appliesTo(Dialect) it would be to make sure
> that foreign key constraints and temp tables work for that dialect.  I
> know MyISAM doesn't support foreign key constraints and polymorphic
> deletes aren't supported for Dialects that don't support temp tables.
> 
> 
> Also I ended up testing Hibernate against mysql by:
> 1. Adding a mysql5 profile to my ~/.m2/settings.xml which overrides
> jdbc.url, jdbc.user, and jdbc.pass
> 2. JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/ mvn -P mysql5 clean test
> 
> That seemed to do the trick.  It looks like the same tests fail for
> mysql as for the rest of HSQLDB but I didn't do a very thorough check.
> 
> Is there a web page with stuff like this?  Its not super hard to
> figure out, but it would be nice to spell it out explicitly.
> 
> 
>         
>         
>                 MySQL?  Just out of curiosity, is there a build farm
>                 for hibernate that
>                 covers all of the different databases like Postgres
>                 has for operating
>                 systems at
>                 http://buildfarm.postgresql.org/cgi-bin/show_status.pl ?
>         
>         
>         There is a public Hudson (CI software) instance [1] which
>         should receive some attention in the next months. You may want
>         to check the job "hibernate-all-trunk" and ignore the others.
>         Also, note that this includes most Hibernate projects
>         (ANN/EM/Validator/Search/Validator/...), not only Core.
>         
>         [1] http://hudson.jboss.org/hudson/view/hibernate/
> 
> Neat.  Its not quite as easy to see what is going on compared to the
> Postgres one but its a good start.
> 
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
-- 
Steve Ebersole <steve at hibernate.org>
Hibernate.org




More information about the hibernate-dev mailing list