From sanne at hibernate.org Mon Nov 3 09:41:12 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Mon, 3 Nov 2014 14:41:12 +0000 Subject: [hibernate-dev] Hibernate Search 5.0.0.Beta1 released! Message-ID: The Beta1 of Hibernate Search 5 is now available! I've described all great reasons to try it out here: http://in.relation.to/Bloggers/HibernateSearchReleases500Beta1TheFinalSprintBegins One warning though: the server hosting the blog is having some critical hardware problems and is being replaced, it can't currently handle any non-trivial load. If you see errors at the link, please try again later. Sanne From gbadner at redhat.com Mon Nov 3 14:56:42 2014 From: gbadner at redhat.com (Gail Badner) Date: Mon, 3 Nov 2014 14:56:42 -0500 (EST) Subject: [hibernate-dev] Hibernate ORM 4.3.7.Final and 4.2.15.Final Released In-Reply-To: <2145012636.4828607.1415044321346.JavaMail.zimbra@redhat.com> Message-ID: <169377276.4831985.1415044602167.JavaMail.zimbra@redhat.com> For details, see: http://in.relation.to/Bloggers/HibernateORM437FinalAnd4216FinalReleased These were actually released on October 30. The announcement has been delayed because the server hosting the blog is having critical hardware problems and I was not able to post my entry until today. If you have problems with that link, please try again later. Gail Badner Red Hat, Hibernate ORM From m.schipperheyn at gmail.com Tue Nov 4 09:47:51 2014 From: m.schipperheyn at gmail.com (Marc Schipperheyn) Date: Tue, 4 Nov 2014 12:47:51 -0200 Subject: [hibernate-dev] Was HSearch 4.4.5 ever released to Maven? Message-ID: I see it in Jira as a version, but in Maven only 4.4.4.Final is available. From sanne at hibernate.org Tue Nov 4 10:06:30 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Tue, 4 Nov 2014 15:06:30 +0000 Subject: [hibernate-dev] Was HSearch 4.4.5 ever released to Maven? In-Reply-To: References: Message-ID: Hi Marc, no sorry, I started the release: it was tagged and uploaded to our Nexus, and then had connectivity issues; after that I had some travel last week and when I could get back to it the staging repository had expired so I'll have to repeat the release from the tag. But the tag is valid, in case you need it urgently. I'll try to cleanup the mess at end of this week. Sanne On 4 November 2014 14:47, Marc Schipperheyn wrote: > I see it in Jira as a version, but in Maven only 4.4.4.Final is available. > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Thu Nov 6 10:42:41 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 6 Nov 2014 15:42:41 +0000 Subject: [hibernate-dev] Jira + pull requests In-Reply-To: <547cc56278f94858768becd2c38d0d@ip-10-0-3-132> References: <547cc56278f94858768becd2c38d0d@ip-10-0-3-132> Message-ID: Because the automated integration doesn't work at all if you rebase. I've considered disabling that JIRA plugin.. for now I'm hoping it will improve in future. On 6 November 2014 15:26, Hardy wrote: > OOI, why do you still add the pull request links manually to Jira. It's > nicely and automatically integrated anyways. > > -- hardy > > From sanne at hibernate.org Thu Nov 6 14:42:19 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 6 Nov 2014 19:42:19 +0000 Subject: [hibernate-dev] in.relation.to fixed Message-ID: All, the blog platform finally finished its migration to the new servers. If you still see errors, please let us know as that would be a new problem. Sanne From steve at hibernate.org Sat Nov 8 11:30:04 2014 From: steve at hibernate.org (Steve Ebersole) Date: Sat, 8 Nov 2014 10:30:04 -0600 Subject: [hibernate-dev] ORM build - IDE imports Message-ID: I have been thinking of ways to make importing ORM into IDE more transparent. My thinking is from the IntelliJ pov and the specific issues I have run into there. I wanted to run my thoughts past y'all to see if they helped with Eclipse and/or other IDEs. ----- The main thing I see is trouble with the generated-src dir. IntelliJ automatically "excludes" the build directory which is actually perfect, generally speaking. However, we put generated-src under the build dir so it gets excluded by extension as well. That's why after import we need to adjust excluded dirs and source dirs. My suggestion here is to move generated-src out from under the build dir, making it on level with src and target. So we'd have: {projectRoot} +- generated-src +- src \- target generated-src and target would both be directories that are created by the build and are git-ignored. The point being that IntelliJ would still exclude target as the main build dir, but generated-src is no longer under that dir and would not be excluded. In my experience the import marks the generated source dirs properly other than them being transitively excluded. ---- A related issue is the execution of source generators. This has already been partially been addressed. Today we have a split between: 1) source generators that generate sources required at compile time (antlr, jaxb, jpa-metamodel-gen, etc) 2) source generators that generate sources required at run time (currently only logging). There is also a concern here between AP-based generators and non-AP-based generators. And unfortunately they split across the compile/run time requirement. I am not really sure of an ideal solution here. And the situation is compounded by the fact that IntelliJ won't let us apply annotation processors to its compile process because of the hibernate-testing module circularity :( To be honest I think I'd alter jpa-metamodel-gen to not be AP-based as the best-case scenario. But that is not likely to happen soon. And coupled with the fact of the IntelliJ limitation due to hibernate-testing circularity, I am not sure it would practically help. It seems to me the only real option currently is to expect a full compile prior to import. Better suggestions? ---- Speaking of the hibernate-testing circularity, I do still want to get rid of that. Currently I have been waiting on Gradle adding support for publishing multiple artifacts from a project (module). The idea being that we'd fold the source from hibernate-testing into hibernate-core and have hibernate-core produce and publish both artifacts. Currently Gradle only supports a single publication from a project. So the hang up really is publishing hibernate-testing to nexus. I think we all agreed last time this was discussed that publishing hibernate-testing to nexus was important enough to hold off on. Do I remember that correctly? Is that still the situation? From gunnar at hibernate.org Mon Nov 10 04:20:36 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Mon, 10 Nov 2014 10:20:36 +0100 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: References: Message-ID: Hi, 2014-11-08 17:30 GMT+01:00 Steve Ebersole : > I have been thinking of ways to make importing ORM into IDE more > transparent. My thinking is from the IntelliJ pov and the specific issues > I have run into there. I wanted to run my thoughts past y'all to see if > they helped with Eclipse and/or other IDEs. > > ----- > > The main thing I see is trouble with the generated-src dir. IntelliJ > automatically "excludes" the build directory which is actually perfect, > generally speaking. However, we put generated-src under the build dir so > it gets excluded by extension as well. That's why after import we need to > adjust excluded dirs and source dirs. My suggestion here is to move > generated-src out from under the build dir, making it on level with src and > target. So we'd have: > > {projectRoot} > +- generated-src > +- src > \- target > > generated-src and target would both be directories that are created by the > build and are git-ignored. The point being that IntelliJ would still > exclude target as the main build dir, but generated-src is no longer under > that dir and would not be excluded. In my experience the import marks the > generated source dirs properly other than them being transitively excluded. > Having dirs with generated sources under "target" is a common situation, so I'm surprised that it isn't handled smoothly by the IntelliJ/Gradle combo. In Eclipse/Maven generated source dirs under "target" are automatically added as source folder upon import of a Maven project. For most (Maven) plug-ins generating sources this works out of the box, for others one can explicitly add the source source folder in the Maven POM so it will be recognized during IDE import. Maybe a similar approach exists for Gradle? ---- > > A related issue is the execution of source generators. This has already > been partially been addressed. Today we have a split between: > 1) source generators that generate sources required at compile time (antlr, > jaxb, jpa-metamodel-gen, etc) > 2) source generators that generate sources required at run time (currently > only logging). > > There is also a concern here between AP-based generators and non-AP-based > generators. And unfortunately they split across the compile/run time > requirement. I am not really sure of an ideal solution here. And the > situation is compounded by the fact that IntelliJ won't let us apply > annotation processors to its compile process because of the > hibernate-testing module circularity :( > > To be honest I think I'd alter jpa-metamodel-gen to not be AP-based as the > best-case scenario. But that is not likely to happen soon. And coupled > with the fact of the IntelliJ limitation due to hibernate-testing > circularity, I am not sure it would practically help. > It seems to me the only real option currently is to expect a full compile > prior to import. > > Better suggestions? > ---- > > Speaking of the hibernate-testing circularity, I do still want to get rid > of that. Currently I have been waiting on Gradle adding support for > publishing multiple artifacts from a project (module). The idea being that > we'd fold the source from hibernate-testing into hibernate-core and have > hibernate-core produce and publish both artifacts. Currently Gradle only > supports a single publication from a project. So the hang up really is > publishing hibernate-testing to nexus. I think we all agreed last time > this was discussed that publishing hibernate-testing to nexus was important > enough to hold off on. Do I remember that correctly? Is that still the > situation? > Removing the circularity would be great, it seems to be the cause of some of the issues. It'd also give a better experience for Eclipse users as this is reported as an error during import (which then can be suppressed). For Hibernate OGM we don't have a dependency to hibernate-testing, so we wouldn't need it to be in Nexus. --Gunnar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From galder at redhat.com Mon Nov 10 05:17:47 2014 From: galder at redhat.com (=?windows-1252?Q?Galder_Zamarre=F1o?=) Date: Mon, 10 Nov 2014 11:17:47 +0100 Subject: [hibernate-dev] Session factory name & clustering Message-ID: <3A92E31E-B7A7-47B3-AB11-F4B8150AEA63@redhat.com> Hi all, Re: http://stackoverflow.com/questions/26110918/infinispan-marshalling-error-for-hibernate-entity-with-composite-primary-key Re: https://github.com/hibernate/hibernate-orm/pull/820 Seems like the issue is resolved by making sure Session Factories have the same name. Is this something new? I?ve never had the need to set it in order to get Hibernate 2LC clustered tests working. None of my unit tests set the session factory name. One of my most recent demos uses JPA, and never had to set hibernate.session_factory_name property. Or is this due to the peculiarity of the Entity the user has? I?ve run some tests locally and SessionFactoryImpl.readResolve() does not seem to get called. @Paul/@Scott, have you seen anything similar before? Cheers, -- Galder Zamarre?o galder at redhat.com twitter.com/galderz From steve at hibernate.org Mon Nov 10 07:40:08 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 10 Nov 2014 06:40:08 -0600 Subject: [hibernate-dev] Session factory name & clustering In-Reply-To: <3A92E31E-B7A7-47B3-AB11-F4B8150AEA63@redhat.com> References: <3A92E31E-B7A7-47B3-AB11-F4B8150AEA63@redhat.com> Message-ID: It would depend on what is inside the CacheKey, which is the key object Hibernate passes to the second-level cache. Usually this situation comes up with the identifier Type(s), especially in the case of composite identifiers. Some of the Type implementations hold reference to the SessionFactory. Serializing those properly depends on being able to resolve the proper SessionFactory reference on deser, which can happen based on UUID (same JVM) or name (across JVMs). On Mon, Nov 10, 2014 at 4:17 AM, Galder Zamarre?o wrote: > Hi all, > > Re: > http://stackoverflow.com/questions/26110918/infinispan-marshalling-error-for-hibernate-entity-with-composite-primary-key > Re: https://github.com/hibernate/hibernate-orm/pull/820 > > Seems like the issue is resolved by making sure Session Factories have the > same name. > > Is this something new? I?ve never had the need to set it in order to get > Hibernate 2LC clustered tests working. None of my unit tests set the > session factory name. One of my most recent demos uses JPA, and never had > to set hibernate.session_factory_name property. > > Or is this due to the peculiarity of the Entity the user has? I?ve run > some tests locally and SessionFactoryImpl.readResolve() does not seem to > get called. > > @Paul/@Scott, have you seen anything similar before? > > Cheers, > -- > Galder Zamarre?o > galder at redhat.com > twitter.com/galderz > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From steve at hibernate.org Mon Nov 10 07:46:50 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 10 Nov 2014 06:46:50 -0600 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: References: Message-ID: > > >> Having dirs with generated sources under "target" is a common situation, > so I'm surprised that it isn't handled smoothly by the IntelliJ/Gradle > combo. > > In Eclipse/Maven generated source dirs under "target" are automatically > added as source folder upon import of a Maven project. For most (Maven) > plug-ins generating sources this works out of the box, for others one can > explicitly add the source source folder in the Maven POM so it will be > recognized during IDE import. > > Maybe a similar approach exists for Gradle? > Like I said initially, the import does already mark the generated source dirs as sources. That is not the problem. The problem is IntelliJ's notion of "excluded dirs" which allows users to tell IntelliJ to not scan those dirs; think of it as an "ignore" flag. The trouble is that the import marks the Gradle build dir (our target dir) as excluded. So even though the directories under target are marked as source, it is irrelevant because the parent dir has been marked excluded. From steve at hibernate.org Mon Nov 10 08:04:18 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 10 Nov 2014 07:04:18 -0600 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: <20141110094711.GA34385@sarmakand.lan> References: <20141110094711.GA34385@sarmakand.lan> Message-ID: > > > Personally, I am not a big fan of changing build structure for the purpose > of an > IDE. generated-src belong imo into target. > > That said, I know the troubles of having to manually adjust the Idea > configuration > after importing. If it bothers you so much or if you had several reports > of people > having problems setting up the project in the IDE, I's say go for it. > Yes, this is completely a pragmatic consideration. I set the build up with generated-src under target because that is what I believe is proper in the idyllic sense. But at some point I'd like to have an import that JustWorks(tm). > > To be honest I think I'd alter jpa-metamodel-gen to not be AP-based as > the > > best-case scenario. > > Not sure what you mean? Are you referring to the actual annotation > processor module > or do you mean that you want to statically check in the generated meta > model classes > needed for our tests in the hibernate-core/hibernate-entitymanager module? > I assume > the latter. Again, not a big fan. > No, I actually mean the former. Probably as an alternative to the AP-based generation, I think a non-AP solution would be good. After having talked to David a few times about this, I believe annotation processing is not the proper way to be generating these classes. My new belief is that annotation processors that generate code that is then needed to compile is bad mojo. > > > It seems to me the only real option currently is to expect a full compile > > prior to import. > > Right. Something I would recommend anyways. > Dunno here. Often my initial touch point with a project is to check out the code and import it into the IDE. And I think that I am not unusual in that sense, so I think there is a ton of value in that working smoothly. > Speaking of the hibernate-testing circularity, I do still want to get rid > > of that. Currently I have been waiting on Gradle adding support for > > publishing multiple artifacts from a project (module). > > That would be nice. Is there an issue for that? Did they agree on > implementing > it? > They said it was something they wanted to do. I'll follow up to see if it was ever done. From hardy at hibernate.org Mon Nov 10 08:26:24 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Mon, 10 Nov 2014 14:26:24 +0100 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: References: <20141110094711.GA34385@sarmakand.lan> Message-ID: <20141110132624.GC36179@sarmakand.lan> Hi, > > > To be honest I think I'd alter jpa-metamodel-gen to not be AP-based as > > the > > > best-case scenario. > > > > Not sure what you mean? Are you referring to the actual annotation > > processor module > > or do you mean that you want to statically check in the generated meta > > model classes > > needed for our tests in the hibernate-core/hibernate-entitymanager module? > > I assume > > the latter. Again, not a big fan. > > > > No, I actually mean the former. Probably as an alternative to the AP-based > generation, I think a non-AP solution would be good Interesting. For me the metamodel generation is a classic example for using an annotation processor. > After having talked > to David a few times about this, I believe annotation processing is not the > proper way to be generating these classes What would be the right way then in your opinion? > annotation processors that generate code that is then needed to compile Not sure. IMO the annotation processor is designed for exactly that. In fact if you run the processor as part of the main compilation it does generation and compilation in the same build phase. I don't see the bad mojo here. > > > It seems to me the only real option currently is to expect a full compile > > > prior to import. > > > > Right. Something I would recommend anyways. > > Dunno here. Often my initial touch point with a project is to check out > the code and import it into the IDE. And I think that I am not unusual in > that sense, so I think there is a ton of value in that working smoothly. Sure, there is value in making it work smoothly. However, I prefer to start the command line build first after checking out the code. > > That would be nice. Is there an issue for that? Did they agree on > > implementing > > it? > > > > They said it was something they wanted to do. I'll follow up to see if it > was ever done. Cool --Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 496 bytes Desc: not available Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20141110/9b809a9b/attachment.bin From steve at hibernate.org Mon Nov 10 09:48:41 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 10 Nov 2014 08:48:41 -0600 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: <20141110132624.GC36179@sarmakand.lan> References: <20141110094711.GA34385@sarmakand.lan> <20141110132624.GC36179@sarmakand.lan> Message-ID: On Mon, Nov 10, 2014 at 7:26 AM, Hardy Ferentschik wrote: > Hi, > > > > > To be honest I think I'd alter jpa-metamodel-gen to not be AP-based > as > > > the > > > > best-case scenario. > > > > > > Not sure what you mean? Are you referring to the actual annotation > > > processor module > > > or do you mean that you want to statically check in the generated meta > > > model classes > > > needed for our tests in the hibernate-core/hibernate-entitymanager > module? > > > I assume > > > the latter. Again, not a big fan. > > > > > > > No, I actually mean the former. Probably as an alternative to the > AP-based > > generation, I think a non-AP solution would be good > > Interesting. For me the metamodel generation is a classic example for using > an annotation processor. > I think that's true *if* the compilation unit producing the metamodel is not also the one consuming it. For example a CRM project that produces and bundles a JPA static metamodel of its domain model for developer use. However, in cases where we try to both produce and consume the static metamodel from the same compilation unit as we do in our usages. I think about the whole point of AP, and as a user especially this static metamodel. So I am writing code in which I am relying on this static metamodel for type-safety, but I cannot even do that as the static metamodel types dont even exist. Until I introduce some unnatural (imo) step into the development process: develop, then compile so that I can develop some more. > > After having talked > > to David a few times about this, I believe annotation processing is not > the > > proper way to be generating these classes > > What would be the right way then in your opinion? > Well again I am pointing out the appropriateness of each. I think the AP approach makes sense in certain cases. Just that our case within the Hibernate build is not one of these. I think a tool leveraging source code reading/analysis > > > annotation processors that generate code that is then needed to compile > > Not sure. IMO the annotation processor is designed for exactly that. In > fact if you > run the processor as part of the main compilation it does generation and > compilation > in the same build phase. I don't see the bad mojo here. > I consider it bad mojo because I load it up into the IDE and see red all over the place. Yes I realize we have the same with Antlr and/or JAXB. But I can completely rationalize running a source code generation *tool* here. I have a hard time making that rationalization for running the compiler in order to see if my code will compile due to sources that are not there :) > > > > It seems to me the only real option currently is to expect a full > compile > > > > prior to import. > > > > > > Right. Something I would recommend anyways. > I fully understand about needing/recommending some task prior to importing. Specifically a source-generation task. I just don't think I am alone in not immediately assuming/grokking a full compilation as the source-generation task. > > > > Dunno here. Often my initial touch point with a project is to check out > > the code and import it into the IDE. And I think that I am not unusual > in > > that sense, so I think there is a ton of value in that working smoothly. > > Sure, there is value in making it work smoothly. However, I prefer to > start the > command line build first after checking out the code. > I am not so sure that is the norm. For sure it is not generally what I do at least. Projects tend to have such widely differing build assumptions and requirements. When you first check it out, how do you know what command line to do? From smarlow at redhat.com Mon Nov 10 11:07:18 2014 From: smarlow at redhat.com (Scott Marlow) Date: Mon, 10 Nov 2014 11:07:18 -0500 Subject: [hibernate-dev] Session factory name & clustering In-Reply-To: References: <3A92E31E-B7A7-47B3-AB11-F4B8150AEA63@redhat.com> Message-ID: <5460E2B6.50509@redhat.com> On 11/10/2014 07:40 AM, Steve Ebersole wrote: > It would depend on what is inside the CacheKey, which is the key object > Hibernate passes to the second-level cache. Usually this situation > comes up with the identifier Type(s), especially in the case of > composite identifiers. Some of the Type implementations hold reference > to the SessionFactory. Serializing those properly depends on being able > to resolve the proper SessionFactory reference on deser, which can > happen based on UUID (same JVM) or name (across JVMs). > > On Mon, Nov 10, 2014 at 4:17 AM, Galder Zamarre?o > wrote: > > Hi all, > > Re: > http://stackoverflow.com/questions/26110918/infinispan-marshalling-error-for-hibernate-entity-with-composite-primary-key This user found the "hibernate.session_factory_name" + "hibernate.session_factory_name_is_jndi" settings and HHH-6822. > Re: https://github.com/hibernate/hibernate-orm/pull/820 > > Seems like the issue is resolved by making sure Session Factories > have the same name. > > Is this something new? I?ve never had the need to set it in order to > get Hibernate 2LC clustered tests working. None of my unit tests set > the session factory name. One of my most recent demos uses JPA, and > never had to set hibernate.session_factory_name property. > > Or is this due to the peculiarity of the Entity the user has? I?ve > run some tests locally and SessionFactoryImpl.readResolve() does not > seem to get called. If the local test serializes the SF UUID and then deserializes from the same JVM, the test should pass (as long as the same Hibernate classloader is used). If you are involving multiple JVMs, the SF UUIDs are local to each JVM, so you should see failures when deserializing on a different JVM (as the SF UUID lookup will fail). > > @Paul/@Scott, have you seen anything similar before? For EE container deployments, we set the "hibernate.session_factory_name" if the application doesn't. We set it to an application scoped unique name (deployment archive name (including sub-deployment reference) and the persistence unit name). > > Cheers, > -- > Galder Zamarre?o > galder at redhat.com > twitter.com/galderz > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > From Sujit.Dhaygude at sungard.com Tue Nov 11 07:39:51 2014 From: Sujit.Dhaygude at sungard.com (Sujit.Dhaygude at sungard.com) Date: Tue, 11 Nov 2014 12:39:51 +0000 Subject: [hibernate-dev] Exception handling in hibernate Message-ID: Hi , we have a requirement to point a record for which the actual batch flush/commit has failed. Is there a generic way by which hibernate can be hooked up for exception scenario to pull back the actual entity for which DB/Hibernate Error has occurred . Most of the times we could see the hibernate is printing the error in logs which has entity ID but which is not consistent. Currently we are planning to use the Pre and Post (insert/Update/Delete) event handlers to retain the entities in Thread local and display those in case of error, but these listeners will intercept all the DB operation irrespective of success/failure . I am looking for a solution which will not impact the overall application performance and only in case of exception we need the details of entity. Regards, Sujit From Nitin.Prabhu at mastek.com Tue Nov 11 08:00:36 2014 From: Nitin.Prabhu at mastek.com (Nitin G. Prabhu) Date: Tue, 11 Nov 2014 18:30:36 +0530 Subject: [hibernate-dev] Hibernate invkoing onFlushDirty for umodified objects in Set Message-ID: <305192DBBFDF8F41AF7879DE170FDEB006AB1AFE4F@IND-MHP1MCL001.mastek.com> Hi All, I have a object with below relationship public class A { @Id @SequenceGenerator(name = "ID_GENERATOR", sequenceName = "Id_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID_GENERATOR") @Column(name = "id") private BigDecimal id; @OneToMany(mappedBy = MST, orphanRemoval = true, cascade = { CascadeType.ALL}) @OrderBy("id DESC") private List b = new ArrayList(); @Column(name = "name") private String name; } When I modify class A'S SAY name attribute and say dao.persist(A) then onFlushDirty()[overridden in my Hibernate interceptor] is also invoked even if B object is not modified I am not understanding why hibernate is treating List objects to be dirty when I am trying to save the parent object A Regards, Nitin MASTEK LTD. In the US, we're called MAJESCOMASTEK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From steve at hibernate.org Thu Nov 13 13:42:45 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 13 Nov 2014 12:42:45 -0600 Subject: [hibernate-dev] Query handling : Antlr 3 versus Antlr 4 Message-ID: As most of you know already, we are planning to redesign the current Antlr-based HQL/JPQL parser in ORM for a variety of reasons. The current approach in the translator (Antlr 2 based, although Antlr 3 supports the same model) is that we actually define multiple grammars/parsers which progressively re-write the tree adding more and more semantic information; think of this as multiple passes or phases. The current code has 3 phases: 1) parsing - we simply parse the HQL/JPQL query into an AST, although we do do one interesting (and uber-important!) re-write here where we "hoist" the from clause in front of all other clauses. 2) rough semantic analysis - the current code, to be honest, sucks here. The end result of this phase is a tree that mixes normalized semantic information with lots of SQL fragments. It is extremely fugly 3) rendering to SQL The idea of phases is still the best way to attack this translation imo. I just think we did not implement the phases very well before; we were just learning Antlr at the time. So part of the redesign here is to leverage our better understanding of Antlr and design some better trees. The other big reason is to centralize the generation of SQL into one place rather than the 3 different places we do it today (not to mention the many, many places we render SQL fragments). Part of the process here is to decide which parser to use. Antlr 2 is ancient :) I used Antlr 3 in the initial prototyping of this redesign because it was the most recent release at that time. In the interim Antlr 4 has been released. I have been evaluating whether Antlr 4 is appropriate for our needs there. Antlr 4 is a pretty big conceptual deviation from Antlr 2/3 in quite a few ways. Generally speaking, Antlr 4 is geared more towards interpreting rather than translating/transforming. It can handle "transformation" if the transformation is the final step in the process. Transformations is where tree re-writing comes in handy. First lets step back and look at the "conceptual model" of Antlr 4. The grammar is used to produce: 1) the parser - takes the input and builds a "parse tree" based on the rules of the lexer and grammar. 2) listener/visitor for parse-tree traversal - can optionally generate listeners or visitors (or both) for traversing the parse tree (output from parser). There are 2 highly-related changes that negatively impact us: 1) no tree grammars/parsers 2) no tree re-writing Our existing translator is fundamentally built on the concepts of tree parsers and tree re-writing. Even the initial prototypes for the redesign (and the current state of hql-parser which Sanne and Gunnar picked up from there) are built on those concepts. So moving to Antlr 4 in that regard does represent a risk. How big of a risk, and whether that risk is worth it, is what we need to determine. What does all this mean in simple, practical terms? Let's look at a simple query: "select c.headquarters.state.code from Company c". Simple syntactic analysis will produce a tree something like: [QUERY] [SELECT] [DOT] [DOT] [DOT] [IDENT, "c"] [IDENT, "headquarters"] [IDENT, "state"] [IDENT, "code"] [FROM] [SPACE] [SPACE_ROOT] [IDENT, "Customer"] [IDENT, "c"] There is not a lot of semantic (meaning) information here. A more semantic representation of the query would look something like: [QUERY] [SELECT] [ATTRIBUTE_REF] [ALIAS_REF, ""] [IDENT, "code"] [FROM] [SPACE] [PERSISTER_REF] [ENTITY_NAME, "com.acme.Customer"] [ALIAS, "c"] [JOIN] [INNER] [ATTRIBUTE_JOIN] [IDENT, "headquarters"] [ALIAS, ""] [JOIN] [INNER] [ATTRIBUTE_JOIN] [IDENT, "state"] [ALIAS, ""] Notice especially the difference in the tree rules. This is tree re-writing, and is the major difference affecting us. Consider a specific thing like the "c.headquarters.state.code" DOT-IDENT sequence. Essentially Antlr 4 would make us deal with that as a DOT-IDENT sequence through all the phases - even SQL generation. Quite fugly. The intent of Antlr 4 in cases like this is to build up an external state table (external to the tree itself) or what Antlr folks typically refer to as "iterative tree decoration"[1]. So with Antlr 4, in generating the SQL, we would still be handling calls in terms of "c.headquarters.state.code" in the SELECT clause and resolving that through the external symbol tables. Again, with Antlr 4 we would always be walking that initial (non-semantic) tree. Unless I am missing something. I would be happy to be corrected, if anyone knows Antlr 4 better. I have also asked as part of the antlr-discussion group[2]. In my opinion though, if it comes down to us needing to walk the tree in that first form across all phases I just do not see the benefit to moving to Antlr 4. P.S. When I say SQL above I really just mean the target query language for the back-end data store whether that be SQL targeting a RDBMS for ORM or a NoSQL store for OGM. [1] I still have not fully grokked this paradigm, so I may be missing something, but... AFAICT even in this paradigm the listener/visitor rules are defined in terms of the initial parse tree rules rather than more [2] https://groups.google.com/forum/#!topic/antlr-discussion/hzF_YrzfDKo From steve at hibernate.org Thu Nov 13 13:44:14 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 13 Nov 2014 12:44:14 -0600 Subject: [hibernate-dev] Exception handling in hibernate In-Reply-To: References: Message-ID: Andreas is working on some redesign of batching which should allow us to report such detailed information iirc. Andreas, what are your thoughts on doing this in the new batching code? On Tue, Nov 11, 2014 at 6:39 AM, wrote: > Hi , > we have a requirement to point a record for which the actual batch > flush/commit has failed. > Is there a generic way by which hibernate can be hooked up for exception > scenario to pull back the actual entity for which > DB/Hibernate Error has occurred . > > Most of the times we could see the hibernate is printing the error in logs > which has entity ID but which is not consistent. > > Currently we are planning to use the Pre and Post (insert/Update/Delete) > event handlers to retain the entities in Thread local > and display those in case of error, but these listeners will intercept all > the DB operation irrespective of success/failure . > > I am looking for a solution which will not impact the overall application > performance and only in case of exception we need the details of entity. > > > Regards, > Sujit > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From dreborier at gmail.com Fri Nov 14 03:35:39 2014 From: dreborier at gmail.com (andrea boriero) Date: Fri, 14 Nov 2014 09:35:39 +0100 Subject: [hibernate-dev] Exception handling in hibernate In-Reply-To: References: Message-ID: I think it can be done as part of the new redesign. On 13 November 2014 19:44, Steve Ebersole wrote: > Andreas is working on some redesign of batching which should allow us to > report such detailed information iirc. Andreas, what are your thoughts on > doing this in the new batching code? > > On Tue, Nov 11, 2014 at 6:39 AM, wrote: > > > Hi , > > we have a requirement to point a record for which the actual batch > > flush/commit has failed. > > Is there a generic way by which hibernate can be hooked up for exception > > scenario to pull back the actual entity for which > > DB/Hibernate Error has occurred . > > > > Most of the times we could see the hibernate is printing the error in > logs > > which has entity ID but which is not consistent. > > > > Currently we are planning to use the Pre and Post (insert/Update/Delete) > > event handlers to retain the entities in Thread local > > and display those in case of error, but these listeners will intercept > all > > the DB operation irrespective of success/failure . > > > > I am looking for a solution which will not impact the overall application > > performance and only in case of exception we need the details of entity. > > > > > > Regards, > > Sujit > > > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From emmanuel at hibernate.org Fri Nov 14 11:39:44 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Fri, 14 Nov 2014 17:39:44 +0100 Subject: [hibernate-dev] [OGM-452] Abstraction work between OGM internal keys and Infinispan cache keys Message-ID: <59CAB33D-C6C3-4771-881B-0C32D24D12F1@hibernate.org> Hi Gunnar, I have not implemented the new strategy yet but here is the first pass on the abstraction and contract to allow the ogm key / cache key split. Take a look if you have time. https://github.com/emmanuelbernard/hibernate-ogm/tree/OGM-452 I need to implement the new cache key types, their marshallers and eagerly initialize all caches. From sanne at hibernate.org Sat Nov 15 14:58:38 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Sat, 15 Nov 2014 19:58:38 +0000 Subject: [hibernate-dev] Hibernate ORM master - 5.0 In-Reply-To: References: Message-ID: Hi Steve, the dom4j problem applies to Java 9: it depends on internal JDK APIs which are being removed. Considering Java 9 is coming fast, I agree we should get rid of that urgently as dom4j will simply not work anymore. I was looking into the state of the (very few) small fixes which I had only fixed in master. For example HHH-7699 was previously resolved with a "Fix version:" JIRA attribute having value "5.0". This was now marked as "6.0", but also marked Resolved. In fact, it's not going to be fixed in 6.0 if nobody ports it. I could fix the specific case, but I suspect there might be many more in a similar misleading state? Maybe we should mass-reopen them, but also label them with something like "Fix can be found in branch metamodel-old" ? [1] https://hibernate.atlassian.net/browse/HHH-7699 Sanne On 31 October 2014 11:25, Steve Ebersole wrote: > One other thing I just realized wrt 5.0. Currently moving to Jandex is > marked as an optional task. However, part of the code Jandex is replacing > is that old hibernate-commons-annotations stuff. > hibernate-commons-annotations suffers from a number of problems that we > maybe should consider increasing the priority of this task as well. Most > problematic is the fact that it uses TCCL-based classloading. > > On Thu, Oct 30, 2014 at 10:44 AM, Steve Ebersole > wrote: > >> It was decided that the massive work for 5.0 including metamodel and all >> the other changes was just taking too long, and that we'd split that work >> up into a number of intermediate versions. I wanted to highlight the >> proposed breakdown and solidify the roadmaps. The preliminary breakdown is >> as follows: >> >> >> - 5.0 >> - Java 6 or 7 (?) >> - EE 7 (JPA 2.1) >> - Wildfly 9 >> - Timeline : Spring 2015 >> - Required development >> - Transition to new bootstrapping APIs >> - MetadataSources, contributors, builders, etc for building >> SessionFactory >> - Keep Configuration as a migration aid, but align its >> processing and assumptions to follow new APIs >> - New naming strategy approach (implicit and physical split) >> - Pick "important" features from metamodel work based on new >> bootstrapping API >> - automatic quoting of identifiers that are keywords >> - ??? >> - Performance improvements >> - Cachng SPI changes based on feedback from Ehcahce and >> Infinispan >> - EntityKey proposal >> - Explore unifying entry keys for actual cache provider, >> cache SPI (CacheKey) and persistence-context (EntityKey) >> - Infinispan improvements, especially in local mode. Will >> require integrating a new Infinispan version and possible changes to >> hibernate-infinispan >> - ??? >> - OGM integration >> - "after persisters built" hook >> - others? >> - Java 8 type support >> - Date/Time >> - Optional >> - Java 9 type support >> - Money/Currency >> - Optional development (as time, resources allow) >> - Discriminator based multitenancy >> - JAXB instead of dom4j. >> - extended orm.xml xsd, deprecating hbm.xml format >> - Jandex usage >> - JdbcSession >> - Hibernate Spatial integration (depends on level of dependence >> on metamodel) >> - 5.1 >> - Java 6 or 7 (?) >> - EE 7 (JPA 2.1) >> - Widfly 9, or 10 >> - Timeline : TBD (Fall 2016?) >> - Required development >> - slips from 5.0 >> - new HQL parser >> - Antlr 3 or 4? >> - unified SQL generation? or limit to HQL parsing? >> - Optional development (as time, resources allow) >> - extend JPA criteria API with support for constructs from >> Hibernate's legacy criteria API >> - extend JPA criteria API with fluent support >> - Possibly - Override EAGER fetching with LAZY (fetch profiles, >> HQL, etc) >> - 5.2 >> - (if needed) >> - Java 6 or 7 (?) >> - EE 7 (JPA 2.1) >> - Widfly 9, or 10 >> - Required development >> - splits from 5.1 >> - 6.0 >> - SE and EE support levels TBD, but at least SE 8 >> - Required development >> - metamodel >> >> >> One additional consideration... I have been told (have not verified the >> details yet myself) that Hibernate ORM will currently not run in Java 8 at >> least in part because dom4j will not work in Java 8 (maybe just the version >> we use? again, have not verified details yet). If running 5.x versions of >> Hibernate in Java 8 is important to anyone, we might need to increase the >> priority of moving to JAXB over dom4j. >> >> > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Sat Nov 15 16:12:55 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Sat, 15 Nov 2014 21:12:55 +0000 Subject: [hibernate-dev] Allowing auto-close usage for Session Message-ID: I was expecting this to be a trivial and non-API breaking change, but it turns out the close() method for Session doesn't return void, and so is not compatible with the Closeable inteface: /** * End the session by releasing the JDBC connection and cleaning up. It is * not strictly necessary to close the session but you must at least * {@link #disconnect()} it. * * @return the connection provided by the application or null. * @throws HibernateException Indicates problems cleaning up. */ public Connection close() throws HibernateException; So this change can't be applied in 4.3 yet, but I'd hope to finally send a PR for 5.0 at least; Assuming that some applications really need that Connection instance, my proposal would be to split the functionality across two methods: public Connection closeAndReturnConnection(); public void close(); Any better names / ideas? Second question: we had previously decided to implement java.io.Closeable, so that it would work also for users of Java6. But if for the above reason, this is getting into master only, then I guess we could reopen that subject: would you prefer to have it extend just java.lang.AutoCloseable ? Sanne From steve at hibernate.org Sun Nov 16 11:57:58 2014 From: steve at hibernate.org (Steve Ebersole) Date: Sun, 16 Nov 2014 10:57:58 -0600 Subject: [hibernate-dev] Allowing auto-close usage for Session In-Reply-To: References: Message-ID: Ugh. The returning of Connection is a legacy thing that honestly makes no sense imo. I am sorry; I had forgotten it returned that. I say it makes no sense, because these are cases where the user has explicitly provided Hibernate the Connection to use when opening the Session. Its just silly imo to then think it does not know that Connection later. As you say, we are obviously stuck for 4.x. But for 5.x my vote would actually be to just change the return type, from: public Connection close() throws HibernateException; to: public void close() throws HibernateException; Then Closeable/AutoCloseable fits. As for base lining on Java 7, I am just not seeing the benefit there. On Sat, Nov 15, 2014 at 3:12 PM, Sanne Grinovero wrote: > I was expecting this to be a trivial and non-API breaking change, but > it turns out the close() method for Session doesn't return void, and > so is not compatible with the Closeable inteface: > > /** > * End the session by releasing the JDBC connection and cleaning up. > It is > * not strictly necessary to close the session but you must at least > * {@link #disconnect()} it. > * > * @return the connection provided by the application or null. > * @throws HibernateException Indicates problems cleaning up. > */ > public Connection close() throws HibernateException; > > So this change can't be applied in 4.3 yet, but I'd hope to finally > send a PR for 5.0 at least; > > Assuming that some applications really need that Connection instance, > my proposal would be to split the functionality across two methods: > > public Connection closeAndReturnConnection(); > > public void close(); > > Any better names / ideas? > > Second question: we had previously decided to implement > java.io.Closeable, so that it would work also for users of Java6. But > if for the above reason, this is getting into master only, then I > guess we could reopen that subject: would you prefer to have it extend > just java.lang.AutoCloseable ? > > Sanne > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Mon Nov 17 14:11:20 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Mon, 17 Nov 2014 19:11:20 +0000 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: References: <20141110094711.GA34385@sarmakand.lan> <20141110132624.GC36179@sarmakand.lan> Message-ID: I just tried to import it in Eclipse. Compiling it once from the command line upfront helped to reduce the errors.. but I still have 10, and while I suspect one of them relates to a bug in Eclipse's not-so-smart handling of generics, the others to me look like it shouldn't compile so I'm going to need some hand-holding on each of them. Some examples: EnhancerTask class not found: seems to be a groovy class. Do I need to setup the project as Groovy, or get some Groovy SDK installed as well? package-info.java sources in the jpamodelgen module seem to be in the wrong package - or they are missing the package declaration. They also have the wrong license header (JBoss instead of Hibernate, Apache instead of LGPL). Code snippet "CoreMatchers.notNullValue()" doesn't compile as the method is not generic. Apparently IDEA and javac consider this acceptable, but Eclipse won't. May I remove the generics usage? I've sent a PR proposal here which includes a second problem with generics: https://github.com/hibernate/hibernate-orm/pull/843 Sanne On 10 November 2014 14:48, Steve Ebersole wrote: > On Mon, Nov 10, 2014 at 7:26 AM, Hardy Ferentschik > wrote: > >> Hi, >> >> > > > To be honest I think I'd alter jpa-metamodel-gen to not be AP-based >> as >> > > the >> > > > best-case scenario. >> > > >> > > Not sure what you mean? Are you referring to the actual annotation >> > > processor module >> > > or do you mean that you want to statically check in the generated meta >> > > model classes >> > > needed for our tests in the hibernate-core/hibernate-entitymanager >> module? >> > > I assume >> > > the latter. Again, not a big fan. >> > > >> > >> > No, I actually mean the former. Probably as an alternative to the >> AP-based >> > generation, I think a non-AP solution would be good >> >> Interesting. For me the metamodel generation is a classic example for using >> an annotation processor. >> > > I think that's true *if* the compilation unit producing the metamodel is > not also the one consuming it. For example a CRM project that produces and > bundles a JPA static metamodel of its domain model for developer use. > > However, in cases where we try to both produce and consume the static > metamodel from the same compilation unit as we do in our usages. I think > about the whole point of AP, and as a user especially this static > metamodel. So I am writing code in which I am relying on this static > metamodel for type-safety, but I cannot even do that as the static > metamodel types dont even exist. Until I introduce some unnatural (imo) > step into the development process: develop, then compile so that I can > develop some more. > > >> > After having talked >> > to David a few times about this, I believe annotation processing is not >> the >> > proper way to be generating these classes >> >> What would be the right way then in your opinion? >> > > Well again I am pointing out the appropriateness of each. I think the AP > approach makes sense in certain cases. Just that our case within the > Hibernate build is not one of these. I think a tool leveraging source code > reading/analysis > > >> >> > annotation processors that generate code that is then needed to compile >> >> Not sure. IMO the annotation processor is designed for exactly that. In >> fact if you >> run the processor as part of the main compilation it does generation and >> compilation >> in the same build phase. I don't see the bad mojo here. >> > > I consider it bad mojo because I load it up into the IDE and see red all > over the place. Yes I realize we have the same with Antlr and/or JAXB. > But I can completely rationalize running a source code generation *tool* > here. > > I have a hard time making that rationalization for running the compiler in > order to see if my code will compile due to sources that are not there :) > > >> > > > It seems to me the only real option currently is to expect a full >> compile >> > > > prior to import. >> > > >> > > Right. Something I would recommend anyways. >> > > I fully understand about needing/recommending some task prior to > importing. Specifically a source-generation task. I just don't think I am > alone in not immediately assuming/grokking a full compilation as the > source-generation task. > > > >> > >> > Dunno here. Often my initial touch point with a project is to check out >> > the code and import it into the IDE. And I think that I am not unusual >> in >> > that sense, so I think there is a ton of value in that working smoothly. >> >> Sure, there is value in making it work smoothly. However, I prefer to >> start the >> command line build first after checking out the code. >> > > I am not so sure that is the norm. For sure it is not generally what I do > at least. Projects tend to have such widely differing build assumptions > and requirements. When you first check it out, how do you know what > command line to do? > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From steve at hibernate.org Mon Nov 17 16:37:03 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 17 Nov 2014 15:37:03 -0600 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: References: <20141110094711.GA34385@sarmakand.lan> <20141110132624.GC36179@sarmakand.lan> Message-ID: On Mon, Nov 17, 2014 at 1:11 PM, Sanne Grinovero wrote: > I just tried to import it in Eclipse. > Compiling it once from the command line upfront helped to reduce the > errors.. but I still have 10, and while I suspect one of them relates > to a bug in Eclipse's not-so-smart handling of generics, the others to > me look like it shouldn't compile so I'm going to need some > hand-holding on each of them. > > Some examples: > > EnhancerTask class not found: seems to be a groovy class. Do I need to > setup the project as Groovy, or get some Groovy SDK installed as well? > Sorry, I do not know how Eclipse works. In IntelliJ there is nothing extra to do for Groovy sources. As long as the directory is set as a "source root" it'll work > > package-info.java sources in the jpamodelgen module seem to be in the > wrong package - or they are missing the package declaration. They also > have the wrong license header (JBoss instead of Hibernate, Apache > instead of LGPL). > I see package-info.java files that actually have no package statement. Is that what you mean? > > Code snippet "CoreMatchers.notNullValue()" doesn't compile as > the method is not generic. Apparently IDEA and javac consider this > acceptable, but Eclipse won't. May I remove the generics usage? > Where do you see this? From sanne at hibernate.org Mon Nov 17 19:27:59 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Tue, 18 Nov 2014 00:27:59 +0000 Subject: [hibernate-dev] ORM build - IDE imports In-Reply-To: References: <20141110094711.GA34385@sarmakand.lan> <20141110132624.GC36179@sarmakand.lan> Message-ID: On 17 November 2014 21:37, Steve Ebersole wrote: > > On Mon, Nov 17, 2014 at 1:11 PM, Sanne Grinovero > wrote: >> >> I just tried to import it in Eclipse. >> Compiling it once from the command line upfront helped to reduce the >> errors.. but I still have 10, and while I suspect one of them relates >> to a bug in Eclipse's not-so-smart handling of generics, the others to >> me look like it shouldn't compile so I'm going to need some >> hand-holding on each of them. >> >> Some examples: >> >> EnhancerTask class not found: seems to be a groovy class. Do I need to >> setup the project as Groovy, or get some Groovy SDK installed as well? > > > Sorry, I do not know how Eclipse works. In IntelliJ there is nothing extra > to do for Groovy sources. As long as the directory is set as a "source > root" it'll work It's not a priority as one can simply close that module and have it built only on command line. This one is the easy to work around, I only mentioned it as all the small things add up. >> package-info.java sources in the jpamodelgen module seem to be in the >> wrong package - or they are missing the package declaration. They also >> have the wrong license header (JBoss instead of Hibernate, Apache >> instead of LGPL). > > > I see package-info.java files that actually have no package statement. Is > that what you mean? Yes. Eclipse will mark the whole module as "can't compile", and consequentially stops compiling anything. >> Code snippet "CoreMatchers.notNullValue()" doesn't compile as >> the method is not generic. Apparently IDEA and javac consider this >> acceptable, but Eclipse won't. May I remove the generics usage? > > > Where do you see this? https://github.com/Sanne/hibernate-orm/commit/9d38cff25aa035ef91c09651b077c70be71ab962#diff-0d19b1f89ca58d05a9885fcb271cc2c7L157 If you agree with that PR #843 is ok I'll create a JIRA for it? Sanne From gbadner at redhat.com Tue Nov 18 12:28:45 2014 From: gbadner at redhat.com (Gail Badner) Date: Tue, 18 Nov 2014 12:28:45 -0500 (EST) Subject: [hibernate-dev] Hibernate ORM master - 5.0 In-Reply-To: <789112759.13520432.1416331681999.JavaMail.zimbra@redhat.com> References: <789112759.13520432.1416331681999.JavaMail.zimbra@redhat.com> Message-ID: <1928896549.13520653.1416331725731.JavaMail.zimbra@redhat.com> Forgot to CC hibernate-dev mailing list... ----- Original Message ----- > From: "Gail Badner" > To: "Steve Ebersole" > Sent: Tuesday, November 18, 2014 9:28:02 AM > Subject: Re: [hibernate-dev] Hibernate ORM master - 5.0 > > You mention possibly for 5.1: "Override EAGER fetching with LAZY (fetch > profiles, HQL, etc) refer to HHH-8558 and HHH-8559? > > ----- Original Message ----- > > From: "Steve Ebersole" > > To: "hibernate-dev" > > Sent: Thursday, October 30, 2014 8:44:23 AM > > Subject: [hibernate-dev] Hibernate ORM master - 5.0 > > > > It was decided that the massive work for 5.0 including metamodel and all > > the other changes was just taking too long, and that we'd split that work > > up into a number of intermediate versions. I wanted to highlight the > > proposed breakdown and solidify the roadmaps. The preliminary breakdown is > > as follows: > > > > > > - 5.0 > > - Java 6 or 7 (?) > > - EE 7 (JPA 2.1) > > - Wildfly 9 > > - Timeline : Spring 2015 > > - Required development > > - Transition to new bootstrapping APIs > > - MetadataSources, contributors, builders, etc for building > > SessionFactory > > - Keep Configuration as a migration aid, but align its > > processing and assumptions to follow new APIs > > - New naming strategy approach (implicit and physical split) > > - Pick "important" features from metamodel work based on new > > bootstrapping API > > - automatic quoting of identifiers that are keywords > > - ??? > > - Performance improvements > > - Cachng SPI changes based on feedback from Ehcahce and Infinispan > > - EntityKey proposal > > - Explore unifying entry keys for actual cache provider, cache > > SPI (CacheKey) and persistence-context (EntityKey) > > - Infinispan improvements, especially in local mode. Will > > require integrating a new Infinispan version and possible > > changes to > > hibernate-infinispan > > - ??? > > - OGM integration > > - "after persisters built" hook > > - others? > > - Java 8 type support > > - Date/Time > > - Optional > > - Java 9 type support > > - Money/Currency > > - Optional development (as time, resources allow) > > - Discriminator based multitenancy > > - JAXB instead of dom4j. > > - extended orm.xml xsd, deprecating hbm.xml format > > - Jandex usage > > - JdbcSession > > - Hibernate Spatial integration (depends on level of dependence on > > metamodel) > > - 5.1 > > - Java 6 or 7 (?) > > - EE 7 (JPA 2.1) > > - Widfly 9, or 10 > > - Timeline : TBD (Fall 2016?) > > - Required development > > - slips from 5.0 > > - new HQL parser > > - Antlr 3 or 4? > > - unified SQL generation? or limit to HQL parsing? > > - Optional development (as time, resources allow) > > - extend JPA criteria API with support for constructs from > > Hibernate's legacy criteria API > > - extend JPA criteria API with fluent support > > - Possibly - Override EAGER fetching with LAZY (fetch profiles, HQL, > > etc) > > - 5.2 > > - (if needed) > > - Java 6 or 7 (?) > > - EE 7 (JPA 2.1) > > - Widfly 9, or 10 > > - Required development > > - splits from 5.1 > > - 6.0 > > - SE and EE support levels TBD, but at least SE 8 > > - Required development > > - metamodel > > > > > > One additional consideration... I have been told (have not verified the > > details yet myself) that Hibernate ORM will currently not run in Java 8 at > > least in part because dom4j will not work in Java 8 (maybe just the version > > we use? again, have not verified details yet). If running 5.x versions of > > Hibernate in Java 8 is important to anyone, we might need to increase the > > priority of moving to JAXB over dom4j. > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > From gbadner at redhat.com Tue Nov 18 16:59:26 2014 From: gbadner at redhat.com (Gail Badner) Date: Tue, 18 Nov 2014 16:59:26 -0500 (EST) Subject: [hibernate-dev] MySQL fractional second precision (HHH-9444) In-Reply-To: <54702801.13638440.1416346894343.JavaMail.zimbra@redhat.com> Message-ID: <42528216.13643405.1416347966402.JavaMail.zimbra@redhat.com> MySQL support for fractional seconds in temporal values is documented in [1]: Prior to MySQL 5.6.4, when storing a value into a column of any temporal data type, fractional part is discarded (truncated). When a column is defined as TIMESTAMP(N), N indicates display width rather than fractional seconds. MySQL 5.6.4 and up allows enabling fractional second support by defining a column like: TIME(n), DATETIME(n), TIMESTAMP(n), where 0 <= n <= 6. A value of 0 indicates no fractional seconds. For compatibiliby with previous MySQL versions, if no value for n is provided, then 0 is the default. This is inconsistent with standard SQL, which has a default of 6. In addition, inserting a temporal value in a column will result in rounding if the column is defined with fewer fractional digits than the value. Starting from MySQL 5.6.4, there are also differences in functions that involve temporal values. MySQL functions like NOW(), CURTIME(), SYSDATE(), or UTC_TIMESTAMP() can optionally take an argument for fractional seconds precision as in NOW(n), CURTIME(n), SYSDATE(n), or UTC_TIMESTAMP(n), where 0 <= n <= 6. For compatibiliby with previous MySQL versions, if no value for n is provided, then 0 is the default. I'm working on a new dialect to support fractional seconds. Since the support for fractional seconds began in MySQL 5.6.4 it kind of complicates naming. I assume MySQL5InnoDBDialect needs to be extended for the InnoDB engine. Is "MySQL564InnoDBDialect" too ugly? Is there any need to have a new dialect for other (non-InnoDB) MySQL engines (e.g., MySQL564DBDialect that extends MySQL5Dialect)? IIUC, to be consistent with the SQL standard the default for the temporal types in the new dialect(s) should be: registerColumnType( Types.TIMESTAMP, "datetime(6)" ); registerColumnType( Types.TIME, "time(6)" ); Is there a need the new dialect(s) to allow an application to define the number of fractional seconds to anything other than 6? If so, would it work to also add the following? registerColumnType( Types.TIMESTAMP, 6, "datetime($l)" ); registerColumnType( Types.TIME, 6, "time($l)" ); Also, IMO, Hibernate should render NOW(), CURTIME(), SYSDATE(), UTC_TIMESTAMP() as NOW(6), CURTIME(6), SYSDATE(6), or UTC_TIMESTAMP(6), respectively, unless an argument is specifically provided. As far as I can tell, Hibernate does not use MySQL's TIMESTAMP column type, so I don't think anything needs to be done to support fractional seconds for that type, or am I missing something here? Comments? Thanks, Gail [1] http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html [2] https://hibernate.atlassian.net/browse/HHH-9444 From gbadner at redhat.com Tue Nov 18 17:03:05 2014 From: gbadner at redhat.com (Gail Badner) Date: Tue, 18 Nov 2014 17:03:05 -0500 (EST) Subject: [hibernate-dev] MySQL fractional second precision (HHH-8401, HHH-9444) In-Reply-To: <42528216.13643405.1416347966402.JavaMail.zimbra@redhat.com> References: <42528216.13643405.1416347966402.JavaMail.zimbra@redhat.com> Message-ID: <1123708359.13645076.1416348185572.JavaMail.zimbra@redhat.com> To clarify, HHH-8401 is to support MySQL fractional seconds; HHH-9444 is to fix test failures due MySQL's new support for fractional seconds. ----- Original Message ----- > From: "Gail Badner" > To: "Hibernate Dev" > Sent: Tuesday, November 18, 2014 1:59:26 PM > Subject: MySQL fractional second precision (HHH-9444) > > MySQL support for fractional seconds in temporal values is documented in [1]: > > Prior to MySQL 5.6.4, when storing a value into a column of any temporal data > type, fractional part is discarded (truncated). When a column is defined as > TIMESTAMP(N), N indicates display width rather than fractional seconds. > > MySQL 5.6.4 and up allows enabling fractional second support by defining a > column like: TIME(n), DATETIME(n), TIMESTAMP(n), where 0 <= n <= 6. A value > of 0 indicates no fractional seconds. For compatibiliby with previous MySQL > versions, if no value for n is provided, then 0 is the default. This is > inconsistent with standard SQL, which has a default of 6. In addition, > inserting a temporal value in a column will result in rounding if the column > is defined with fewer fractional digits than the value. > > Starting from MySQL 5.6.4, there are also differences in functions that > involve temporal values. MySQL functions like NOW(), CURTIME(), SYSDATE(), > or UTC_TIMESTAMP() can optionally take an argument for fractional seconds > precision as in NOW(n), CURTIME(n), SYSDATE(n), or UTC_TIMESTAMP(n), where 0 > <= n <= 6. For compatibiliby with previous MySQL versions, if no value for n > is provided, then 0 is the default. > > I'm working on a new dialect to support fractional seconds. Since the support > for fractional seconds began in MySQL 5.6.4 it kind of complicates naming. I > assume MySQL5InnoDBDialect needs to be extended for the InnoDB engine. > > Is "MySQL564InnoDBDialect" too ugly? > > Is there any need to have a new dialect for other (non-InnoDB) MySQL engines > (e.g., MySQL564DBDialect that extends MySQL5Dialect)? > > IIUC, to be consistent with the SQL standard the default for the temporal > types in the new dialect(s) should be: > registerColumnType( Types.TIMESTAMP, "datetime(6)" ); > registerColumnType( Types.TIME, "time(6)" ); > > Is there a need the new dialect(s) to allow an application to define the > number of fractional seconds to anything other than 6? If so, would it work > to also add the following? > registerColumnType( Types.TIMESTAMP, 6, "datetime($l)" ); > registerColumnType( Types.TIME, 6, "time($l)" ); > > Also, IMO, Hibernate should render NOW(), CURTIME(), SYSDATE(), > UTC_TIMESTAMP() as NOW(6), CURTIME(6), SYSDATE(6), or UTC_TIMESTAMP(6), > respectively, unless an argument is specifically provided. > > As far as I can tell, Hibernate does not use MySQL's TIMESTAMP column type, > so I don't think anything needs to be done to support fractional seconds for > that type, or am I missing something here? > > Comments? > > Thanks, > Gail > > [1] http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html > [2] https://hibernate.atlassian.net/browse/HHH-9444 From gbadner at redhat.com Tue Nov 18 18:08:00 2014 From: gbadner at redhat.com (Gail Badner) Date: Tue, 18 Nov 2014 18:08:00 -0500 (EST) Subject: [hibernate-dev] ORM master In-Reply-To: References: Message-ID: <932985472.13673019.1416352080155.JavaMail.zimbra@redhat.com> Only metamodel-related code was merged from the old metamodel branch into master, so there is definitely unmerged work still in metamodel-old. I would keep it around until things get sorted out. ----- Original Message ----- > From: "Steve Ebersole" > To: "hibernate-dev" > Sent: Wednesday, October 29, 2014 4:00:38 AM > Subject: Re: [hibernate-dev] ORM master > > FYI, does anyone need metamodel-old anymore? Can I just delete that one > upstream? > > On Wed, Oct 29, 2014 at 6:00 AM, Steve Ebersole wrote: > > > Ok, all done now. So at this point: > > > > 1) upstream/metamodel-old is the "metamodel" code as of the point before > > when we merged it to master > > 2) upstream/metamodel is the current state of metamodel work > > 3) upstream/master is currently the same as 4.3. It is the base from > > which I will start the discussed simplified 5.0 development > > > > > > > > On Wed, Oct 29, 2014 at 5:22 AM, Steve Ebersole > > wrote: > > > >> I just noticed that the old metamodel branch was still around upstream. > >> So far I have: > >> > >> 1) moved upstream/metamodel -> upstream/metamodel-old > >> 2) deleted upstream/metamodel > >> 3) moved upstream/master -> upstream/metamodel > >> > >> I'll wait a few minutes still before deleting master and re-priming it > >> from 4.3 > >> > >> > >> On Wed, Oct 29, 2014 at 4:13 AM, Steve Ebersole > >> wrote: > >> > >>> Per the face to face discussion yesterday (I'll send out more details > >>> later) I am working on branching master off to a new "metamodel" dev > >>> branch > >>> and priming a "new master" from 4.3 (the basic idea being to start work > >>> on > >>> a more targeted 5.0). > >>> > >>> Part of this is of course a massive change to the state of master > >>> upstream. If anyone needs me to wait before starting this please let me > >>> know immediately. Thanks. > >>> > >> > >> > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From steve at hibernate.org Tue Nov 18 18:14:22 2014 From: steve at hibernate.org (Steve Ebersole) Date: Tue, 18 Nov 2014 17:14:22 -0600 Subject: [hibernate-dev] ORM master In-Reply-To: <932985472.13673019.1416352080155.JavaMail.zimbra@redhat.com> References: <932985472.13673019.1416352080155.JavaMail.zimbra@redhat.com> Message-ID: If there is something you want then pull it over. On Nov 18, 2014 5:08 PM, "Gail Badner" wrote: > Only metamodel-related code was merged from the old metamodel branch into > master, so there is definitely unmerged work still in metamodel-old. I > would keep it around until things get sorted out. > > ----- Original Message ----- > > From: "Steve Ebersole" > > To: "hibernate-dev" > > Sent: Wednesday, October 29, 2014 4:00:38 AM > > Subject: Re: [hibernate-dev] ORM master > > > > FYI, does anyone need metamodel-old anymore? Can I just delete that one > > upstream? > > > > On Wed, Oct 29, 2014 at 6:00 AM, Steve Ebersole > wrote: > > > > > Ok, all done now. So at this point: > > > > > > 1) upstream/metamodel-old is the "metamodel" code as of the point > before > > > when we merged it to master > > > 2) upstream/metamodel is the current state of metamodel work > > > 3) upstream/master is currently the same as 4.3. It is the base from > > > which I will start the discussed simplified 5.0 development > > > > > > > > > > > > On Wed, Oct 29, 2014 at 5:22 AM, Steve Ebersole > > > wrote: > > > > > >> I just noticed that the old metamodel branch was still around > upstream. > > >> So far I have: > > >> > > >> 1) moved upstream/metamodel -> upstream/metamodel-old > > >> 2) deleted upstream/metamodel > > >> 3) moved upstream/master -> upstream/metamodel > > >> > > >> I'll wait a few minutes still before deleting master and re-priming it > > >> from 4.3 > > >> > > >> > > >> On Wed, Oct 29, 2014 at 4:13 AM, Steve Ebersole > > >> wrote: > > >> > > >>> Per the face to face discussion yesterday (I'll send out more details > > >>> later) I am working on branching master off to a new "metamodel" dev > > >>> branch > > >>> and priming a "new master" from 4.3 (the basic idea being to start > work > > >>> on > > >>> a more targeted 5.0). > > >>> > > >>> Part of this is of course a massive change to the state of master > > >>> upstream. If anyone needs me to wait before starting this please let > me > > >>> know immediately. Thanks. > > >>> > > >> > > >> > > > > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > From smarlow at redhat.com Tue Nov 18 19:48:47 2014 From: smarlow at redhat.com (Scott Marlow) Date: Tue, 18 Nov 2014 19:48:47 -0500 Subject: [hibernate-dev] did hibernate.org crash? Message-ID: <546BE8EF.8030008@redhat.com> Trying to open http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, gives a: " Site temporarily disabled This page has been temporarily disabled due to a misconfigured custom domain. Are you the site owner? Follow the instructions for setting up a custom domain with GitHub pages to update your site's DNS records to point to the proper IP address. You can find more information in our GitHub Pages legacy IP deprecation blog post. If you have any questions, please contact support. " The above causes a WildFly test failure http://pastebin.com/fm8VMCcb (from org.hibernate.service.internal.JaxbProcessor.unmarshal). Scott From smarlow at redhat.com Tue Nov 18 20:13:22 2014 From: smarlow at redhat.com (Scott Marlow) Date: Tue, 18 Nov 2014 20:13:22 -0500 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: <546BE8EF.8030008@redhat.com> References: <546BE8EF.8030008@redhat.com> Message-ID: <546BEEB2.7020700@redhat.com> Related question, should we instead be using the org/hibernate/hibernate-configuration-3.0.dtd in hibernate-core-4.3.7.Final.jar (instead of accessing the hibernate.org website)? On 11/18/2014 07:48 PM, Scott Marlow wrote: > Trying to open http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, > gives a: > > " > Site temporarily disabled > > This page has been temporarily disabled due to a misconfigured custom > domain. > > Are you the site owner? Follow the instructions for setting up a custom > domain with GitHub pages to update your site's DNS records to point to > the proper IP address. > > You can find more information in our GitHub Pages legacy IP deprecation > blog post. If you have any questions, please contact support. > " > > The above causes a WildFly test failure http://pastebin.com/fm8VMCcb > (from org.hibernate.service.internal.JaxbProcessor.unmarshal). > > Scott > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From gunnar at hibernate.org Wed Nov 19 07:57:42 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Wed, 19 Nov 2014 13:57:42 +0100 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: <546BE8EF.8030008@redhat.com> References: <546BE8EF.8030008@redhat.com> Message-ID: There was a DNS related change required for GH pages with custom domains. Just tested it, it is working again, so I guess Emmanuel has done the required configuation. May take a while though until it has been propagated to all DNS servers. --Gunnar Am 19.11.2014 01:49 schrieb "Scott Marlow" : > Trying to open http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, > gives a: > > " > Site temporarily disabled > > This page has been temporarily disabled due to a misconfigured custom > domain. > > Are you the site owner? Follow the instructions for setting up a custom > domain with GitHub pages to update your site's DNS records to point to > the proper IP address. > > You can find more information in our GitHub Pages legacy IP deprecation > blog post. If you have any questions, please contact support. > " > > The above causes a WildFly test failure http://pastebin.com/fm8VMCcb > (from org.hibernate.service.internal.JaxbProcessor.unmarshal). > > Scott > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Wed Nov 19 08:53:41 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 19 Nov 2014 13:53:41 +0000 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: <546BEEB2.7020700@redhat.com> References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> Message-ID: On 19 November 2014 01:13, Scott Marlow wrote: > Related question, should we instead be using the > org/hibernate/hibernate-configuration-3.0.dtd in > hibernate-core-4.3.7.Final.jar (instead of accessing the hibernate.org > website)? I'd agree that it's generally not a good idea to rely on external web services in your tests. Although in this case it's turned out useful as we got your notification about the problem :) Sanne > > On 11/18/2014 07:48 PM, Scott Marlow wrote: >> Trying to open http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, >> gives a: >> >> " >> Site temporarily disabled >> >> This page has been temporarily disabled due to a misconfigured custom >> domain. >> >> Are you the site owner? Follow the instructions for setting up a custom >> domain with GitHub pages to update your site's DNS records to point to >> the proper IP address. >> >> You can find more information in our GitHub Pages legacy IP deprecation >> blog post. If you have any questions, please contact support. >> " >> >> The above causes a WildFly test failure http://pastebin.com/fm8VMCcb >> (from org.hibernate.service.internal.JaxbProcessor.unmarshal). >> >> Scott >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From smarlow at redhat.com Wed Nov 19 10:48:06 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 19 Nov 2014 10:48:06 -0500 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> Message-ID: <546CBBB6.9050602@redhat.com> On 11/19/2014 08:53 AM, Sanne Grinovero wrote: > On 19 November 2014 01:13, Scott Marlow wrote: >> Related question, should we instead be using the >> org/hibernate/hibernate-configuration-3.0.dtd in >> hibernate-core-4.3.7.Final.jar (instead of accessing the hibernate.org >> website)? > > I'd agree that it's generally not a good idea to rely on external web > services in your tests. Although in this case it's turned out useful > as we got your notification about the problem :) I'm not exactly sure what I need to change in the tests to use the local org/hibernate/hibernate-configuration-3.0.dtd (ORM jar) copy of the DTD. I tried a few different options but the only thing that helped was removing the DTD reference. For example, what should https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/cfgfile/CfgFileTestCase.java#L54 be changed to? I tried changing the "PUBLIC" to "SYSTEM" but that didn't seem to make a difference (also tried adding a classpath reference which some forum posts talked about doing). > > Sanne > >> >> On 11/18/2014 07:48 PM, Scott Marlow wrote: >>> Trying to open http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, >>> gives a: >>> >>> " >>> Site temporarily disabled >>> >>> This page has been temporarily disabled due to a misconfigured custom >>> domain. >>> >>> Are you the site owner? Follow the instructions for setting up a custom >>> domain with GitHub pages to update your site's DNS records to point to >>> the proper IP address. >>> >>> You can find more information in our GitHub Pages legacy IP deprecation >>> blog post. If you have any questions, please contact support. >>> " >>> >>> The above causes a WildFly test failure http://pastebin.com/fm8VMCcb >>> (from org.hibernate.service.internal.JaxbProcessor.unmarshal). >>> >>> Scott >>> _______________________________________________ >>> hibernate-dev mailing list >>> hibernate-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev >>> >> >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev From gunnar at hibernate.org Wed Nov 19 11:04:52 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Wed, 19 Nov 2014 17:04:52 +0100 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: <546CBBB6.9050602@redhat.com> References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> Message-ID: 2014-11-19 16:48 GMT+01:00 Scott Marlow : > On 11/19/2014 08:53 AM, Sanne Grinovero wrote: > > On 19 November 2014 01:13, Scott Marlow wrote: > >> Related question, should we instead be using the > >> org/hibernate/hibernate-configuration-3.0.dtd in > >> hibernate-core-4.3.7.Final.jar (instead of accessing the hibernate.org > >> website)? > > > > I'd agree that it's generally not a good idea to rely on external web > > services in your tests. Although in this case it's turned out useful > > as we got your notification about the problem :) > > I'm not exactly sure what I need to change in the tests to use the local > org/hibernate/hibernate-configuration-3.0.dtd (ORM jar) copy of the DTD. > I tried a few different options but the only thing that helped was > removing the DTD reference. > > For example, what should > > https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/cfgfile/CfgFileTestCase.java#L54 > be changed to? > > I tried changing the "PUBLIC" to "SYSTEM" but that didn't seem to make a > difference (also tried adding a classpath reference which some forum > posts talked about doing). > I don't think that's something which can (or should) be controlled within the test. Rather the code processing the XML file in ORM should make sure to use the local version of the DTD. That's how it's done in Validator: https://github.com/hibernate/hibernate-validator/blob/master/engine/src/main/java/org/hibernate/validator/internal/xml/ValidationXmlParser.java Not sure how helpful it is though, as this is for XSDs and we're using JAXB to do the parsing, so it may be a bit different to do in ORM. --Gunnar > > > > Sanne > > > >> > >> On 11/18/2014 07:48 PM, Scott Marlow wrote: > >>> Trying to open > http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, > >>> gives a: > >>> > >>> " > >>> Site temporarily disabled > >>> > >>> This page has been temporarily disabled due to a misconfigured custom > >>> domain. > >>> > >>> Are you the site owner? Follow the instructions for setting up a custom > >>> domain with GitHub pages to update your site's DNS records to point to > >>> the proper IP address. > >>> > >>> You can find more information in our GitHub Pages legacy IP deprecation > >>> blog post. If you have any questions, please contact support. > >>> " > >>> > >>> The above causes a WildFly test failure http://pastebin.com/fm8VMCcb > >>> (from org.hibernate.service.internal.JaxbProcessor.unmarshal). > >>> > >>> Scott > >>> _______________________________________________ > >>> hibernate-dev mailing list > >>> hibernate-dev at lists.jboss.org > >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev > >>> > >> > >> _______________________________________________ > >> hibernate-dev mailing list > >> hibernate-dev at lists.jboss.org > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From hardy at hibernate.org Wed Nov 19 11:17:03 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Wed, 19 Nov 2014 17:17:03 +0100 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> Message-ID: <20141119161703.GA24593@Sarmakand-2.local> Hi, > > For example, what should > > > > https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/cfgfile/CfgFileTestCase.java#L54 > > be changed to? > > > > I tried changing the "PUBLIC" to "SYSTEM" but that didn't seem to make a > > difference (also tried adding a classpath reference which some forum > > posts talked about doing). > > > > I don't think that's something which can (or should) be controlled within > the test. +1 > Rather the code processing the XML file in ORM should make sure to use the > local version of the DTD. That's how it's done in Validator: Right, and if I am not mistaken we "took" the approach from ORM in the first place. It might be though, that it is part of the unreleased ORM 5 code. > Not sure how helpful it is though, as this is for XSDs and we're using JAXB > to do the parsing, so it may be a bit different to do in ORM. I might be imagining this, but I thought this remote lookup of DTD has been addressed quite some time back. Maybe I am also missing something here. What version of ORM are we dealing with here? --Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 496 bytes Desc: not available Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20141119/7b0ca9e4/attachment.bin From steve at hibernate.org Wed Nov 19 11:26:07 2014 From: steve at hibernate.org (Steve Ebersole) Date: Wed, 19 Nov 2014 10:26:07 -0600 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> Message-ID: ORM has had local resolution of these DTDs forever. Something is amiss in your set up. I just ran ORM tests and the DTDs are being resolved locally properly. Can you make sure control is getting through our registered EntityResolver? Ultimately, this should be resolved by org.hibernate.internal.util.xml.DTDEntityResolver On Wed, Nov 19, 2014 at 10:04 AM, Gunnar Morling wrote: > 2014-11-19 16:48 GMT+01:00 Scott Marlow : > > > On 11/19/2014 08:53 AM, Sanne Grinovero wrote: > > > On 19 November 2014 01:13, Scott Marlow wrote: > > >> Related question, should we instead be using the > > >> org/hibernate/hibernate-configuration-3.0.dtd in > > >> hibernate-core-4.3.7.Final.jar (instead of accessing the > hibernate.org > > >> website)? > > > > > > I'd agree that it's generally not a good idea to rely on external web > > > services in your tests. Although in this case it's turned out useful > > > as we got your notification about the problem :) > > > > I'm not exactly sure what I need to change in the tests to use the local > > org/hibernate/hibernate-configuration-3.0.dtd (ORM jar) copy of the DTD. > > I tried a few different options but the only thing that helped was > > removing the DTD reference. > > > > For example, what should > > > > > https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/cfgfile/CfgFileTestCase.java#L54 > > be changed to? > > > > I tried changing the "PUBLIC" to "SYSTEM" but that didn't seem to make a > > difference (also tried adding a classpath reference which some forum > > posts talked about doing). > > > > I don't think that's something which can (or should) be controlled within > the test. > > Rather the code processing the XML file in ORM should make sure to use the > local version of the DTD. That's how it's done in Validator: > > > > https://github.com/hibernate/hibernate-validator/blob/master/engine/src/main/java/org/hibernate/validator/internal/xml/ValidationXmlParser.java > > Not sure how helpful it is though, as this is for XSDs and we're using JAXB > to do the parsing, so it may be a bit different to do in ORM. > > --Gunnar > > > > > > > > Sanne > > > > > >> > > >> On 11/18/2014 07:48 PM, Scott Marlow wrote: > > >>> Trying to open > > http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, > > >>> gives a: > > >>> > > >>> " > > >>> Site temporarily disabled > > >>> > > >>> This page has been temporarily disabled due to a misconfigured custom > > >>> domain. > > >>> > > >>> Are you the site owner? Follow the instructions for setting up a > custom > > >>> domain with GitHub pages to update your site's DNS records to point > to > > >>> the proper IP address. > > >>> > > >>> You can find more information in our GitHub Pages legacy IP > deprecation > > >>> blog post. If you have any questions, please contact support. > > >>> " > > >>> > > >>> The above causes a WildFly test failure http://pastebin.com/fm8VMCcb > > >>> (from org.hibernate.service.internal.JaxbProcessor.unmarshal). > > >>> > > >>> Scott > > >>> _______________________________________________ > > >>> hibernate-dev mailing list > > >>> hibernate-dev at lists.jboss.org > > >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > >>> > > >> > > >> _______________________________________________ > > >> hibernate-dev mailing list > > >> hibernate-dev at lists.jboss.org > > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From smarlow at redhat.com Wed Nov 19 11:35:14 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 19 Nov 2014 11:35:14 -0500 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> Message-ID: <546CC6C2.1080806@redhat.com> On 11/19/2014 11:26 AM, Steve Ebersole wrote: > ORM has had local resolution of these DTDs forever. Something is amiss > in your set up. I just ran ORM tests and the DTDs are being resolved > locally properly. Thanks for checking. > > Can you make sure control is getting through our registered > EntityResolver? Ultimately, this should be resolved > by org.hibernate.internal.util.xml.DTDEntityResolver I'll give this a try. > > On Wed, Nov 19, 2014 at 10:04 AM, Gunnar Morling > wrote: > > 2014-11-19 16:48 GMT+01:00 Scott Marlow >: > > > On 11/19/2014 08:53 AM, Sanne Grinovero wrote: > > > On 19 November 2014 01:13, Scott Marlow > wrote: > > >> Related question, should we instead be using the > > >> org/hibernate/hibernate-configuration-3.0.dtd in > > >> hibernate-core-4.3.7.Final.jar (instead of accessing thehibernate.org > > >> website)? > > > > > > I'd agree that it's generally not a good idea to rely on external web > > > services in your tests. Although in this case it's turned out useful > > > as we got your notification about the problem :) > > > > I'm not exactly sure what I need to change in the tests to use the local > > org/hibernate/hibernate-configuration-3.0.dtd (ORM jar) copy of the DTD. > > I tried a few different options but the only thing that helped was > > removing the DTD reference. > > > > For example, what should > > > >https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/cfgfile/CfgFileTestCase.java#L54 > > be changed to? > > > > I tried changing the "PUBLIC" to "SYSTEM" but that didn't seem to make a > > difference (also tried adding a classpath reference which some forum > > posts talked about doing). > > > > I don't think that's something which can (or should) be controlled > within > the test. > > Rather the code processing the XML file in ORM should make sure to > use the > local version of the DTD. That's how it's done in Validator: > > > https://github.com/hibernate/hibernate-validator/blob/master/engine/src/main/java/org/hibernate/validator/internal/xml/ValidationXmlParser.java > > Not sure how helpful it is though, as this is for XSDs and we're > using JAXB > to do the parsing, so it may be a bit different to do in ORM. > > --Gunnar > > > > > > > > Sanne > > > > > >> > > >> On 11/18/2014 07:48 PM, Scott Marlow wrote: > > >>> Trying to open > > http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, > > >>> gives a: > > >>> > > >>> " > > >>> Site temporarily disabled > > >>> > > >>> This page has been temporarily disabled due to a > misconfigured custom > > >>> domain. > > >>> > > >>> Are you the site owner? Follow the instructions for setting > up a custom > > >>> domain with GitHub pages to update your site's DNS records to > point to > > >>> the proper IP address. > > >>> > > >>> You can find more information in our GitHub Pages legacy IP > deprecation > > >>> blog post. If you have any questions, please contact support. > > >>> " > > >>> > > >>> The above causes a WildFly test failure > http://pastebin.com/fm8VMCcb > > >>> (from org.hibernate.service.internal.JaxbProcessor.unmarshal). > > >>> > > >>> Scott > > >>> _______________________________________________ > > >>> hibernate-dev mailing list > > >>> hibernate-dev at lists.jboss.org > > > >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > >>> > > >> > > >> _______________________________________________ > > >> hibernate-dev mailing list > > >> hibernate-dev at lists.jboss.org > > > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > From steve at hibernate.org Wed Nov 19 11:46:21 2014 From: steve at hibernate.org (Steve Ebersole) Date: Wed, 19 Nov 2014 10:46:21 -0600 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: <546CC6C2.1080806@redhat.com> References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> <546CC6C2.1080806@redhat.com> Message-ID: I should have been more complete :) You can either set a breakpoint or crank up logging on that class. Breakpoint debugging is probably better as you could see the whole call stack. These resolvers use a lot of delegation. You could also look at org.hibernate.cfg.Configuration#entityResolver to verify which specific resolver is being used. On Wed, Nov 19, 2014 at 10:35 AM, Scott Marlow wrote: > On 11/19/2014 11:26 AM, Steve Ebersole wrote: > >> ORM has had local resolution of these DTDs forever. Something is amiss >> in your set up. I just ran ORM tests and the DTDs are being resolved >> locally properly. >> > > Thanks for checking. > > >> Can you make sure control is getting through our registered >> EntityResolver? Ultimately, this should be resolved >> by org.hibernate.internal.util.xml.DTDEntityResolver >> > > I'll give this a try. > > >> On Wed, Nov 19, 2014 at 10:04 AM, Gunnar Morling > > wrote: >> >> 2014-11-19 16:48 GMT+01:00 Scott Marlow > >: >> >> > On 11/19/2014 08:53 AM, Sanne Grinovero wrote: >> > > On 19 November 2014 01:13, Scott Marlow > > wrote: >> > >> Related question, should we instead be using the >> > >> org/hibernate/hibernate-configuration-3.0.dtd in >> > >> hibernate-core-4.3.7.Final.jar (instead of accessing >> thehibernate.org >> >> > >> website)? >> > > >> > > I'd agree that it's generally not a good idea to rely on external >> web >> > > services in your tests. Although in this case it's turned out >> useful >> > > as we got your notification about the problem :) >> > >> > I'm not exactly sure what I need to change in the tests to use the >> local >> > org/hibernate/hibernate-configuration-3.0.dtd (ORM jar) copy of >> the DTD. >> > I tried a few different options but the only thing that helped was >> > removing the DTD reference. >> > >> > For example, what should >> > >> >https://github.com/wildfly/wildfly/blob/master/testsuite/ >> integration/basic/src/test/java/org/jboss/as/test/ >> integration/jpa/cfgfile/CfgFileTestCase.java#L54 >> > be changed to? >> > >> > I tried changing the "PUBLIC" to "SYSTEM" but that didn't seem to >> make a >> > difference (also tried adding a classpath reference which some forum >> > posts talked about doing). >> > >> >> I don't think that's something which can (or should) be controlled >> within >> the test. >> >> Rather the code processing the XML file in ORM should make sure to >> use the >> local version of the DTD. That's how it's done in Validator: >> >> >> https://github.com/hibernate/hibernate-validator/blob/ >> master/engine/src/main/java/org/hibernate/validator/internal/xml/ >> ValidationXmlParser.java >> >> Not sure how helpful it is though, as this is for XSDs and we're >> using JAXB >> to do the parsing, so it may be a bit different to do in ORM. >> >> --Gunnar >> >> >> > > >> > > Sanne >> > > >> > >> >> > >> On 11/18/2014 07:48 PM, Scott Marlow wrote: >> > >>> Trying to open >> > http://hibernate.org/dtd/hibernate-configuration-3.0.dtd, >> > >>> gives a: >> > >>> >> > >>> " >> > >>> Site temporarily disabled >> > >>> >> > >>> This page has been temporarily disabled due to a >> misconfigured custom >> > >>> domain. >> > >>> >> > >>> Are you the site owner? Follow the instructions for setting >> up a custom >> > >>> domain with GitHub pages to update your site's DNS records to >> point to >> > >>> the proper IP address. >> > >>> >> > >>> You can find more information in our GitHub Pages legacy IP >> deprecation >> > >>> blog post. If you have any questions, please contact support. >> > >>> " >> > >>> >> > >>> The above causes a WildFly test failure >> http://pastebin.com/fm8VMCcb >> > >>> (from org.hibernate.service.internal.JaxbProcessor.unmarshal). >> > >>> >> > >>> Scott >> > >>> _______________________________________________ >> > >>> hibernate-dev mailing list >> > >>> hibernate-dev at lists.jboss.org >> >> > >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > >>> >> > >> >> > >> _______________________________________________ >> > >> hibernate-dev mailing list >> > >> hibernate-dev at lists.jboss.org >> >> > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > >> > _______________________________________________ >> > hibernate-dev mailing list >> > hibernate-dev at lists.jboss.org > jboss.org> >> > https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> >> >> > From smarlow at redhat.com Wed Nov 19 13:15:52 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 19 Nov 2014 13:15:52 -0500 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> <546CC6C2.1080806@redhat.com> Message-ID: <546CDE58.7050908@redhat.com> http://pastebin.com/Baz7FRyf is an initial call stack into org.hibernate.service.internal.JaxbProcessor. I'm debugging on the Hibernate 4.3 branch and don't hit any break points in org.hibernate.cfg.Configuration#entityResolver. Perhaps I ended up in the wrong class, not sure. I also set break points in org.hibernate.internal.util.xml.DTDEntityResolver (don't see org.hibernate.internal.util.__xml.DTDEntityResolver). The first exception that I see is http://pastebin.com/CYd0aNzE On 11/19/2014 11:46 AM, Steve Ebersole wrote: > I should have been more complete :) > > You can either set a breakpoint or crank up logging on that class. > Breakpoint debugging is probably better as you could see the whole call > stack. These resolvers use a lot of delegation. You could also look > at org.hibernate.cfg.Configuration#entityResolver to verify which > specific resolver is being used. > > On Wed, Nov 19, 2014 at 10:35 AM, Scott Marlow > wrote: > > On 11/19/2014 11:26 AM, Steve Ebersole wrote: > > ORM has had local resolution of these DTDs forever. Something > is amiss > in your set up. I just ran ORM tests and the DTDs are being > resolved > locally properly. > > > Thanks for checking. > > > Can you make sure control is getting through our registered > EntityResolver? Ultimately, this should be resolved > by org.hibernate.internal.util.__xml.DTDEntityResolver > > > I'll give this a try. > > From steve at hibernate.org Wed Nov 19 14:43:38 2014 From: steve at hibernate.org (Steve Ebersole) Date: Wed, 19 Nov 2014 13:43:38 -0600 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: <546CDE58.7050908@redhat.com> References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> <546CC6C2.1080806@redhat.com> <546CDE58.7050908@redhat.com> Message-ID: Ah, there is a difference in how core and hem are loading these. This is likely a bug, could you open a Jira? On Wed, Nov 19, 2014 at 12:15 PM, Scott Marlow wrote: > http://pastebin.com/Baz7FRyf is an initial call stack into > org.hibernate.service.internal.JaxbProcessor. I'm debugging on the > Hibernate 4.3 branch and don't hit any break points in org.hibernate.cfg.Configuration#entityResolver. > Perhaps I ended up in the wrong class, not sure. I also set break points > in org.hibernate.internal.util.xml.DTDEntityResolver (don't see > org.hibernate.internal.util.__xml.DTDEntityResolver). > > The first exception that I see is http://pastebin.com/CYd0aNzE > > On 11/19/2014 11:46 AM, Steve Ebersole wrote: > >> I should have been more complete :) >> >> You can either set a breakpoint or crank up logging on that class. >> Breakpoint debugging is probably better as you could see the whole call >> stack. These resolvers use a lot of delegation. You could also look >> at org.hibernate.cfg.Configuration#entityResolver to verify which >> specific resolver is being used. >> >> On Wed, Nov 19, 2014 at 10:35 AM, Scott Marlow > > wrote: >> >> On 11/19/2014 11:26 AM, Steve Ebersole wrote: >> >> ORM has had local resolution of these DTDs forever. Something >> is amiss >> in your set up. I just ran ORM tests and the DTDs are being >> resolved >> locally properly. >> >> >> Thanks for checking. >> >> >> Can you make sure control is getting through our registered >> EntityResolver? Ultimately, this should be resolved >> by org.hibernate.internal.util.__xml.DTDEntityResolver >> >> >> I'll give this a try. >> >> >> > From smarlow at redhat.com Wed Nov 19 15:33:58 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 19 Nov 2014 15:33:58 -0500 Subject: [hibernate-dev] did hibernate.org crash? In-Reply-To: References: <546BE8EF.8030008@redhat.com> <546BEEB2.7020700@redhat.com> <546CBBB6.9050602@redhat.com> <546CC6C2.1080806@redhat.com> <546CDE58.7050908@redhat.com> Message-ID: <546CFEB6.3060704@redhat.com> On 11/19/2014 02:43 PM, Steve Ebersole wrote: > Ah, there is a difference in how core and hem are loading these. This > is likely a bug, could you open a Jira? I created HHH-9511 for this. > > On Wed, Nov 19, 2014 at 12:15 PM, Scott Marlow > wrote: > > http://pastebin.com/Baz7FRyf is an initial call stack into > org.hibernate.service.__internal.JaxbProcessor. I'm debugging on > the Hibernate 4.3 branch and don't hit any break points in > org.hibernate.cfg.__Configuration#entityResolver. Perhaps I ended > up in the wrong class, not sure. I also set break points in > org.hibernate.internal.util.__xml.DTDEntityResolver (don't see > org.hibernate.internal.util.____xml.DTDEntityResolver). > > The first exception that I see is http://pastebin.com/CYd0aNzE > > On 11/19/2014 11:46 AM, Steve Ebersole wrote: > > I should have been more complete :) > > You can either set a breakpoint or crank up logging on that class. > Breakpoint debugging is probably better as you could see the > whole call > stack. These resolvers use a lot of delegation. You could also > look > at org.hibernate.cfg.__Configuration#entityResolver to verify which > specific resolver is being used. > > On Wed, Nov 19, 2014 at 10:35 AM, Scott Marlow > > >> wrote: > > On 11/19/2014 11:26 AM, Steve Ebersole wrote: > > ORM has had local resolution of these DTDs forever. > Something > is amiss > in your set up. I just ran ORM tests and the DTDs are > being > resolved > locally properly. > > > Thanks for checking. > > > Can you make sure control is getting through our registered > EntityResolver? Ultimately, this should be resolved > by org.hibernate.internal.util.____xml.DTDEntityResolver > > > I'll give this a try. > > > > From sanne at hibernate.org Fri Nov 21 10:50:16 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Fri, 21 Nov 2014 15:50:16 +0000 Subject: [hibernate-dev] Hibernate Search 5.0.0.Beta3 released Message-ID: Hibernate Search 5.0.0.Beta3 is now available, as usual via Maven central or via Sourceforge. News described at: http://in.relation.to/38097.lace Please note the API changes! As usual these are documented on https://developer.jboss.org/wiki/HibernateSearchMigrationGuide#jive_content_id_Hibernate_Search_500Beta3 Sanne From gunnar at hibernate.org Mon Nov 24 03:44:21 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Mon, 24 Nov 2014 09:44:21 +0100 Subject: [hibernate-dev] [OGM-452] Abstraction work between OGM internal keys and Infinispan cache keys In-Reply-To: <59CAB33D-C6C3-4771-881B-0C32D24D12F1@hibernate.org> References: <59CAB33D-C6C3-4771-881B-0C32D24D12F1@hibernate.org> Message-ID: Hi, I've sent PR https://github.com/hibernate/hibernate-ogm/pull/408 for this. It's done, only docs are missing. The strategy to be used (CACHE_PER_KIND vs. CACHE_PER_TABLE) is configurable via a property, CACHE_PER_TABLE being the default. Any feedback welcome. --Gunnar 2014-11-14 17:39 GMT+01:00 Emmanuel Bernard : > Hi Gunnar, > > I have not implemented the new strategy yet but here is the first pass on > the abstraction and contract to allow the ogm key / cache key split. > Take a look if you have time. > > https://github.com/emmanuelbernard/hibernate-ogm/tree/OGM-452 > > I need to implement the new cache key types, their marshallers and eagerly > initialize all caches. > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From oskar.berggren at gmail.com Mon Nov 24 05:58:54 2014 From: oskar.berggren at gmail.com (Oskar Berggren) Date: Mon, 24 Nov 2014 11:58:54 +0100 Subject: [hibernate-dev] Why must abstract be specified in mappings? Message-ID: Hi, The Hibernate documentation (section 10.1.5. Table per concrete class http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch10.html#inheritance-tableperconcrete ) says: > If your superclass is abstract, map it with abstract="true". If it is not abstract, > an additional table (it defaults to PAYMENT in the example above), is needed > to hold instances of the superclass. Why is this keyword needed? Couldn't abstract classes be detected automatically using reflection? /Oskar From emmanuel at hibernate.org Tue Nov 25 03:29:41 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Tue, 25 Nov 2014 09:29:41 +0100 Subject: [hibernate-dev] Why must abstract be specified in mappings? In-Reply-To: References: Message-ID: This is a user related question that should go on our forums https://forums.hibernate.org But to answer you, you sometimes want to have a physical table for that abstract class. So Hibernate ORM?s ?abstract? really means map it to a table or not. Java?s abstract has a different meaning, it means must be subclassed or not. Mapping both together does not really work. Could you propose a small pull request that clarifies this in the documentation ? Emmanuel > On 24 Nov 2014, at 11:58, Oskar Berggren wrote: > > Hi, > > The Hibernate documentation (section 10.1.5. Table per concrete class > http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch10.html#inheritance-tableperconcrete > ) says: > >> If your superclass is abstract, map it with abstract="true". If it is not > abstract, >> an additional table (it defaults to PAYMENT in the example above), is > needed >> to hold instances of the superclass. > > Why is this keyword needed? Couldn't abstract classes be detected > automatically using reflection? > > > /Oskar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From oskar.berggren at gmail.com Tue Nov 25 05:31:40 2014 From: oskar.berggren at gmail.com (Oskar Berggren) Date: Tue, 25 Nov 2014 11:31:40 +0100 Subject: [hibernate-dev] Why must abstract be specified in mappings? In-Reply-To: References: Message-ID: 2014-11-25 9:29 GMT+01:00 Emmanuel Bernard : > This is a user related question that should go on our forums > https://forums.hibernate.org > It's intended as a question/discussion on the design of Hibernate, which is why I thought it was relevant here. The background is that the same question has appeared for NHibernate, which I'm involved with. > But to answer you, you sometimes want to have a physical table for that > abstract class. So Hibernate ORM?s ?abstract? really means map it to a > table or not. Java?s abstract has a different meaning, it means must be > subclassed or not. Mapping both together does not really work. > According to the documentation, it seems to only be used together with union-subclass, where the tables for the subclasses must contain columns also for any base class properties. So I can understand that I might want to specify abstract=true for a non-abstract base class in case I don't want to have instances of it, and am unable to change the class. But is there any situation where I would want to have a table for an abstract superclass when using union-subclass? Wouldn't any columns in such a table be inaccessible anyway due to never being used by Hibernate? Or to put it another way, if it cannot be removed completely, would this default value be useful in the sense that it would be correct for most users most of the time? abstract={IsAbstract(theClass)} Not that I'm proposing to have it changed, I assume it would be too much of a compatibility problem. However, in newer and less stable mapping frameworks (NH's mapping-by-code) it might be possible. Could you propose a small pull request that clarifies this in the > documentation ? > II think the mechanics of it are ok. When I understand the design issues that might call for abstract != classIsAbstract, I could certainly submit a few lines on that. > Emmanuel > > On 24 Nov 2014, at 11:58, Oskar Berggren wrote: > > Hi, > > The Hibernate documentation (section 10.1.5. Table per concrete class > > http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch10.html#inheritance-tableperconcrete > ) says: > > If your superclass is abstract, map it with abstract="true". If it is not > > abstract, > > an additional table (it defaults to PAYMENT in the example above), is > > needed > > to hold instances of the superclass. > > > Why is this keyword needed? Couldn't abstract classes be detected > automatically using reflection? > > > /Oskar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > From emmanuel at hibernate.org Tue Nov 25 08:30:25 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Tue, 25 Nov 2014 14:30:25 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores Message-ID: <20141125133025.GA56235@hibernate.org> Hi, With OGM-452 behind us which brings one cache per ?table?, we now have another decision in front of us. Should we use a synthetic key for the cache key (say a PersistentEntityKey class containing the array of column names and the array of column values)? Or should we use the natural object key? == Natural entity key In the latter, things gets complicated quickly, let me explain: === Simple case For simple cases, the id is a simple property and the fit is very natural [source] -- @Entity class User { @Id String name; ... } //corresponds to cache.put(name, mapRepresentingUser); -- === Embedded id If the identifier is an embedded id, you have several choices that all have drawbacks. 1. use the embedded id class as key `cache.put( new Name("Emmanuel", "Bernard"), mapRepresentingUser );` 2. use an array of property values `cache.put( new Object[] {"Emmanuel", "Bernard"}, mapRepresentingUser );` 3. use a Map corresponding to the array `cache.put( new HashMap( {{ "firstname" -> "Emmanuel", "lastname"->"Bernard" } ), mapRepresentingUser ); 4. use an synthetic key `cache.put( new PersistentEntityKey( new String[] {"firstname", "lastname" }, new String[] { "Emmanuel", "Bernard" } ), mapRepresentingUser);` In 1, the problem is that we lose the proper data type abstraction between the object model and the data stored. `Name` is a user class. In 2, I think the model is somewhat acceptable but a bit arbitrary. In 3, I suspect the map is pretty horrific to serialize - that could be solved by a externalizer. But more importantly the order of the id columns is lost - even though it might be recoverable with EntityKeyMetadata? In 4, we expose the person querying the grid to our OGM specific type. Aside from this, it is essentially like 4. === Entity key approach I really like the idea of the simple case be mapped directly, it makes for *the* natural mapping one would have chosen. But as I explained, it does not scale. In the composite id case, I don't really know what to chose between 2, 3 and 4. So, should we go for the simple case if we can? Or favor consistency between the simple and complex case? And which of the complex case do we favor? == Association In the case of associations, it becomes a bit trickier because the "simple case" where the association key is made of a single column is quite uncommon. Association keys are one of these combinations: * the fk to the owning entity + the index or key of the List or Map * the fk to the owning entity + the fk to the target entity (Set) * the fk to the owning entity + the list of columns of the simple or * embedded type (Set) * the fk to the owning entity + the surrogate id of the Bag * all columns in case of a non id backed bag All that to say that we are most of the time in the complex case of EntityKey with one of the 4 choices. Any thoughts and preferences? Emmanuel From steve at hibernate.org Tue Nov 25 09:42:29 2014 From: steve at hibernate.org (Steve Ebersole) Date: Tue, 25 Nov 2014 08:42:29 -0600 Subject: [hibernate-dev] Why must abstract be specified in mappings? In-Reply-To: References: Message-ID: There is also the case of non-POJO entities... But the issue is a matter of timing. At the time this information is used (to create the "denormalized table" mapping) we do not yet know the entity Class reference. So it is a matter of practicality given the current Configuration/mapping design. On Tue, Nov 25, 2014 at 4:31 AM, Oskar Berggren wrote: > 2014-11-25 9:29 GMT+01:00 Emmanuel Bernard : > > > This is a user related question that should go on our forums > > https://forums.hibernate.org > > > > It's intended as a question/discussion on the design of Hibernate, which is > why I thought it was relevant here. The background is that the same > question has appeared for NHibernate, which I'm involved with. > > > > > But to answer you, you sometimes want to have a physical table for that > > abstract class. So Hibernate ORM?s ?abstract? really means map it to a > > table or not. Java?s abstract has a different meaning, it means must be > > subclassed or not. Mapping both together does not really work. > > > > According to the documentation, it seems to only be used together with > union-subclass, where the tables for the subclasses must contain columns > also for any base class properties. > > So I can understand that I might want to specify abstract=true for a > non-abstract base class in case I don't want to have instances of it, and > am unable to change the class. But is there any situation where I would > want to have a table for an abstract superclass when using union-subclass? > Wouldn't any columns in such a table be inaccessible anyway due to never > being used by Hibernate? > > > Or to put it another way, if it cannot be removed completely, would this > default value be useful in the sense that it would be correct for most > users most of the time? > > abstract={IsAbstract(theClass)} > > Not that I'm proposing to have it changed, I assume it would be too much of > a compatibility problem. However, in newer and less stable mapping > frameworks (NH's mapping-by-code) it might be possible. > > > > > > Could you propose a small pull request that clarifies this in the > > documentation ? > > > > II think the mechanics of it are ok. When I understand the design issues > that might call for abstract != classIsAbstract, I could certainly submit a > few lines on that. > > > > > Emmanuel > > > > On 24 Nov 2014, at 11:58, Oskar Berggren > wrote: > > > > Hi, > > > > The Hibernate documentation (section 10.1.5. Table per concrete class > > > > > http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch10.html#inheritance-tableperconcrete > > ) says: > > > > If your superclass is abstract, map it with abstract="true". If it is not > > > > abstract, > > > > an additional table (it defaults to PAYMENT in the example above), is > > > > needed > > > > to hold instances of the superclass. > > > > > > Why is this keyword needed? Couldn't abstract classes be detected > > automatically using reflection? > > > > > > /Oskar > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > > > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From emmanuel at hibernate.org Tue Nov 25 11:36:24 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Tue, 25 Nov 2014 17:36:24 +0100 Subject: [hibernate-dev] Why must abstract be specified in mappings? In-Reply-To: References: Message-ID: <20141125163624.GB56235@hibernate.org> Ah you mean for tooling that might not have access to the classpath (assuming the class based entity mode)? Regardless of this Oskar, you are correct, it seems I got it backwards. It would be to express that a non abstract class has no instance and thus no table should be created. If you are working on a type safe programmatic mapping API that receives the class, then you could change that to the default you mention. In fact that's what the annotation based mapping seems to do for Hibernate ORM :) On Tue 2014-11-25 8:42, Steve Ebersole wrote: > There is also the case of non-POJO entities... > > But the issue is a matter of timing. At the time this information is used > (to create the "denormalized table" mapping) we do not yet know the entity > Class reference. So it is a matter of practicality given the current > Configuration/mapping design. > > On Tue, Nov 25, 2014 at 4:31 AM, Oskar Berggren > wrote: > > > 2014-11-25 9:29 GMT+01:00 Emmanuel Bernard : > > > > > This is a user related question that should go on our forums > > > https://forums.hibernate.org > > > > > > > It's intended as a question/discussion on the design of Hibernate, which is > > why I thought it was relevant here. The background is that the same > > question has appeared for NHibernate, which I'm involved with. > > > > > > > > > But to answer you, you sometimes want to have a physical table for that > > > abstract class. So Hibernate ORM?s ?abstract? really means map it to a > > > table or not. Java?s abstract has a different meaning, it means must be > > > subclassed or not. Mapping both together does not really work. > > > > > > > According to the documentation, it seems to only be used together with > > union-subclass, where the tables for the subclasses must contain columns > > also for any base class properties. > > > > So I can understand that I might want to specify abstract=true for a > > non-abstract base class in case I don't want to have instances of it, and > > am unable to change the class. But is there any situation where I would > > want to have a table for an abstract superclass when using union-subclass? > > Wouldn't any columns in such a table be inaccessible anyway due to never > > being used by Hibernate? > > > > > > Or to put it another way, if it cannot be removed completely, would this > > default value be useful in the sense that it would be correct for most > > users most of the time? > > > > abstract={IsAbstract(theClass)} > > > > Not that I'm proposing to have it changed, I assume it would be too much of > > a compatibility problem. However, in newer and less stable mapping > > frameworks (NH's mapping-by-code) it might be possible. > > > > > > > > > > > > Could you propose a small pull request that clarifies this in the > > > documentation ? > > > > > > > II think the mechanics of it are ok. When I understand the design issues > > that might call for abstract != classIsAbstract, I could certainly submit a > > few lines on that. > > > > > > > > > Emmanuel > > > > > > On 24 Nov 2014, at 11:58, Oskar Berggren > > wrote: > > > > > > Hi, > > > > > > The Hibernate documentation (section 10.1.5. Table per concrete class > > > > > > > > http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch10.html#inheritance-tableperconcrete > > > ) says: > > > > > > If your superclass is abstract, map it with abstract="true". If it is not > > > > > > abstract, > > > > > > an additional table (it defaults to PAYMENT in the example above), is > > > > > > needed > > > > > > to hold instances of the superclass. > > > > > > > > > Why is this keyword needed? Couldn't abstract classes be detected > > > automatically using reflection? > > > > > > > > > /Oskar > > > _______________________________________________ > > > hibernate-dev mailing list > > > hibernate-dev at lists.jboss.org > > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > > > > > > > > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > From gunnar at hibernate.org Wed Nov 26 05:19:33 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Wed, 26 Nov 2014 11:19:33 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: <20141125133025.GA56235@hibernate.org> References: <20141125133025.GA56235@hibernate.org> Message-ID: 2014-11-25 14:30 GMT+01:00 Emmanuel Bernard : > Hi, > > With OGM-452 behind us which brings one cache per ?table?, we now have > another decision in front of us. > > Should we use a synthetic key for the cache key (say a > PersistentEntityKey class containing the array of column names and the > array of column values)? > Or should we use the natural object key? > > == Natural entity key > > In the latter, things gets complicated quickly, let me explain: > > === Simple case > > For simple cases, the id is a simple property and the fit is very > natural > > [source] > -- > @Entity > class User { > @Id String name; > ... > } > > //corresponds to > cache.put(name, mapRepresentingUser); > -- > > === Embedded id > > If the identifier is an embedded id, you have several choices that all have > drawbacks. > > 1. use the embedded id class as key `cache.put( new Name("Emmanuel", > "Bernard"), mapRepresentingUser );` > 2. use an array of property values `cache.put( new Object[] {"Emmanuel", > "Bernard"}, mapRepresentingUser );` > Will that work at all? Does ISPN really work with value equality for array-typed keys? In a normal hash map you wouldn't get the value back as new Object[] { "Emmanuel", "Bernard"}.equals( new Object[] {"Emmanuel", "Bernard"} ) is false. So you would have to put the key into a wrapper whose equals method uses Arrays.equals() internally. > 3. use a Map corresponding to the array `cache.put( new > HashMap( {{ "firstname" -> "Emmanuel", "lastname"->"Bernard" > } ), mapRepresentingUser ); > 4. use an synthetic key `cache.put( new PersistentEntityKey( new String[] > {"firstname", "lastname" }, new String[] { "Emmanuel", "Bernard" } ), > mapRepresentingUser);` > > In 1, the problem is that we lose the proper data type abstraction > between the object model and the data stored. `Name` is a user class. > > In 2, I think the model is somewhat acceptable but a bit arbitrary. > > In 3, I suspect the map is pretty horrific to serialize - that could be > solved by a externalizer. But more importantly the order of the id > columns is lost - even though it might be recoverable with > EntityKeyMetadata? > > In 4, we expose the person querying the grid to our OGM specific type. > The current implementation puts a PersistentEntityKey designed as you describe into the cache, but the externalizer only writes the column name and value arrays. This should be readable without knowing the PEK type, right? Of course you need to know the structure of the persisted key in order to read it back. Now Davide's idea was to only write the column value array, as the column names are not really needed (assuming that one cache never contains entries from several tables). This seems sensible to me unless I'm missing some special case. The persisted form would be basically the one from 2., only that there is a wrapper used at the API level. > Aside from this, it is essentially like 4. > > === Entity key approach > > I really like the idea of the simple case be mapped directly, it makes > for *the* natural mapping one would have chosen. But as I explained, it > does not scale. > In the composite id case, I don't really know what to chose between 2, 3 > and 4. > > So, should we go for the simple case if we can? Or favor consistency > between the simple and complex case? And which of the complex case do we favor? > My preference would be 4, with the proposed change of only writing the column values. For the "simple case" we'd then could either store an array of size 1 or just the single value itself, wrapping it into an array when reading it back. I guess that'd require an instanceof call during read back. Not sure whether that's good or bad, probably I'd just always store the array. > > == Association > > In the case of associations, it becomes a bit trickier because the > "simple case" where the association key is made of a single column is > quite uncommon. Association keys are one of these combinations: > > * the fk to the owning entity + the index or key of the List or Map > * the fk to the owning entity + the fk to the target entity (Set) > * the fk to the owning entity + the list of columns of the simple or > * embedded type (Set) > * the fk to the owning entity + the surrogate id of the Bag > * all columns in case of a non id backed bag > > All that to say that we are most of the time in the complex case of > EntityKey with one of the 4 choices. > > Any thoughts and preferences? > > Emmanuel > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Wed Nov 26 06:42:25 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 26 Nov 2014 11:42:25 +0000 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: <20141125133025.GA56235@hibernate.org> References: <20141125133025.GA56235@hibernate.org> Message-ID: It looks like you're aiming at a "pure" mapping into primitives for the datagrid. So it looks very beautiful and tempting to go for a model such as > cache.put( "identifier name", ...) but it seems quite dangerous to me for the same reason that you store (conceptually): {"firstname", "lastname" }, { "Emmanuel", "Bernard" } rather than storing: { "Emmanuel", "Bernard" } Obviously the second one looks more natural in the storage, but you're not really sure what these tokens were supposed to represent in case someone decides to refactor the model. I understand that it's now quite safe to remove the "tablename" in the per-cache-table model, as entries would still be isolated: that was the goal, but also it matches exactly the model proven by the RDBMs model. But there are implications in terms of flexibility and schema evolution if we remove the "column names" and generally speaking it's our only way of validating what an entry was supposed to model. Speaking of, like we don't normally store the "tablename" in a column of a table in an RDBMs, we don't really store its column names either. So an alternative solution which more closely matches the proven RDBMs model would be to store the schema representation of the table in the Cache: personsCache.put( SchemaGenerationId{1}, { ORDERED_ARRAY_STRATEGY, "firstname", "lastname") ); then you would need to store entries linking them to a specific Schema, such as { "Emmanuel", "Bernard", SchemaGenerationId{1} }. such a SchemaGenerationId would be a cheap singleton (one per "table"), and could be stored as efficiently as two integers (one for the Marshaller id and one int for the schema generation id). ORDERED_ARRAY_STRATEGY could be an Enum, and give you some flexibility among your proposals. With the current model I'd stick to the Map as they are the only one safe enough, but with a schema definition like the above description I'd definitely want to use the ordered sequence (array?) as it's far more efficient at all levels. A benefit is that I suspect that you could then transactionally evolve the schema, and it wouldn't be too hard for us to provide a tool to perform an "online schema migration". You make a great point about making it easier to run native queries. Is that a new goal we have? It seems we have to define the goals we want, as the proper data abstraction goal seems to clash with it. I'd rather make a custom Query walker which understand how we store things in Infinispan, and keep the safety of our more verbose and less efficient storage model. For example an inspection tool connected to the grid could choose to not show the "SchemaId" tokens, but use them to be able to render the entry in some human understandable way, like by adding the column names on a table. Some more notes: For HashMap there is a specialized Marshaller already. HashMaps are horrific to instantiate at runtime though, in terms of memory, and also not as efficient as arrays in terms of CPU of course. We didn't mention javax.persistence.IdClass but I assume the same applies. Sanne On 25 November 2014 at 13:30, Emmanuel Bernard wrote: > Hi, > > With OGM-452 behind us which brings one cache per ?table?, we now have > another decision in front of us. > > Should we use a synthetic key for the cache key (say a > PersistentEntityKey class containing the array of column names and the > array of column values)? > Or should we use the natural object key? > > == Natural entity key > > In the latter, things gets complicated quickly, let me explain: > > === Simple case > > For simple cases, the id is a simple property and the fit is very > natural > > [source] > -- > @Entity > class User { > @Id String name; > ... > } > > //corresponds to > cache.put(name, mapRepresentingUser); > -- > > === Embedded id > > If the identifier is an embedded id, you have several choices that all have > drawbacks. > > 1. use the embedded id class as key `cache.put( new Name("Emmanuel", "Bernard"), mapRepresentingUser );` > 2. use an array of property values `cache.put( new Object[] {"Emmanuel", "Bernard"}, mapRepresentingUser );` > 3. use a Map corresponding to the array `cache.put( new HashMap( {{ "firstname" -> "Emmanuel", "lastname"->"Bernard" } ), mapRepresentingUser ); > 4. use an synthetic key `cache.put( new PersistentEntityKey( new String[] {"firstname", "lastname" }, new String[] { "Emmanuel", "Bernard" } ), mapRepresentingUser);` > > In 1, the problem is that we lose the proper data type abstraction > between the object model and the data stored. `Name` is a user class. > > In 2, I think the model is somewhat acceptable but a bit arbitrary. > > In 3, I suspect the map is pretty horrific to serialize - that could be > solved by a externalizer. But more importantly the order of the id > columns is lost - even though it might be recoverable with > EntityKeyMetadata? > > In 4, we expose the person querying the grid to our OGM specific type. > Aside from this, it is essentially like 4. > > === Entity key approach > > I really like the idea of the simple case be mapped directly, it makes > for *the* natural mapping one would have chosen. But as I explained, it > does not scale. > In the composite id case, I don't really know what to chose between 2, 3 > and 4. > > So, should we go for the simple case if we can? Or favor consistency > between the simple and complex case? > And which of the complex case do we favor? > > == Association > > In the case of associations, it becomes a bit trickier because the > "simple case" where the association key is made of a single column is > quite uncommon. Association keys are one of these combinations: > > * the fk to the owning entity + the index or key of the List or Map > * the fk to the owning entity + the fk to the target entity (Set) > * the fk to the owning entity + the list of columns of the simple or > * embedded type (Set) > * the fk to the owning entity + the surrogate id of the Bag > * all columns in case of a non id backed bag > > All that to say that we are most of the time in the complex case of > EntityKey with one of the 4 choices. > > Any thoughts and preferences? > > Emmanuel > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From gunnar at hibernate.org Wed Nov 26 09:21:58 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Wed, 26 Nov 2014 15:21:58 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: References: <20141125133025.GA56235@hibernate.org> Message-ID: 2014-11-26 12:42 GMT+01:00 Sanne Grinovero : > It looks like you're aiming at a "pure" mapping into primitives for > the datagrid. > > So it looks very beautiful and tempting to go for a model such as > > cache.put( "identifier name", ...) > but it seems quite dangerous to me for the same reason that you store > (conceptually): > {"firstname", "lastname" }, { "Emmanuel", "Bernard" } > rather than storing: > { "Emmanuel", "Bernard" } > > Obviously the second one looks more natural in the storage, but you're > not really sure what these tokens were supposed to represent in case > someone decides to refactor the model. > I understand that it's now quite safe to remove the "tablename" in the > per-cache-table model, as entries would still be isolated: that was > the goal, but also it matches exactly the model proven by the RDBMs > model. > But there are implications in terms of flexibility and schema > evolution if we remove the "column names" and generally speaking it's > our only way of validating what an entry was supposed to model. > Yes, evolution is a very strong argument indeed for sticking to the current approach. Without the column names (or some other form of descriptor as suggested below) we will not be able to recognize the version of a given key so we cannot apply any "migrations" to it, either upon loading or via some sort of batch run. > > Speaking of, like we don't normally store the "tablename" in a column > of a table in an RDBMs, we don't really store its column names either. > So an alternative solution which more closely matches the proven RDBMs > model would be to store the schema representation of the table in the > Cache: > > personsCache.put( SchemaGenerationId{1}, { ORDERED_ARRAY_STRATEGY, > "firstname", "lastname") ); > > then you would need to store entries linking them to a specific > Schema, such as { "Emmanuel", "Bernard", SchemaGenerationId{1} }. > > such a SchemaGenerationId would be a cheap singleton (one per > "table"), and could be stored as efficiently as two integers (one for > the Marshaller id and one int for the schema generation id). > > ORDERED_ARRAY_STRATEGY could be an Enum, and give you some flexibility > among your proposals. With the current model I'd stick to the Map as > they are the only one safe enough, but with a schema definition like > the above description I'd definitely want to use the ordered sequence > (array?) as it's far more efficient at all levels. > A benefit is that I suspect that you could then transactionally evolve > the schema, and it wouldn't be too hard for us to provide a tool to > perform an "online schema migration". > That's an interesting idea. Or having a separate KeyDescriptor cache which holds an entry for each key type? Mixing the key definition and records using it within one cache seems a bit odd to me. You make a great point about making it easier to run native queries. > Is that a new goal we have? It seems we have to define the goals we > want, as the proper data abstraction goal seems to clash with it. > I'd rather make a custom Query walker which understand how we store > things in Infinispan, and keep the safety of our more verbose and less > efficient storage model. For example an inspection tool connected to > the grid could choose to not show the "SchemaId" tokens, but use them > to be able to render the entry in some human understandable way, like > by adding the column names on a table. > > Some more notes: > For HashMap there is a specialized Marshaller already. HashMaps are > horrific to instantiate at runtime though, in terms of memory, and > also not as efficient as arrays in terms of CPU of course. > We didn't mention javax.persistence.IdClass but I assume the same applies. > > Sanne > > On 25 November 2014 at 13:30, Emmanuel Bernard > wrote: > > Hi, > > > > With OGM-452 behind us which brings one cache per ?table?, we now have > > another decision in front of us. > > > > Should we use a synthetic key for the cache key (say a > > PersistentEntityKey class containing the array of column names and the > > array of column values)? > > Or should we use the natural object key? > > > > == Natural entity key > > > > In the latter, things gets complicated quickly, let me explain: > > > > === Simple case > > > > For simple cases, the id is a simple property and the fit is very > > natural > > > > [source] > > -- > > @Entity > > class User { > > @Id String name; > > ... > > } > > > > //corresponds to > > cache.put(name, mapRepresentingUser); > > -- > > > > === Embedded id > > > > If the identifier is an embedded id, you have several choices that all > have > > drawbacks. > > > > 1. use the embedded id class as key `cache.put( new Name("Emmanuel", > "Bernard"), mapRepresentingUser );` > > 2. use an array of property values `cache.put( new Object[] {"Emmanuel", > "Bernard"}, mapRepresentingUser );` > > 3. use a Map corresponding to the array `cache.put( new > HashMap( {{ "firstname" -> "Emmanuel", "lastname"->"Bernard" > } ), mapRepresentingUser ); > > 4. use an synthetic key `cache.put( new PersistentEntityKey( new > String[] {"firstname", "lastname" }, new String[] { "Emmanuel", "Bernard" } > ), mapRepresentingUser);` > > > > In 1, the problem is that we lose the proper data type abstraction > > between the object model and the data stored. `Name` is a user class. > > > > In 2, I think the model is somewhat acceptable but a bit arbitrary. > > > > In 3, I suspect the map is pretty horrific to serialize - that could be > > solved by a externalizer. But more importantly the order of the id > > columns is lost - even though it might be recoverable with > > EntityKeyMetadata? > > > > In 4, we expose the person querying the grid to our OGM specific type. > > Aside from this, it is essentially like 4. > > > > === Entity key approach > > > > I really like the idea of the simple case be mapped directly, it makes > > for *the* natural mapping one would have chosen. But as I explained, it > > does not scale. > > In the composite id case, I don't really know what to chose between 2, 3 > > and 4. > > > > So, should we go for the simple case if we can? Or favor consistency > > between the simple and complex case? > > And which of the complex case do we favor? > > > > == Association > > > > In the case of associations, it becomes a bit trickier because the > > "simple case" where the association key is made of a single column is > > quite uncommon. Association keys are one of these combinations: > > > > * the fk to the owning entity + the index or key of the List or Map > > * the fk to the owning entity + the fk to the target entity (Set) > > * the fk to the owning entity + the list of columns of the simple or > > * embedded type (Set) > > * the fk to the owning entity + the surrogate id of the Bag > > * all columns in case of a non id backed bag > > > > All that to say that we are most of the time in the complex case of > > EntityKey with one of the 4 choices. > > > > Any thoughts and preferences? > > > > Emmanuel > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Wed Nov 26 09:32:51 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 26 Nov 2014 14:32:51 +0000 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: References: <20141125133025.GA56235@hibernate.org> Message-ID: On 26 November 2014 at 10:19, Gunnar Morling wrote: > 2014-11-25 14:30 GMT+01:00 Emmanuel Bernard : > >> Hi, >> >> With OGM-452 behind us which brings one cache per ?table?, we now have >> another decision in front of us. >> >> Should we use a synthetic key for the cache key (say a >> PersistentEntityKey class containing the array of column names and the >> array of column values)? >> Or should we use the natural object key? >> >> == Natural entity key >> >> In the latter, things gets complicated quickly, let me explain: >> >> === Simple case >> >> For simple cases, the id is a simple property and the fit is very >> natural >> >> [source] >> -- >> @Entity >> class User { >> @Id String name; >> ... >> } >> >> //corresponds to >> cache.put(name, mapRepresentingUser); >> -- >> >> === Embedded id >> >> If the identifier is an embedded id, you have several choices that all have >> drawbacks. >> >> 1. use the embedded id class as key `cache.put( new Name("Emmanuel", >> "Bernard"), mapRepresentingUser );` >> 2. use an array of property values `cache.put( new Object[] {"Emmanuel", >> "Bernard"}, mapRepresentingUser );` >> > > Will that work at all? Does ISPN really work with value equality for > array-typed keys? > > In a normal hash map you wouldn't get the value back as new Object[] { > "Emmanuel", "Bernard"}.equals( new Object[] {"Emmanuel", "Bernard"} ) is > false. So you would have to put the key into a wrapper whose equals method > uses Arrays.equals() internally. Good catch. But yes, you could get Infinispan to work like that as you can override the Equality function, and I think it even has one for arrays out of the box, although it was meant for byte[] which is of course a strong use case. So it can be done, but that doesn't make it a better idea of course. >> 3. use a Map corresponding to the array `cache.put( new >> HashMap( {{ "firstname" -> "Emmanuel", "lastname"->"Bernard" >> } ), mapRepresentingUser ); >> 4. use an synthetic key `cache.put( new PersistentEntityKey( new String[] >> {"firstname", "lastname" }, new String[] { "Emmanuel", "Bernard" } ), >> mapRepresentingUser);` >> >> In 1, the problem is that we lose the proper data type abstraction >> between the object model and the data stored. `Name` is a user class. >> >> In 2, I think the model is somewhat acceptable but a bit arbitrary. >> >> In 3, I suspect the map is pretty horrific to serialize - that could be >> solved by a externalizer. But more importantly the order of the id >> columns is lost - even though it might be recoverable with >> EntityKeyMetadata? >> >> In 4, we expose the person querying the grid to our OGM specific type. >> > > The current implementation puts a PersistentEntityKey designed as you > describe into the cache, but the externalizer only writes the column name > and value arrays. This should be readable without knowing the PEK type, > right? Of course you need to know the structure of the persisted key in > order to read it back. Right. By controlling the Externalizer code, we can use OGM specific types but different tools could use a different Externalizer to interpret the data in a different way. So you won't need the PersistentEntityKey class definition to explore the cache content, but still you need some utility which knows how to decode the byte stream. Remember there is no such thing as a Json based console for Infinispan, so even storing things as a simple touple of Strings.. doesn't necessarily make it easy to look into. > Now Davide's idea was to only write the column value array, as the column > names are not really needed (assuming that one cache never contains entries > from several tables). This seems sensible to me unless I'm missing some > special case. The persisted form would be basically the one from 2., only > that there is a wrapper used at the API level. I agree that should work, but raises the same questions from my parallel email. Sanne >> Aside from this, it is essentially like 4. >> >> === Entity key approach >> >> I really like the idea of the simple case be mapped directly, it makes >> for *the* natural mapping one would have chosen. But as I explained, it >> does not scale. >> In the composite id case, I don't really know what to chose between 2, 3 >> and 4. >> >> So, should we go for the simple case if we can? Or favor consistency >> between the simple and complex case? > > And which of the complex case do we favor? >> > > My preference would be 4, with the proposed change of only writing the > column values. For the "simple case" we'd then could either store an array > of size 1 or just the single value itself, wrapping it into an array when > reading it back. I guess that'd require an instanceof call during read > back. Not sure whether that's good or bad, probably I'd just always store > the array. > > >> >> == Association >> >> In the case of associations, it becomes a bit trickier because the >> "simple case" where the association key is made of a single column is >> quite uncommon. Association keys are one of these combinations: >> >> * the fk to the owning entity + the index or key of the List or Map >> * the fk to the owning entity + the fk to the target entity (Set) >> * the fk to the owning entity + the list of columns of the simple or >> * embedded type (Set) >> * the fk to the owning entity + the surrogate id of the Bag >> * all columns in case of a non id backed bag >> >> All that to say that we are most of the time in the complex case of >> EntityKey with one of the 4 choices. >> >> Any thoughts and preferences? >> >> Emmanuel >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From emmanuel at hibernate.org Wed Nov 26 10:55:34 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Wed, 26 Nov 2014 16:55:34 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: References: <20141125133025.GA56235@hibernate.org> Message-ID: <76FA0511-3821-40E3-A22A-8FBA87DE21B1@hibernate.org> > 2. use an array of property values `cache.put( new Object[] {"Emmanuel", "Bernard"}, mapRepresentingUser );` > > Will that work at all? Does ISPN really work with value equality for array-typed keys? > > In a normal hash map you wouldn't get the value back as new Object[] {"Emmanuel", "Bernard"}.equals( new Object[] {"Emmanuel", "Bernard"} ) is false. So you would have to put the key into a wrapper whose equals method uses Arrays.equals() internally. OK > > 3. use a Map corresponding to the array `cache.put( new HashMap( {{ "firstname" -> "Emmanuel", "lastname"->"Bernard" } ), mapRepresentingUser ); > 4. use an synthetic key `cache.put( new PersistentEntityKey( new String[] {"firstname", "lastname" }, new String[] { "Emmanuel", "Bernard" } ), mapRepresentingUser);` > > In 1, the problem is that we lose the proper data type abstraction > between the object model and the data stored. `Name` is a user class. > > In 2, I think the model is somewhat acceptable but a bit arbitrary. > > In 3, I suspect the map is pretty horrific to serialize - that could be > solved by a externalizer. But more importantly the order of the id > columns is lost - even though it might be recoverable with > EntityKeyMetadata? > > In 4, we expose the person querying the grid to our OGM specific type. > > The current implementation puts a PersistentEntityKey designed as you describe into the cache, but the externalizer only writes the column name and value arrays. This should be readable without knowing the PEK type, right? Of course you need to know the structure of the persisted key in order to read it back. What I am not sure about is whether one can have the same externalizer id plugged to different unmarshallers depending on the node / classpath you live in. But take the M/R framework of Infinispan today, it would require to put the PersistentEntityKey class in the CP of all nodes at present. > > > Now Davide's idea was to only write the column value array, as the column names are not really needed (assuming that one cache never contains entries from several tables). This seems sensible to me unless I'm missing some special case. The persisted form would be basically the one from 2., only that there is a wrapper used at the API level. As Sanne mentioned, a case for keeping the column names would be if the id structure changes somehow. One would need a way to distinguish the old from the new representation. There are many ways to approach that: - keep the structure in back key - do the schema reference Sanne mentions - rename the existing cache TABLE_OLD and migrate the data on the fly from TABLE_OLD to TABLE_NEW In most NoSQLs things are rather proposed and encouraged, in the data grid space it?s do whatever you want. The question is which options do we want to support for the grid. For example Sanne?s schema reference feels very intrusive to me. It?s something that should be handled by the NoSQL system if it was meant to offer such approach. > > Aside from this, it is essentially like 4. > > === Entity key approach > > I really like the idea of the simple case be mapped directly, it makes > for *the* natural mapping one would have chosen. But as I explained, it > does not scale. > In the composite id case, I don't really know what to chose between 2, 3 > and 4. > > So, should we go for the simple case if we can? Or favor consistency > between the simple and complex case? > And which of the complex case do we favor? > > My preference would be 4, with the proposed change of only writing the column values. For the "simple case" we'd then could either store an array of size 1 or just the single value itself, wrapping it into an array when reading it back. I guess that'd require an instanceof call during read back. Not sure whether that's good or bad, probably I'd just always store the array. I don?t think you can quite do that. To be able to do an instanceof, you need an instance. And to build that instance from bytes, you need a type. From emmanuel at hibernate.org Wed Nov 26 10:55:38 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Wed, 26 Nov 2014 16:55:38 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: References: <20141125133025.GA56235@hibernate.org> Message-ID: > On 26 Nov 2014, at 12:42, Sanne Grinovero wrote: > > ORDERED_ARRAY_STRATEGY could be an Enum, and give you some flexibility > among your proposals. With the current model I'd stick to the Map as > they are the only one safe enough, I don?t know what you mean by ordered array strategy and enum. The rest of the sentence seems to imply that you prefer option 3 even for the single id column case. Correct? > You make a great point about making it easier to run native queries. > Is that a new goal we have? It seems we have to define the goals we > want, as the proper data abstraction goal seems to clash with it. > I'd rather make a custom Query walker which understand how we store > things in Infinispan, and keep the safety of our more verbose and less > efficient storage model. For example an inspection tool connected to > the grid could choose to not show the "SchemaId" tokens, but use them > to be able to render the entry in some human understandable way, like > by adding the column names on a table. These are not really new goals. Goal #1: make the most natural mapping as possible as if you were not using the ORM but rather use the tool directly. Goal #2: expose the native query capabilities as a first class citizen and on equal footing as the JP-QL support to benefit from the specificities of your NoSQL backend. Non Goal: Hibernate OGM is not in the database business - at least until we explore the polyglot persistence topic :) Now Goal #1 is a bit blurred by the fact that you could consider the use of a data grid as a secondary and mostly temporary store of a data set persisted elsewhere. I which case the JPA API prevails as the entry point and how you store the data in the grid is not important. But that?s one use case. > We didn't mention javax.persistence.IdClass but I assume the same applies. Yes, IdClass with a specific type are like embeddable ids essentially. And implicit IdClass (forgot what they are called) means that the entity class itself is also the id class. From emmanuel at hibernate.org Wed Nov 26 11:28:59 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Wed, 26 Nov 2014 17:28:59 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: References: <20141125133025.GA56235@hibernate.org> Message-ID: > On 26 Nov 2014, at 15:21, Gunnar Morling wrote: > > -11-26 12:42 GMT+01:00 Sanne Grinovero >: > It looks like you're aiming at a "pure" mapping into primitives for > the datagrid. > > So it looks very beautiful and tempting to go for a model such as > > cache.put( "identifier name", ...) > but it seems quite dangerous to me for the same reason that you store > (conceptually): > {"firstname", "lastname" }, { "Emmanuel", "Bernard" } > rather than storing: > { "Emmanuel", "Bernard" } > > Obviously the second one looks more natural in the storage, but you're > not really sure what these tokens were supposed to represent in case > someone decides to refactor the model. > I understand that it's now quite safe to remove the "tablename" in the > per-cache-table model, as entries would still be isolated: that was > the goal, but also it matches exactly the model proven by the RDBMs > model. > But there are implications in terms of flexibility and schema > evolution if we remove the "column names" and generally speaking it's > our only way of validating what an entry was supposed to model. > > Yes, evolution is a very strong argument indeed for sticking to the current approach. Without the column names (or some other form of descriptor as suggested below) we will not be able to recognize the version of a given key so we cannot apply any "migrations" to it, either upon loading or via some sort of batch run. Let me challenge that a bit even if I understand that there is a potential problem. type and id are the invariable part of the data you put in a datastore. So the data migration / morphing does happen on the *value* much more than on the key itself. You would be able to apply migrations in that case. > > > Speaking of, like we don't normally store the "tablename" in a column > of a table in an RDBMs, we don't really store its column names either. > So an alternative solution which more closely matches the proven RDBMs > model would be to store the schema representation of the table in the > Cache: > > personsCache.put( SchemaGenerationId{1}, { ORDERED_ARRAY_STRATEGY, > "firstname", "lastname") ); > > then you would need to store entries linking them to a specific > Schema, such as { "Emmanuel", "Bernard", SchemaGenerationId{1} }. > > such a SchemaGenerationId would be a cheap singleton (one per > "table"), and could be stored as efficiently as two integers (one for > the Marshaller id and one int for the schema generation id). > > ORDERED_ARRAY_STRATEGY could be an Enum, and give you some flexibility > among your proposals. With the current model I'd stick to the Map as > they are the only one safe enough, but with a schema definition like > the above description I'd definitely want to use the ordered sequence > (array?) as it's far more efficient at all levels. > A benefit is that I suspect that you could then transactionally evolve > the schema, and it wouldn't be too hard for us to provide a tool to > perform an "online schema migration". > > That's an interesting idea. Or having a separate KeyDescriptor cache which holds an entry for each key type? Mixing the key definition and records using it within one cache seems a bit odd to me. It is interesting. But are we in the database business? If we are interested in this approach, maybe we should create a side project that offers schema atop the most common k/v? From steve at hibernate.org Wed Nov 26 19:23:44 2014 From: steve at hibernate.org (Steve Ebersole) Date: Wed, 26 Nov 2014 18:23:44 -0600 Subject: [hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0 Message-ID: Part of the goals for ORM 5.0 is moving from Configuration to the ServiceRegistry+Metadata for building a SessionFactory. One of the points I ran into that will have to change is org.hibernate.persister.spi.PersisterFactory. The problems is that PersisterFactory accepts a Configuration as part of building CollectionPersisters. The need for Configuration in the standard CollectionPersister impls is amazingly trivial; we literally use it to locate the associated entity's PersistentClass to grab the classes dom4j node name, and this is right after we have just resolved the corresponding EntityPersister. The point being that the standard CollectionPersisters really don't need access to the Configuration. I am pretty sure OGM provides a custom PersisterFactory, or is it just the PersisterClassResolver that OGM provides? Also, I would assume OGM is providing custom CollectionPersister impls. This change would affect both usages. I wanted y'all to be aware of this upcoming change. But I also wanted to start a discussion about what the signature(s) should become. Currently we pass: * Configuration * Collection (the parsed mapping info) * CollectionRegionAccessStrategy * SessionFactoryImplementor I suggest we pass: * Collection * CollectionRegionAccessStrategy * SessionFactoryImplementor * Mapping (I changed order to align with the order for building EntityPersisters) Mapping is org.hibernate.engine.spi.Mapping which is part of Configuration. I decided to (at least temporarily) port this contract forward to ease migration. Metadata implements it. There is a similar discussion to be had wrt Integrators. I will follow up with an email specific to them later. From gunnar at hibernate.org Thu Nov 27 03:13:47 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Thu, 27 Nov 2014 09:13:47 +0100 Subject: [hibernate-dev] [OGM] storing the column names in the entity keys for K/V stores In-Reply-To: References: <20141125133025.GA56235@hibernate.org> Message-ID: 2014-11-26 17:28 GMT+01:00 Emmanuel Bernard : > > > On 26 Nov 2014, at 15:21, Gunnar Morling wrote: > > > > -11-26 12:42 GMT+01:00 Sanne Grinovero sanne at hibernate.org>>: > > It looks like you're aiming at a "pure" mapping into primitives for > > the datagrid. > > > > So it looks very beautiful and tempting to go for a model such as > > > cache.put( "identifier name", ...) > > but it seems quite dangerous to me for the same reason that you store > > (conceptually): > > {"firstname", "lastname" }, { "Emmanuel", "Bernard" } > > rather than storing: > > { "Emmanuel", "Bernard" } > > > > Obviously the second one looks more natural in the storage, but you're > > not really sure what these tokens were supposed to represent in case > > someone decides to refactor the model. > > I understand that it's now quite safe to remove the "tablename" in the > > per-cache-table model, as entries would still be isolated: that was > > the goal, but also it matches exactly the model proven by the RDBMs > > model. > > But there are implications in terms of flexibility and schema > > evolution if we remove the "column names" and generally speaking it's > > our only way of validating what an entry was supposed to model. > > > > Yes, evolution is a very strong argument indeed for sticking to the > current approach. Without the column names (or some other form of > descriptor as suggested below) we will not be able to recognize the version > of a given key so we cannot apply any "migrations" to it, either upon > loading or via some sort of batch run. > > Let me challenge that a bit even if I understand that there is a potential > problem. type and id are the invariable part of the data you put in a > datastore. > So the data migration / morphing does happen on the *value* much more than > on the key itself. > You would be able to apply migrations in that case. > True, the need for evolution will be higher for the values, but can we really completely rule it out for keys in stores without a fixed-schema? It seems to be a restriction we'd apply, whereas a user otherwise would be free to e.g. add a column to the key. > > > > Speaking of, like we don't normally store the "tablename" in a column > > of a table in an RDBMs, we don't really store its column names either. > > So an alternative solution which more closely matches the proven RDBMs > > model would be to store the schema representation of the table in the > > Cache: > > > > personsCache.put( SchemaGenerationId{1}, { ORDERED_ARRAY_STRATEGY, > > "firstname", "lastname") ); > > > > then you would need to store entries linking them to a specific > > Schema, such as { "Emmanuel", "Bernard", SchemaGenerationId{1} }. > > > > such a SchemaGenerationId would be a cheap singleton (one per > > "table"), and could be stored as efficiently as two integers (one for > > the Marshaller id and one int for the schema generation id). > > > > ORDERED_ARRAY_STRATEGY could be an Enum, and give you some flexibility > > among your proposals. With the current model I'd stick to the Map as > > they are the only one safe enough, but with a schema definition like > > the above description I'd definitely want to use the ordered sequence > > (array?) as it's far more efficient at all levels. > > A benefit is that I suspect that you could then transactionally evolve > > the schema, and it wouldn't be too hard for us to provide a tool to > > perform an "online schema migration". > > > > That's an interesting idea. Or having a separate KeyDescriptor cache > which holds an entry for each key type? Mixing the key definition and > records using it within one cache seems a bit odd to me. > > It is interesting. But are we in the database business? > If we are interested in this approach, maybe we should create a side > project that offers schema atop the most common k/v? > It's a grey area. It'd basically be a way to describe the "schema" for each single record in a more efficient manner. It'd not be a schema description per table/cache. I guess that's one of the general issues of K/V stores which don't know much about the data; A document store at least know the syntactical structure and could store field names via references to a shared constant pool rather than persisting them within each document. > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From gunnar at hibernate.org Thu Nov 27 04:13:46 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Thu, 27 Nov 2014 10:13:46 +0100 Subject: [hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0 In-Reply-To: References: Message-ID: Hi, 2014-11-27 1:23 GMT+01:00 Steve Ebersole : > Part of the goals for ORM 5.0 is moving from Configuration to the > ServiceRegistry+Metadata for building a SessionFactory. > > One of the points I ran into that will have to change > is org.hibernate.persister.spi.PersisterFactory. The problems is that > PersisterFactory accepts a Configuration as part of building > CollectionPersisters. The need for Configuration in the standard > CollectionPersister impls is amazingly trivial; we literally use it to > locate the associated entity's PersistentClass to grab the classes dom4j > node name, and this is right after we have just resolved the corresponding > EntityPersister. The point being that the standard CollectionPersisters > really don't need access to the Configuration. > > I am pretty sure OGM provides a custom PersisterFactory, or is it just > the PersisterClassResolver that OGM provides? Also, I would assume OGM is > providing custom CollectionPersister impls. This change would affect both > usages. > We don't have a custom PersisterFactory, but there are OgmPersisterClassResolver [1] and OgmCollectionPersister [2]. In the latter we accept a Configuration in the constructor but just pass it to the super 'ctor (AbstractCollectionPersister). We don't do anything ourselves with it. > I wanted y'all to be aware of this upcoming change. But I also wanted to > start a discussion about what the signature(s) should become. Currently we > pass: > > * Configuration > * Collection (the parsed mapping info) > * CollectionRegionAccessStrategy > * SessionFactoryImplementor > > > I suggest we pass: > > * Collection > * CollectionRegionAccessStrategy > * SessionFactoryImplementor > * Mapping > Should be fine for OGM. I suggest to wrap it into a parameter object ("PersisterInitializationContext" or so). That way stuff can be added down the road without the need to instantly adapt existing persisters. (I changed order to align with the order for building EntityPersisters) > > Mapping is org.hibernate.engine.spi.Mapping which is part of > Configuration. I decided to (at least temporarily) port this contract > forward to ease migration. Metadata implements it. > > There is a similar discussion to be had wrt Integrators. I will follow up > with an email specific to them later. > Regarding the removal of Configuration in general, there will be some more work to be done in OGM. We have a custom sub-class, OgmConfiguration [3], which is used for two purposes: 1) Set some properties automatically (to enable OGM's naming strategy and query translator etc., use a specific mass indexer for Hibernate Search) 2) Provide an entry point into the API for setting store specific options, e.g. like so: OgmConfiguration ogmCfg = ...; ogmCfg.configureOptionsFor( MongoDB.class ) .entity( GolfPlayer.class ) .writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED ); We'll need a way to still do 1). 2) is not really required. We provide an alternative anyways, for cases where you don't bootstrap OGM yourself. You can specify a callback class via configuration properties, which then will be invoked and provides the entry point to the fluent API. --Gunnar [1] https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/jpa/impl/OgmPersisterClassResolver.java [2] https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java [3] https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/cfg/OgmConfiguration.java > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From emmanuel at hibernate.org Thu Nov 27 05:36:42 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 27 Nov 2014 11:36:42 +0100 Subject: [hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0 In-Reply-To: References: Message-ID: To add on Gunnar?s needs 3. Use Configuration to extract physical Table structure We also use configuration in the SchemaDefiner The SchemaDefiner received the Configuration from a custom implementation of SessionFactoryObserver and use it during sessionFactoryCreated. The reason we use Configuration is so that this SchemaDefiner contract can: - access to specific properties (say hibernate.0gm.neo4j.index create-drop ) - get information about the table, it?s unique constraints as shown in this pseudo example Iterator tableMappings = configuration.getTableMappings(); while ( tableMappings.hasNext() ) { Table table = tableMappings.next(); if ( table.isPhysicalTable() ) { Label label = label( table.getName() ); PrimaryKey primaryKey = table.getPrimaryKey(); createConstraint( neo4jDb, table, label, primaryKey ); @SuppressWarnings("unchecked") Iterator columnIterator = table.getColumnIterator(); while ( columnIterator.hasNext() ) { Column column = columnIterator.next(); if ( column.isUnique() ) { createUniqueConstraintIfMissing( neo4jDb, label, column.getName() ); } } Iterator uniqueKeyIterator = table.getUniqueKeyIterator(); while ( uniqueKeyIterator.hasNext() ) { createConstraint( neo4jDb, table, label, uniqueKeyIterator.next() ); } } } > On 27 Nov 2014, at 10:13, Gunnar Morling wrote: > > Hi, > > 2014-11-27 1:23 GMT+01:00 Steve Ebersole >: > >> Part of the goals for ORM 5.0 is moving from Configuration to the >> ServiceRegistry+Metadata for building a SessionFactory. >> >> One of the points I ran into that will have to change >> is org.hibernate.persister.spi.PersisterFactory. The problems is that >> PersisterFactory accepts a Configuration as part of building >> CollectionPersisters. The need for Configuration in the standard >> CollectionPersister impls is amazingly trivial; we literally use it to >> locate the associated entity's PersistentClass to grab the classes dom4j >> node name, and this is right after we have just resolved the corresponding >> EntityPersister. The point being that the standard CollectionPersisters >> really don't need access to the Configuration. >> >> I am pretty sure OGM provides a custom PersisterFactory, or is it just >> the PersisterClassResolver that OGM provides? Also, I would assume OGM is >> providing custom CollectionPersister impls. This change would affect both >> usages. >> > > We don't have a custom PersisterFactory, but there are > OgmPersisterClassResolver [1] and OgmCollectionPersister [2]. In the latter > we accept a Configuration in the constructor but just pass it to the super > 'ctor (AbstractCollectionPersister). We don't do anything ourselves with it. > > >> I wanted y'all to be aware of this upcoming change. But I also wanted to >> start a discussion about what the signature(s) should become. Currently we >> pass: >> >> * Configuration >> * Collection (the parsed mapping info) >> * CollectionRegionAccessStrategy >> * SessionFactoryImplementor >> >> >> I suggest we pass: >> >> * Collection >> * CollectionRegionAccessStrategy >> * SessionFactoryImplementor >> * Mapping >> > > Should be fine for OGM. I suggest to wrap it into a parameter object > ("PersisterInitializationContext" or so). That way stuff can be added down > the road without the need to instantly adapt existing persisters. > > (I changed order to align with the order for building EntityPersisters) >> >> Mapping is org.hibernate.engine.spi.Mapping which is part of >> Configuration. I decided to (at least temporarily) port this contract >> forward to ease migration. Metadata implements it. >> >> There is a similar discussion to be had wrt Integrators. I will follow up >> with an email specific to them later. >> > > Regarding the removal of Configuration in general, there will be some more > work to be done in OGM. We have a custom sub-class, OgmConfiguration [3], > which is used for two purposes: > > 1) Set some properties automatically (to enable OGM's naming strategy and > query translator etc., use a specific mass indexer for Hibernate Search) > 2) Provide an entry point into the API for setting store specific options, > e.g. like so: > > OgmConfiguration ogmCfg = ...; > ogmCfg.configureOptionsFor( MongoDB.class ) > .entity( GolfPlayer.class ) > .writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED ); > > We'll need a way to still do 1). > > 2) is not really required. We provide an alternative anyways, for cases > where you don't bootstrap OGM yourself. You can specify a callback class > via configuration properties, which then will be invoked and provides the > entry point to the fluent API. > > --Gunnar > > [1] > https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/jpa/impl/OgmPersisterClassResolver.java > [2] > https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java > [3] > https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/cfg/OgmConfiguration.java > > > >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From steve at hibernate.org Thu Nov 27 11:14:11 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 27 Nov 2014 10:14:11 -0600 Subject: [hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0 In-Reply-To: References: Message-ID: On Thu, Nov 27, 2014 at 3:13 AM, Gunnar Morling wrote: > Hi, > > 2014-11-27 1:23 GMT+01:00 Steve Ebersole : > >> Part of the goals for ORM 5.0 is moving from Configuration to the >> ServiceRegistry+Metadata for building a SessionFactory. >> >> One of the points I ran into that will have to change >> is org.hibernate.persister.spi.PersisterFactory. The problems is that >> PersisterFactory accepts a Configuration as part of building >> CollectionPersisters. The need for Configuration in the standard >> CollectionPersister impls is amazingly trivial; we literally use it to >> locate the associated entity's PersistentClass to grab the classes dom4j >> node name, and this is right after we have just resolved the corresponding >> EntityPersister. The point being that the standard CollectionPersisters >> really don't need access to the Configuration. >> >> I am pretty sure OGM provides a custom PersisterFactory, or is it just >> the PersisterClassResolver that OGM provides? Also, I would assume OGM is >> providing custom CollectionPersister impls. This change would affect both >> usages. >> > > We don't have a custom PersisterFactory, but there are > OgmPersisterClassResolver [1] and OgmCollectionPersister [2]. In the latter > we accept a Configuration in the constructor but just pass it to the super > 'ctor (AbstractCollectionPersister). We don't do anything ourselves with it. > org.hibernate.persister.spi.PersisterClassResolver would not be affected. But any collection persisters returned from it would be due to their ctors. > >> I wanted y'all to be aware of this upcoming change. But I also wanted to >> start a discussion about what the signature(s) should become. Currently >> we >> pass: >> >> * Configuration >> * Collection (the parsed mapping info) >> * CollectionRegionAccessStrategy >> * SessionFactoryImplementor >> >> >> I suggest we pass: >> >> * Collection >> * CollectionRegionAccessStrategy >> * SessionFactoryImplementor >> * Mapping >> > > Should be fine for OGM. I suggest to wrap it into a parameter object > ("PersisterInitializationContext" or so). That way stuff can be added down > the road without the need to instantly adapt existing persisters. > You know how much I love parameter objects :) For just this reason... future-proofing. I do worry some about the overhead of instantiating all these though. Would be good to understand the implications in that regard. In fact, if we do this, we may want to do the same for EntityPersister building. > > (I changed order to align with the order for building EntityPersisters) >> >> Mapping is org.hibernate.engine.spi.Mapping which is part of >> Configuration. I decided to (at least temporarily) port this contract >> forward to ease migration. Metadata implements it. >> >> There is a similar discussion to be had wrt Integrators. I will follow up >> with an email specific to them later. >> > > Regarding the removal of Configuration in general, there will be some more > work to be done in OGM. We have a custom sub-class, OgmConfiguration [3], > which is used for two purposes: > > 1) Set some properties automatically (to enable OGM's naming strategy and > query translator etc., use a specific mass indexer for Hibernate Search) > These types of things would be done via the various bootstrap hooks. I say "various" because there are multiple depending on what exactly you are trying to achieve, each comes into play at different points in the bootstrap process. > 2) Provide an entry point into the API for setting store specific options, > e.g. like so: > > OgmConfiguration ogmCfg = ...; > ogmCfg.configureOptionsFor( MongoDB.class ) > .entity( GolfPlayer.class ) > .writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED ); > This is akin to the bootstrap "builders" in ORM. The important point is to think about where this fits logically in the bootstrap process. This is the key differentiation between Configuration and this new bootstrap approach. From steve at hibernate.org Thu Nov 27 11:25:50 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 27 Nov 2014 10:25:50 -0600 Subject: [hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0 In-Reply-To: References: Message-ID: Well naturally there is still access to all this information :) IMO SessionFactoryObserver is a hack way of doing this. With 5.0, the way to do this would be one of the various bootstrap hooks I mentioned earlier. Specifically you want a hook that is called just after all metadata is fully known. BTW, for 5.0 the "metadata" is still using the mappings as defined in the org.hibernate.mapping package. So all that code fragment will continue to work aside from actually using the Configuration. Interestingly, had you used org.hibernate.cfg.Mappings#iterateTables rather than Configuration#getTableMappings(), this code would have continued to work with no changes at all. This is the point I made in the initial email about Metadata also being a org.hibernate.cfg.Mappings. On Thu, Nov 27, 2014 at 4:36 AM, Emmanuel Bernard wrote: > To add on Gunnar?s needs > > 3. Use Configuration to extract physical Table structure > > We also use configuration in the SchemaDefiner > The SchemaDefiner received the Configuration from a custom implementation > of SessionFactoryObserver and use it during sessionFactoryCreated. > > The reason we use Configuration is so that this SchemaDefiner contract can: > > - access to specific properties (say hibernate.0gm.neo4j.index create-drop > ) > - get information about the table, it?s unique constraints as shown in > this pseudo example > > Iterator
tableMappings = configuration.getTableMappings(); > while ( tableMappings.hasNext() ) { > Table table = tableMappings.next(); > if ( table.isPhysicalTable() ) { > Label label = label( table.getName() ); > PrimaryKey primaryKey = table.getPrimaryKey(); > createConstraint( neo4jDb, table, label, primaryKey ); > @SuppressWarnings("unchecked") > Iterator columnIterator = table.getColumnIterator(); > while ( columnIterator.hasNext() ) { > Column column = columnIterator.next(); > if ( column.isUnique() ) { > createUniqueConstraintIfMissing( neo4jDb, label, > column.getName() ); > } > } > Iterator uniqueKeyIterator = table.getUniqueKeyIterator(); > while ( uniqueKeyIterator.hasNext() ) { > createConstraint( neo4jDb, table, label, uniqueKeyIterator.next() > ); > } > } > } > > > > > On 27 Nov 2014, at 10:13, Gunnar Morling wrote: > > Hi, > > 2014-11-27 1:23 GMT+01:00 Steve Ebersole : > > Part of the goals for ORM 5.0 is moving from Configuration to the > ServiceRegistry+Metadata for building a SessionFactory. > > One of the points I ran into that will have to change > is org.hibernate.persister.spi.PersisterFactory. The problems is that > PersisterFactory accepts a Configuration as part of building > CollectionPersisters. The need for Configuration in the standard > CollectionPersister impls is amazingly trivial; we literally use it to > locate the associated entity's PersistentClass to grab the classes dom4j > node name, and this is right after we have just resolved the corresponding > EntityPersister. The point being that the standard CollectionPersisters > really don't need access to the Configuration. > > I am pretty sure OGM provides a custom PersisterFactory, or is it just > the PersisterClassResolver that OGM provides? Also, I would assume OGM is > providing custom CollectionPersister impls. This change would affect both > usages. > > > We don't have a custom PersisterFactory, but there are > OgmPersisterClassResolver [1] and OgmCollectionPersister [2]. In the latter > we accept a Configuration in the constructor but just pass it to the super > 'ctor (AbstractCollectionPersister). We don't do anything ourselves with > it. > > > I wanted y'all to be aware of this upcoming change. But I also wanted to > start a discussion about what the signature(s) should become. Currently we > pass: > > * Configuration > * Collection (the parsed mapping info) > * CollectionRegionAccessStrategy > * SessionFactoryImplementor > > > I suggest we pass: > > * Collection > * CollectionRegionAccessStrategy > * SessionFactoryImplementor > * Mapping > > > Should be fine for OGM. I suggest to wrap it into a parameter object > ("PersisterInitializationContext" or so). That way stuff can be added down > the road without the need to instantly adapt existing persisters. > > (I changed order to align with the order for building EntityPersisters) > > > Mapping is org.hibernate.engine.spi.Mapping which is part of > Configuration. I decided to (at least temporarily) port this contract > forward to ease migration. Metadata implements it. > > There is a similar discussion to be had wrt Integrators. I will follow up > with an email specific to them later. > > > Regarding the removal of Configuration in general, there will be some more > work to be done in OGM. We have a custom sub-class, OgmConfiguration [3], > which is used for two purposes: > > 1) Set some properties automatically (to enable OGM's naming strategy and > query translator etc., use a specific mass indexer for Hibernate Search) > 2) Provide an entry point into the API for setting store specific options, > e.g. like so: > > OgmConfiguration ogmCfg = ...; > ogmCfg.configureOptionsFor( MongoDB.class ) > .entity( GolfPlayer.class ) > .writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED ); > > We'll need a way to still do 1). > > 2) is not really required. We provide an alternative anyways, for cases > where you don't bootstrap OGM yourself. You can specify a callback class > via configuration properties, which then will be invoked and provides the > entry point to the fluent API. > > --Gunnar > > [1] > > https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/jpa/impl/OgmPersisterClassResolver.java > [2] > > https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java > [3] > > https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/cfg/OgmConfiguration.java > > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > From steve at hibernate.org Thu Nov 27 11:35:29 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 27 Nov 2014 10:35:29 -0600 Subject: [hibernate-dev] org.hibernate.persister.spi.PersisterFactory and 5.0 In-Reply-To: References: Message-ID: Actually, I take that back about Metadata extending org.hibernate.cfg.Mappings. I had contemplated doing that, but decided against it since Mappings exposes all kinds of "extra" stuff that isn't actually mappings/metadata (config info, contextual info, etc) and I did not want to fuglify these new contracts that way. On Thu, Nov 27, 2014 at 10:25 AM, Steve Ebersole wrote: > Well naturally there is still access to all this information :) > > IMO SessionFactoryObserver is a hack way of doing this. With 5.0, the > way to do this would be one of the various bootstrap hooks I mentioned > earlier. Specifically you want a hook that is called just after all > metadata is fully known. > > BTW, for 5.0 the "metadata" is still using the mappings as defined in the > org.hibernate.mapping package. So all that code fragment will continue to > work aside from actually using the Configuration. Interestingly, had you > used org.hibernate.cfg.Mappings#iterateTables rather than Configuration#getTableMappings(), > this code would have continued to work with no changes at all. This is the > point I made in the initial email about Metadata also being a > org.hibernate.cfg.Mappings. > > > On Thu, Nov 27, 2014 at 4:36 AM, Emmanuel Bernard > wrote: > >> To add on Gunnar?s needs >> >> 3. Use Configuration to extract physical Table structure >> >> We also use configuration in the SchemaDefiner >> The SchemaDefiner received the Configuration from a custom implementation >> of SessionFactoryObserver and use it during sessionFactoryCreated. >> >> The reason we use Configuration is so that this SchemaDefiner contract >> can: >> >> - access to specific properties (say hibernate.0gm.neo4j.index >> create-drop ) >> - get information about the table, it?s unique constraints as shown in >> this pseudo example >> >> Iterator
tableMappings = configuration.getTableMappings(); >> while ( tableMappings.hasNext() ) { >> Table table = tableMappings.next(); >> if ( table.isPhysicalTable() ) { >> Label label = label( table.getName() ); >> PrimaryKey primaryKey = table.getPrimaryKey(); >> createConstraint( neo4jDb, table, label, primaryKey ); >> @SuppressWarnings("unchecked") >> Iterator columnIterator = table.getColumnIterator(); >> while ( columnIterator.hasNext() ) { >> Column column = columnIterator.next(); >> if ( column.isUnique() ) { >> createUniqueConstraintIfMissing( neo4jDb, label, >> column.getName() ); >> } >> } >> Iterator uniqueKeyIterator = >> table.getUniqueKeyIterator(); >> while ( uniqueKeyIterator.hasNext() ) { >> createConstraint( neo4jDb, table, label, >> uniqueKeyIterator.next() ); >> } >> } >> } >> >> >> >> >> On 27 Nov 2014, at 10:13, Gunnar Morling wrote: >> >> Hi, >> >> 2014-11-27 1:23 GMT+01:00 Steve Ebersole : >> >> Part of the goals for ORM 5.0 is moving from Configuration to the >> ServiceRegistry+Metadata for building a SessionFactory. >> >> One of the points I ran into that will have to change >> is org.hibernate.persister.spi.PersisterFactory. The problems is that >> PersisterFactory accepts a Configuration as part of building >> CollectionPersisters. The need for Configuration in the standard >> CollectionPersister impls is amazingly trivial; we literally use it to >> locate the associated entity's PersistentClass to grab the classes dom4j >> node name, and this is right after we have just resolved the corresponding >> EntityPersister. The point being that the standard CollectionPersisters >> really don't need access to the Configuration. >> >> I am pretty sure OGM provides a custom PersisterFactory, or is it just >> the PersisterClassResolver that OGM provides? Also, I would assume OGM is >> providing custom CollectionPersister impls. This change would affect both >> usages. >> >> >> We don't have a custom PersisterFactory, but there are >> OgmPersisterClassResolver [1] and OgmCollectionPersister [2]. In the >> latter >> we accept a Configuration in the constructor but just pass it to the super >> 'ctor (AbstractCollectionPersister). We don't do anything ourselves with >> it. >> >> >> I wanted y'all to be aware of this upcoming change. But I also wanted to >> start a discussion about what the signature(s) should become. Currently >> we >> pass: >> >> * Configuration >> * Collection (the parsed mapping info) >> * CollectionRegionAccessStrategy >> * SessionFactoryImplementor >> >> >> I suggest we pass: >> >> * Collection >> * CollectionRegionAccessStrategy >> * SessionFactoryImplementor >> * Mapping >> >> >> Should be fine for OGM. I suggest to wrap it into a parameter object >> ("PersisterInitializationContext" or so). That way stuff can be added down >> the road without the need to instantly adapt existing persisters. >> >> (I changed order to align with the order for building EntityPersisters) >> >> >> Mapping is org.hibernate.engine.spi.Mapping which is part of >> Configuration. I decided to (at least temporarily) port this contract >> forward to ease migration. Metadata implements it. >> >> There is a similar discussion to be had wrt Integrators. I will follow up >> with an email specific to them later. >> >> >> Regarding the removal of Configuration in general, there will be some more >> work to be done in OGM. We have a custom sub-class, OgmConfiguration [3], >> which is used for two purposes: >> >> 1) Set some properties automatically (to enable OGM's naming strategy and >> query translator etc., use a specific mass indexer for Hibernate Search) >> 2) Provide an entry point into the API for setting store specific options, >> e.g. like so: >> >> OgmConfiguration ogmCfg = ...; >> ogmCfg.configureOptionsFor( MongoDB.class ) >> .entity( GolfPlayer.class ) >> .writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED ); >> >> We'll need a way to still do 1). >> >> 2) is not really required. We provide an alternative anyways, for cases >> where you don't bootstrap OGM yourself. You can specify a callback class >> via configuration properties, which then will be invoked and provides the >> entry point to the fluent API. >> >> --Gunnar >> >> [1] >> >> https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/jpa/impl/OgmPersisterClassResolver.java >> [2] >> >> https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java >> [3] >> >> https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java/org/hibernate/ogm/cfg/OgmConfiguration.java >> >> >> >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> >> >> > From golovnin at gmx.net Thu Nov 27 15:41:54 2014 From: golovnin at gmx.net (Andrej Golovnin) Date: Thu, 27 Nov 2014 21:41:54 +0100 Subject: [hibernate-dev] Closed pull requests In-Reply-To: References: <84D5AADC-23D4-4377-AED7-1EB88869FF30@gmx.net> <7B4B4720-5C93-43C7-BDD8-F515CAA1A4F6@gmx.net> Message-ID: Hi Steve, > > https://github.com/hibernate/hibernate-orm/pull/777 > > > > > > > Overall, checking that the PR still applies is a good idea too. while working on a new pull request for the issue HHH-9324 I have noticed that the new master misses some dialects: Oracle12cDialect PostgreSQL92Dialect PostgreSQL94Dialect Are you going to restore this dialects from the old master or should I add them back with the new pull request? Best regards, Andrej Golovnin From gunnar at hibernate.org Fri Nov 28 05:00:31 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Fri, 28 Nov 2014 11:00:31 +0100 Subject: [hibernate-dev] Main feed on in.relation.to broken Message-ID: Hi, When going to in.relation.to, I only see a minority of posts, apparently those authored by Hardy. The other posts are still there, if I select a blogger in the menu, I see all their posts. Someone knows how to make all posts show up again on the main feed? Thanks, --Gunnar From gunnar at hibernate.org Fri Nov 28 06:08:36 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Fri, 28 Nov 2014 12:08:36 +0100 Subject: [hibernate-dev] Making it pluggable how GenerationType.AUTO is mapped Message-ID: Hi Steve, all, For OGM it would be beneficial if there was an extension point in ORM which allows us to customize how GenerationType.AUTO is mapped. AFAICS, that's currently semi-hard coded in ORM. Depending on whether "new_generator_mappings" is set, either SEQUENCE (true) or "native" (false) will be used. Now for the MongoDB grid dialect we'd ideally do the following: If the id of an entity is declared as org.bson.typesObjectId or @Type(type = "objectid") String then map AUTO to IDENTITY (ObjectId is a MongoDB-specific type which resembles an identity column). Otherwise map it to TABLE (or SEQUENCE, which transparently falls back to TABLE). I.e. this decision would not be a global one, but depend on the specific id type. Would this be feasible to do? or is it mandated by JPA somehow that AUTO is always mapped in the same way? I cannot judge on the amount of changes required in ORM as atm. AUTO always is mapped in the same way, it doesn't depend on the specific entity and its id type. Any thoughts? Thanks, --Gunnar From emmanuel at hibernate.org Fri Nov 28 07:45:16 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Fri, 28 Nov 2014 13:45:16 +0100 Subject: [hibernate-dev] Main feed on in.relation.to broken In-Reply-To: References: Message-ID: <20141128124516.GE9842@hibernate.org> For the record, this should be all fixed. Somebody removed the "Everyone" page from the Blogger directory and moved it to Hardy's directory. Not a trivial thing to do I must say. On Fri 2014-11-28 11:00, Gunnar Morling wrote: > Hi, > > When going to in.relation.to, I only see a minority of posts, apparently > those authored by Hardy. The other posts are still there, if I select a > blogger in the menu, I see all their posts. > > Someone knows how to make all posts show up again on the main feed? > > Thanks, > > --Gunnar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Sun Nov 30 17:22:35 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Sun, 30 Nov 2014 22:22:35 +0000 Subject: [hibernate-dev] Maintenance on ci.hibernate.org Message-ID: All, we needed to do some unplanned maintenance on ci.hibernate.org. At some point it was clear that we needed do deploy some significant upgrades so while Davide fixed Apache HTTPD, I went ahead and updated all of Jenkins plugins as well.. which I usually avoid to not need checking all builds and integrations with external services, but this time all validations would be needed anyway. So: - I'm sorry if you received some false notifications from it. - If some builds are now broken, it might need some reconfiguration. - same for plugins configurations: I'm unable to double-check all things you've all setup. Please let me know what isn't working anymore, or if you have a moment to volunteer looking yourself that would be great. # Reminder Anyone in the Hibernate organization on GitHub has configuration and write permissions on this server; if you know what you're doing feel free to take advantage of that but please always share a summary of what you did / plan to do. Sanne From sanne at hibernate.org Sun Nov 30 19:01:39 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Mon, 1 Dec 2014 00:01:39 +0000 Subject: [hibernate-dev] Maintenance of github hooks for Hibernate ORM Message-ID: Hi Steve, I was checking our web-hooks and various integrations, noticed two thing with the hooks setup for ORM: # bitbucket The hook wasn't working as github refused to deliver the metadata as the SSL certificate would fail, as the hook was setup to use the old URL "hibernate.onjira.com" rather than "hibernate.atlassian.net". I've replaced the notification from https://hibernate.onjira.com/rest/bitbucket/1.0/repository/28/sync to https://hibernate.atlassian.net/rest/bitbucket/1.0/repository/28/sync and it seems it accepts it now. I don't know however what the purpose of this hook is, so I hope having fixed this doesn't cause any trouble. Also it seems other projects have a similar hook, but use a different number? For example hibernate-metamodelgen has: https://hibernate.onjira.com/rest/bitbucket/1.0/repository/34/sync Should I update all domain names keeping the number as-is? # Post-Bin log This smart URL that you had put in place to track forced pushes seems to no longer work: http://www.postbin.org/1c9pv3l Should we replace it with something else? It seems to have been replaced by requestb.in Thanks, Sanne