Re: [hibernate-dev] temporary table use
The link is http://community.jboss.org/wiki/Temporarytableuse On 25 mai 2010, at 23:19, Steve Ebersole wrote: > Here is the follow up i promised in the IRC meeting wrt temporary table > use and the current support within Hibernate. Its still a work in > progress, but please leave comments. > > > -- > Steve Ebersole > http://hibernate.org > > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] R: [HSEARCH] @DateBridge and @Field(index=Index.UN_TOKENIZED)
I have been thinking some more and it looks like its a more general problem and not as easy a solution as it seems. If you think about it many bridges should not be analyzed (date, URL, class, numbers, enum etc: most of the built-in ones actually). That being said a smart person might want to convert a class into its fqcn and then analyze that with a specific analyzer. Same for all the others. So making decisions is probably not a good idea after all :) On 20 mai 2010, at 20:04, Sanne Grinovero wrote: > Makes sense, maybe we could default to untokenized? Same idea should apply to > the soon-to-be-added NumericFields. > > >> Il giorno 20/mag/2010 14:58, "Emmanuel Bernard" ha >> scritto: >> >> Does it ever make sense to use @DateBridge without >> @Field(index=Index.UN_TOKENIZED) or NO_NORM >> >> I got caught up with doing >> >> @DateBridge(resolution=DAY) @Field >> public String getDate() { return date; } >> >> and having unexpected issues. >> >> If it never makes sense we could raise an exception when that happens, or >> simply force the index strategy to UN_TOKENIZE. >> >> WDYT? >> >> >> ___ >> hibernate-dev mailing list >> hibernate-dev@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] R: [HSEARCH] @DateBridge and @Field(index=Index.UN_TOKENIZED)
true, I don't support the idea to enforce this, but it would be nice to provide the correct default, or maybe log a warning. each bridge could have a boolean recommendAnalyzersOn(); ? 2010/5/26 Emmanuel Bernard : > I have been thinking some more and it looks like its a more general problem > and not as easy a solution as it seems. > If you think about it many bridges should not be analyzed (date, URL, class, > numbers, enum etc: most of the built-in ones actually). > > That being said a smart person might want to convert a class into its fqcn > and then analyze that with a specific analyzer. Same for all the others. So > making decisions is probably not a good idea after all :) > > > On 20 mai 2010, at 20:04, Sanne Grinovero wrote: > >> Makes sense, maybe we could default to untokenized? Same idea should apply >> to the soon-to-be-added NumericFields. >> >> >>> Il giorno 20/mag/2010 14:58, "Emmanuel Bernard" ha >>> scritto: >>> >>> Does it ever make sense to use @DateBridge without >>> @Field(index=Index.UN_TOKENIZED) or NO_NORM >>> >>> I got caught up with doing >>> >>> @DateBridge(resolution=DAY) @Field >>> public String getDate() { return date; } >>> >>> and having unexpected issues. >>> >>> If it never makes sense we could raise an exception when that happens, or >>> simply force the index strategy to UN_TOKENIZE. >>> >>> WDYT? >>> >>> >>> ___ >>> hibernate-dev mailing list >>> hibernate-dev@lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] temporary table use
Is that needed? ;) Thanks. On Wed, 2010-05-26 at 10:51 +0200, Emmanuel Bernard wrote: > The link is http://community.jboss.org/wiki/Temporarytableuse > > On 25 mai 2010, at 23:19, Steve Ebersole wrote: > > > Here is the follow up i promised in the IRC meeting wrt temporary table > > use and the current support within Hibernate. Its still a work in > > progress, but please leave comments. > > > > > > -- > > Steve Ebersole > > http://hibernate.org > > > > ___ > > hibernate-dev mailing list > > hibernate-dev@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev -- Steve Ebersole http://hibernate.org ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
[hibernate-dev] Optimizing reflection optimization
Hi, Recently my task involved enabling hibernate reflection optimization in our application. Versions used: hibernate-core-3.3.1.GA javassist-3.4.GA Below are some thoughts that hopefully could help to improve the product. 1. I have noticed that org.hibernate.bytecode.javassist.BulkAccessorFactory.findAccessors(...) is searching for accessor methods in the optimized entity class only. This means that the methods from the superclasses are not visible during BulkAccessor creation unless overridden by child classes. By enhancing the algorithm to search down the inheritance tree we could avoid creation of redundant methods which increase the code verbosity a lot. In our case almost all the entities are inherited from the base classes having the common entity properties defined, so the reflection optimization does not work for any of them until we override the inherited methods in all the child classes. The implementation is trivial, but I have got a ready prototype if anybody is interested. 2. It seems that it should be also possible to optimize the EntityTuplizer's getPropertyValue and setPropertyValue calls in the similar way how the getPropertyValues and setPropertyValues are currently optimized. Best regards, Kirill Klenski ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
[hibernate-dev] Database with UUID support
In regards to http://opensource.atlassian.com/projects/hibernate/browse/HHH-3579 I am trying to put together the best all around support for java.util.UUID we can as a type. Obviously most databases "support uuid" via char/varchar data type. Postgresql being the lone exception of which I am aware with their special UUID datatype, even though they choose to map it to java.sql.Types.OTHER (don't get me started). So for sure we can support UUID in every database. The next logical thought was supporting UUID as an identifier value. If we were to add that what I would really prefer is a way to obtain the UUID ahead of time (pre-insert) which would mean knowing what databases supported a UUID-generation function and, for those that did, what that function is. For those that do not, is using java.util.UUID.randomUUID() a viable alternative? A list of major databases and their support/non-support for generating UUID values that I know of are as follows: 1) postgresql - database itself does not support generation, instead relying on an optional module called uuid-ossp 2) mysql - supports generation via the UUID() function 3) h2 - supports generation via the RANDOM_UUID() 4) hsqldb - does not support generation afaict 5) derby - does not support generation afaict 6) db2 - does have a GENERATE_UNIQUE() function; was not able to tell if that is compatible with java.util.UUID 7) firebird - supports generation via GEN_UUID() 8) informix - does not support generation afaict 9) ingres - supports via UUID_CREATE() 10) oracle - supports via SYS_GUID() 11) maxdb (sapdb) - does not support generation afaict 12) mssql (sql server) - does have a NEWID() function, though it generates a string with hyphons in it; not sure how/if this value relates to java.util.UUID 13) sybase - like mssql also has a NEWID() function which here can additionally be given a parameter to say whether to include hyphons etc; again, not sure how/if this value relates to java.util.UUID 14) terradata - does not support generation afaict DISCLAIMER : When I say "does not support" I mean in the base server install. As I pointed out with postgresql I understand some might have additional optional or third-party modules that add such capabilities So by my count, that means that we can have pretty complete support for UUID on the following databases without any extra requirements: a) mysql b) h2 c) firebird d) ingres e) oracle Databases with potential support: a) postgresql - is it reasonable to require this uuid-ossp module? b) db2 - what is the compatibility of its GENERATE_UNIQUE() function with java.util.UUID? c) mssql/sybase - what is the compatibility of NEWID() function with with java.util.UUID? For databases which do not support UUID generation, the question becomes how do we support that in hibernate for identifiers? Do we rely on java.util.UUID.randomUUID()? Do you use a special generator like http://jug.safehaus.org/ ? Other options? Also, if anyone notices issues in my db support investigations please let me know. -- Steve Ebersole http://hibernate.org ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Optimizing reflection optimization
Hi, Have you noticed a perf difference in your application with and without the patch? I am wondering if modern VMs have catched up with what Javassist does. On 26 mai 2010, at 18:29, Кирилл Кленский wrote: > 1. I have noticed that > org.hibernate.bytecode.javassist.BulkAccessorFactory.findAccessors(...) is > searching for accessor methods in the optimized entity class only. This > means that the methods from the superclasses are not visible during > BulkAccessor creation unless overridden by child classes. By enhancing the > algorithm to search down the inheritance tree we could avoid creation of > redundant methods which increase the code verbosity a lot. In our case > almost all the entities are inherited from the base classes having the > common entity properties defined, so the reflection optimization does not > work for any of them until we override the inherited methods in all the > child classes. The implementation is trivial, but I have got a ready > prototype if anybody is interested. ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Database with UUID support
I prefer time based (version 1) UUID due the insert performance of random ID's. Though that sends you down the road of using a third party generator. FWIW http://johannburkard.de/software/uuid/ is recommended on the Apache Cassandra wiki. On Wed, May 26, 2010 at 2:24 PM, Steve Ebersole wrote: > In regards to > http://opensource.atlassian.com/projects/hibernate/browse/HHH-3579 I am > trying to put together the best all around support for java.util.UUID we > can as a type. > > Obviously most databases "support uuid" via char/varchar data type. > Postgresql being the lone exception of which I am aware with their > special UUID datatype, even though they choose to map it to > java.sql.Types.OTHER (don't get me started). So for sure we can support > UUID in every database. > > The next logical thought was supporting UUID as an identifier value. If > we were to add that what I would really prefer is a way to obtain the > UUID ahead of time (pre-insert) which would mean knowing what databases > supported a UUID-generation function and, for those that did, what that > function is. For those that do not, is using > java.util.UUID.randomUUID() a viable alternative? > > A list of major databases and their support/non-support for generating > UUID values that I know of are as follows: > > 1) postgresql - database itself does not support generation, instead > relying on an optional module called uuid-ossp > 2) mysql - supports generation via the UUID() function > 3) h2 - supports generation via the RANDOM_UUID() > 4) hsqldb - does not support generation afaict > 5) derby - does not support generation afaict > 6) db2 - does have a GENERATE_UNIQUE() function; was not able to tell if > that is compatible with java.util.UUID > 7) firebird - supports generation via GEN_UUID() > 8) informix - does not support generation afaict > 9) ingres - supports via UUID_CREATE() > 10) oracle - supports via SYS_GUID() > 11) maxdb (sapdb) - does not support generation afaict > 12) mssql (sql server) - does have a NEWID() function, though it > generates a string with hyphons in it; not sure how/if this value > relates to java.util.UUID > 13) sybase - like mssql also has a NEWID() function which here can > additionally be given a parameter to say whether to include hyphons etc; > again, not sure how/if this value relates to java.util.UUID > 14) terradata - does not support generation afaict > > DISCLAIMER : When I say "does not support" I mean in the base server > install. As I pointed out with postgresql I understand some might have > additional optional or third-party modules that add such capabilities > > > So by my count, that means that we can have pretty complete support for > UUID on the following databases without any extra requirements: > a) mysql > b) h2 > c) firebird > d) ingres > e) oracle > > Databases with potential support: > a) postgresql - is it reasonable to require this uuid-ossp module? > b) db2 - what is the compatibility of its GENERATE_UNIQUE() function > with java.util.UUID? > c) mssql/sybase - what is the compatibility of NEWID() function with > with java.util.UUID? > > For databases which do not support UUID generation, the question becomes > how do we support that in hibernate for identifiers? Do we rely on > java.util.UUID.randomUUID()? Do you use a special generator like > http://jug.safehaus.org/ ? Other options? > > Also, if anyone notices issues in my db support investigations please > let me know. > > -- > Steve Ebersole > http://hibernate.org > > ___ > hibernate-dev mailing list > hibernate-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Database with UUID support
The main drawback there imo is that it uses its own UUID implementation (com.eaio.uuid.UUID) rather than simply generating java.util.UUID. To do so you have "bridge" as pointed out in the Cassandra FAQ: http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java Not to mention the maven information he lists is inaccurate (there is no repo at http://eaio.com/maven2) and the latest posts on that website are from 2007. On Wed, 2010-05-26 at 15:30 -0600, Cody Lerum wrote: > I prefer time based (version 1) UUID due the insert performance of random > ID's. > > Though that sends you down the road of using a third party generator. > FWIW http://johannburkard.de/software/uuid/ is recommended on the > Apache Cassandra wiki. > > On Wed, May 26, 2010 at 2:24 PM, Steve Ebersole wrote: > > In regards to > > http://opensource.atlassian.com/projects/hibernate/browse/HHH-3579 I am > > trying to put together the best all around support for java.util.UUID we > > can as a type. > > > > Obviously most databases "support uuid" via char/varchar data type. > > Postgresql being the lone exception of which I am aware with their > > special UUID datatype, even though they choose to map it to > > java.sql.Types.OTHER (don't get me started). So for sure we can support > > UUID in every database. > > > > The next logical thought was supporting UUID as an identifier value. If > > we were to add that what I would really prefer is a way to obtain the > > UUID ahead of time (pre-insert) which would mean knowing what databases > > supported a UUID-generation function and, for those that did, what that > > function is. For those that do not, is using > > java.util.UUID.randomUUID() a viable alternative? > > > > A list of major databases and their support/non-support for generating > > UUID values that I know of are as follows: > > > > 1) postgresql - database itself does not support generation, instead > > relying on an optional module called uuid-ossp > > 2) mysql - supports generation via the UUID() function > > 3) h2 - supports generation via the RANDOM_UUID() > > 4) hsqldb - does not support generation afaict > > 5) derby - does not support generation afaict > > 6) db2 - does have a GENERATE_UNIQUE() function; was not able to tell if > > that is compatible with java.util.UUID > > 7) firebird - supports generation via GEN_UUID() > > 8) informix - does not support generation afaict > > 9) ingres - supports via UUID_CREATE() > > 10) oracle - supports via SYS_GUID() > > 11) maxdb (sapdb) - does not support generation afaict > > 12) mssql (sql server) - does have a NEWID() function, though it > > generates a string with hyphons in it; not sure how/if this value > > relates to java.util.UUID > > 13) sybase - like mssql also has a NEWID() function which here can > > additionally be given a parameter to say whether to include hyphons etc; > > again, not sure how/if this value relates to java.util.UUID > > 14) terradata - does not support generation afaict > > > > DISCLAIMER : When I say "does not support" I mean in the base server > > install. As I pointed out with postgresql I understand some might have > > additional optional or third-party modules that add such capabilities > > > > > > So by my count, that means that we can have pretty complete support for > > UUID on the following databases without any extra requirements: > > a) mysql > > b) h2 > > c) firebird > > d) ingres > > e) oracle > > > > Databases with potential support: > > a) postgresql - is it reasonable to require this uuid-ossp module? > > b) db2 - what is the compatibility of its GENERATE_UNIQUE() function > > with java.util.UUID? > > c) mssql/sybase - what is the compatibility of NEWID() function with > > with java.util.UUID? > > > > For databases which do not support UUID generation, the question becomes > > how do we support that in hibernate for identifiers? Do we rely on > > java.util.UUID.randomUUID()? Do you use a special generator like > > http://jug.safehaus.org/ ? Other options? > > > > Also, if anyone notices issues in my db support investigations please > > let me know. > > > > -- > > Steve Ebersole > > http://hibernate.org > > > > ___ > > hibernate-dev mailing list > > hibernate-dev@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > -- Steve Ebersole http://hibernate.org ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev
Re: [hibernate-dev] Database with UUID support
To his credit a UUID impl is not a 10 year project plan ;) I would not necessarily consider it abandonware rather than done. On 27 mai 2010, at 03:13, Steve Ebersole wrote: > and the latest posts on that website are > from 2007. ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev