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.  [ 6 posts ] 
Author Message
 Post subject: create index in SchemaUpdate
PostPosted: Mon Sep 11, 2006 6:51 am 
Newbie

Joined: Sun Nov 21, 2004 5:21 am
Posts: 14
i wonder why the SchemaUpdate does not create missing indexes in the DB.

i saw the related code is commented out in org.hibernate.cfg.Configuration (method generateSchemaUpdateScript() ), but there are no comments indicating why.

Does anyone know what is the reason????

i use the SchemaUpgrade very often to upgrade our production enviornments. The Configuration class is sometimes difficult to extends becuase many fields/methods are private and are not accessible by inheritence.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 11, 2006 7:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
#1 don't ever use schemaupdate to blindly upgrade production environments! It was never intended for that!

#2 There are comments in the code for why it is commented out:
/*//broken, 'cos we don't generate these with names in SchemaExport

That's the reason.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 11, 2006 8:13 am 
Newbie

Joined: Sun Nov 21, 2004 5:21 am
Posts: 14
#1 we did a massive QA to test this feature and to make it work for production...I'm aware that Hibernate does not recommend it.

#2 but i see that in Configuration's method "generateSchemaCreationScript" which is called from the SchemaExport those indexes are created!
i use both SchemaExport (for creation) and SchemaUpdate and the 1st one create indexes while the second one doesn't.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 11, 2006 8:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and do we generate those indexes with names now ?

as I have answered many times before for this question:

Submit a patch(I think there is already one in jira)
with a *testcase* showing that it creates/updates the correct things (the last part is what people forget)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 11, 2006 8:47 am 
Newbie

Joined: Sun Nov 21, 2004 5:21 am
Posts: 14
you do generate them in the SchemaExport only. i have my own patch, just wonder why it is done this way...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 11, 2006 8:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
we are going in circles....

the code were removed in schemaupdate because it did not match up with the names used (or not used) in schemaexport (as the comment says)

That might have changed, but that does not change my request:

1) create a patch
2) create a unit test for it

why ? because i don't want to add new features to schemaupdate/schemaexport without proper tests. too many issues were/is in those tools because of until recently not many unit tests for the "corner" cases.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.