From gunnar at hibernate.org Mon Aug 4 04:30:00 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Mon, 4 Aug 2014 10:30:00 +0200 Subject: [hibernate-dev] Exposing Hibernate statistics via JMX In-Reply-To: References: Message-ID: Anyone with an idea of what's the recommended way of exposing Hibernate statistics via JMX as of 4.3? Thanks, --Gunnar 2014-07-31 14:02 GMT+02:00 Gunnar Morling : > Steve, all, > > I've been asked about the Hibernate statistics functionality which used to > be accessible via JMX. > > There used to be StatisticsService which was an MBean and which one could > register with the JMX platform. This has been removed a while ago, and > there is the related issue HHH-6190 which still is open. > > Until this is resolved, what is the recommended strategy towards making > the statistics available via JMX? Should users create and export their own > MBean based on SessionFactory#getStatistics()? Or is there any other > replacement for StatisticsService? > > Thanks, > > --Gunnar > > [1] https://hibernate.atlassian.net/browse/HHH-6190 > > From smarlow at redhat.com Tue Aug 5 10:52:10 2014 From: smarlow at redhat.com (Scott Marlow) Date: Tue, 05 Aug 2014 10:52:10 -0400 Subject: [hibernate-dev] JdbcSession proposal In-Reply-To: <53AA3284.3070309@redhat.com> References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> Message-ID: <53E0EF9A.4060306@redhat.com> Steve, This is the test case that I was talking about on IRC. It simulates what happens when several remote EJB calls occur using the same JTA transaction. This case is probably common enough that we should solve it. The workaround is to set hibernate.jta.track_by_thread=false. On 06/24/2014 10:23 PM, Scott Marlow wrote: > I pushed a test case that simulates what can happen with remote EJB > invocations that share the same JTA transaction & EntityManager. The > "Transaction was rolled back in a different thread!" error [2] is thrown > but shouldn't be, since the active application thread has changed to a > different thread (which can happen). The workaround is to set > "hibernate.jta.track_by_thread" to false. > > I think that we need to save the thread id at the start of every > application call into the EntityManager. > > Scott > > [1] https://github.com/scottmarlow/hibernate-orm/tree/sametx_multithreads > > [2] https://gist.github.com/scottmarlow/63c4ab686368853d759b > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From smarlow at redhat.com Tue Aug 5 11:32:46 2014 From: smarlow at redhat.com (Scott Marlow) Date: Tue, 05 Aug 2014 11:32:46 -0400 Subject: [hibernate-dev] JdbcSession proposal In-Reply-To: <53E0EF9A.4060306@redhat.com> References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> Message-ID: <53E0F91E.6040005@redhat.com> More in-line below. On 08/05/2014 10:52 AM, Scott Marlow wrote: > Steve, > > This is the test case that I was talking about on IRC. It simulates > what happens when several remote EJB calls occur using the same JTA > transaction. This case is probably common enough that we should solve it. > > The workaround is to set hibernate.jta.track_by_thread=false. > > > > On 06/24/2014 10:23 PM, Scott Marlow wrote: >> I pushed a test case that simulates what can happen with remote EJB >> invocations that share the same JTA transaction & EntityManager. The >> "Transaction was rolled back in a different thread!" error [2] is thrown >> but shouldn't be, since the active application thread has changed to a >> different thread (which can happen). The workaround is to set >> "hibernate.jta.track_by_thread" to false. >> >> I think that we need to save the thread id at the start of every >> application call into the EntityManager. I'm wondering if a different approach than using the thread id, would cover more cases (specifically the distributed + remote cases). For example, adding a configuration option for a session level lock that the SessionImpl implements, to protect against two threads calling into the same session concurrently. >> >> Scott >> >> [1] https://github.com/scottmarlow/hibernate-orm/tree/sametx_multithreads >> >> [2] https://gist.github.com/scottmarlow/63c4ab686368853d759b >> _______________________________________________ >> 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 Aug 6 17:18:21 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 06 Aug 2014 17:18:21 -0400 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: <53E0F91E.6040005@redhat.com> References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> Message-ID: <53E29B9D.1090305@redhat.com> Either the subject or email isn't working to discuss this. Hence, the rename. On 08/05/2014 11:32 AM, Scott Marlow wrote: > More in-line below. > > On 08/05/2014 10:52 AM, Scott Marlow wrote: >> Steve, >> >> This is the test case that I was talking about on IRC. It simulates >> what happens when several remote EJB calls occur using the same JTA >> transaction. This case is probably common enough that we should solve it. >> >> The workaround is to set hibernate.jta.track_by_thread=false. >> >> >> >> On 06/24/2014 10:23 PM, Scott Marlow wrote: >>> I pushed a test case that simulates what can happen with remote EJB >>> invocations that share the same JTA transaction & EntityManager. The >>> "Transaction was rolled back in a different thread!" error [2] is thrown >>> but shouldn't be, since the active application thread has changed to a >>> different thread (which can happen). The workaround is to set >>> "hibernate.jta.track_by_thread" to false. >>> >>> I think that we need to save the thread id at the start of every >>> application call into the EntityManager. > > I'm wondering if a different approach than using the thread id, would > cover more cases (specifically the distributed + remote cases). For > example, adding a configuration option for a session level lock that the > SessionImpl implements, to protect against two threads calling into the > same session concurrently. > >>> >>> Scott >>> >>> [1] https://github.com/scottmarlow/hibernate-orm/tree/sametx_multithreads >>> >>> [2] https://gist.github.com/scottmarlow/63c4ab686368853d759b >>> _______________________________________________ >>> 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 jlesinge at gmail.com Thu Aug 7 04:10:15 2014 From: jlesinge at gmail.com (John Worrell) Date: Thu, 7 Aug 2014 09:10:15 +0100 Subject: [hibernate-dev] Contributing to OGM / Cassandra In-Reply-To: References: <6B5FA68A-59CD-4CAD-81EB-3AC2CCBBE55C@hibernate.org> Message-ID: Hi Emmanuel et al., My apologies for the log radio silence. I've taken a look at the code-base on Jon Halliday's repo, and have set up a nick on freenode - #jlesinge. On the time-series question I was wondering how you envisaged the data stored: I tend to think of a single row under an primary key with an object-instance per column. Now what we have typically done (generally the data has been immutable) is to store the data serialized as a blob (JSON or XML), but I understand you do not favour this approach. With this sort of model I imagine the collection is then all the objects stored in the row, and the challenge is to page through the objects in the row. An approach we have often taken is to create multiple copies of data in different (obviously works well only for immutable objects) or better to create a table of keys to a main table where in either approach the row-keys are effectively a foreign-key and there is column per object associated through the foreign-key. Another approach though might be to use a column with type list (or set, or map) to contain keys to the associated objects - this would be a little like the extensions Oracle have for mapping 1-* associations, though with the caveat that a column of collection type may only contain 64k elements. I wondered if some though had been given to this strategy (which I must admit I have not yet used myself). It seems very likely that different mapping strategies should be specifiable, but then I have still to understand how these might fit with treiid. Can I ask about assumptions: is it fair to assume that for Cassandra, OGM will target only CQL 3 (which means Cassandra 2 or maybe 1.2)? This would certainly make life simpler. An issue I don't see addressed is the choice of consistency-level (read or write) and I wondered if there was a plan for this? Assumptions can be made on a per table basis, but, certainly for ad hoc queries, it is important think to have the flexibility to specify on a per-query basis. Those are my thoughts so far... I'll see about doing a POC of some of what I have described above Cheers, John On Mon, Jul 21, 2014 at 4:48 PM, John Worrell wrote: > Hi Emmanuel, > > I'll take a look at what is there, and I'll get up and running on IRC. > > I'll particularly look at the time-series issue - non-trivial I think. > > Cheers, > > John > > > On Mon, Jul 21, 2014 at 1:06 PM, Emmanuel Bernard > wrote: > >> Hi John, >> >> I thought I had replied to you on Friday but apparently the email never >> went through :/ >> >> That is good news :) >> Jonathan worked on a Cassandra prototype but had to drop due to other >> duties. He pushed everything at >> https://github.com/jhalliday/hibernate-ogm/tree/jonathan_cassandra >> >> Have a look at what he has done and come ask any question to Gunnar, >> Davide or me. There are a bunch of moving pieces. We are mostly on >> freenode?s #hibernate-dev ( you need a freenode login >> http://freenode.net/faq.shtml#nicksetup ). If you are allergic to IRC, >> let me know and we will find alternatives. >> >> The most interesting challenge will be to see how we can map time series >> into a collection and make sure we let the user decide how much he wants to >> load. >> >> Emmanuel >> >> On 16 Jul 2014, at 13:17, John Worrell wrote: >> >> > Hi, >> > >> > I'm interested in contributing to the Cassandra module of Hibernate-OGM >> - >> > what would be the baest way to go about this? >> > >> > Thanks, >> > >> > John >> > _______________________________________________ >> > hibernate-dev mailing list >> > hibernate-dev at lists.jboss.org >> > https://lists.jboss.org/mailman/listinfo/hibernate-dev >> >> > From sanne at hibernate.org Thu Aug 7 11:02:29 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 7 Aug 2014 16:02:29 +0100 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: <53E29B9D.1090305@redhat.com> References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> <53E29B9D.1090305@redhat.com> Message-ID: Steve, we had a conversation about this on IRC, I think we came to a ? hopefully? nice ? ?solution . [15:18] andrigtmiller: I still think you're locking out the TXM, not making it possible to legitimately timeout queries.. [15:19] (but I don't have the full picture.. not really my area) [15:19] that is a transaction manager concern but they already handled calling other synchronization call backs. currently, Arjuna holds a lock on the collection of synchronizations at that time, so there should be no conflict [15:20] I asked about your concern yesterday to make sure we wouldn't deadlock [15:20] I wasn't actually thinking about deadlock, I just don't see what you're aiming at with the single lock on the Session [15:22] to avoid calling Hibernate session.clear from a background thread while the application thread is also doing a Hibernate session invocation. which can lead to random exceptions [15:22] I'm aiming at solving the concurrency concern ^ [15:22] But I guess you'd need to talk with sebersole, this lock thing you're proposing comes out of the blue for me :) [15:22] yes I get that [15:23] but you should allow the session.clear() to proceed, not lock it out [15:23] sure, I'm just trying to talk to who ever listens and have feedback. Before I get anyway near code changes, Sebersole needs to be on board (he isn't yet) [15:24] I'm neither :) willing to discuss for sake of interest, but can't replace sebersole on this I think :) [15:24] I posted on as7 dev mailing list a few years ago and the only feedback that I got was that only Hibernate was not handling concurrency but there could be others [15:25] what is the effect you expect to have users see when the background thread kills the current session? [15:25] I cross posted as well [15:25] users shouldn't get NPE errors or unexpected exceptions [15:26] sure, but what kind of effect would you propose? [15:26] I guess a different exception with a better error message? [15:26] my goal is ensuring that only one thread is invoking the Hibernate session at a time [15:27] No that's not true, as you're saying that you want to allow the TXM to rollback the transaction [15:27] well, want is a strong word :) [15:28] IBM/Oracle/JBoss all do that [15:28] and that's an implementation detail what you just explained :) [15:28] what I'm asking is what you expect the user to experience when this needs to happen [15:29] when the transaction is rolled back, depending on where the application code is in the Hibernate session invocation, a JDBC error might occur or something related to that. The goal is to avoid mutating the Hibernate session from two different threads concurrently [15:30] you're not answering my question, that's an implementation detail :) [15:30] if we can avoid violating concurrency of the hibernate session, I think we will be more robust. [15:31] The goal of the TXM timeout, is to kill stuff which is taking too long.. not allowing it to finish in a safe lock. andrigtmiller am I understanding the basics correctly? [15:31] currently, what the user will experience is poor. The scope of turning that into a more pleasant experience is a good question but involves many moving and separate parts [15:32] so you actually _need_ to allow concurrent access, to kill and rollback the operations which are being done [15:32] the goal of TXM timeout handling in JBoss/Oracle/IBM is to also handle deadlocks that might not otherwise be recovered from [15:32] the concurrent access happens at the resource level [15:33] from the background, with components that handle concurrency. Hibernate doesn't [15:33] that's just one part of the things [15:33] and we can definitely have Hibernate handle some concurrent events [15:33] Hibernate sessions are not supposed to handle concurrency, so its a design flaw [15:33] the TXM shouldn't invoke clear() (which is public API) but invoke a specific method which could provide the needed semantics [15:33] its not some events, its many events [15:34] why do you say it's a design flaw? it's not, for the "normal" public API usage [15:34] the TXM, calls the Hibernate Synchronization.afterCompletion(int) and Hibernate detaches entities [15:34] and Hibernate does other cleaning up as well [15:35] its a design flaw as its not handled in our system [15:35] I don't feel I'm making progress in the conversation if you keep repeating the implementation details, we can fix that as we please [15:35] but you have to explain the expected user experience [15:36] you mean if we didn't have any constraints of any of the existing specs that we implement? [15:36] yes, just explain what you think it should do please, that would help me understand, and I think I can propose you something more concrete [15:37] if we ignore XA, JTA + JPA, I can answer the question better and will attempt that [15:37] the problem is the user sees an NPE right? [15:38] could be an NPE or any unexpected exception that comes from using a thread-unsafe component from multiple threads [15:38] so the basic question is what do you think the user should "see".. I guess another exception, say HibernateRolledBackException("The Transaction Manager decided we run out of time") [15:38] sure. would you like the above proposal ^ [15:39] Because implementing that is easy :) [15:41] ? If you're busy I'm happy to talk later, I am 3h late with my lunch [15:41] in a perfect world, 1) the user registers an application event listener that tells that the transaction timed out. 2) whether the application thread catches a signal that the transaction is about to be rolled back. 3) The application thread then catches a signal that the transaction was rolled back [15:41] that doesn't explain what you expect the client code to experience. [15:41] 4) the application thread then catches a signal that Synchronization call backs are going to happen to clean up after the roll back [15:42] say the user was incoking a "Query.list()" .. what do we return? [15:42] what could they expect? They could be in the middle of code that doesn't use the Hibernate session or could be in code that does [15:43] Exactly my point, so we'd return an exception like I proposed above right? [15:43] if you say so but no one knows how to do that [15:43] I mean, I'm not sure what returns that [15:44] we had tried doing what you suggest but it was too performance expensive and covered too few cases [15:44] but sure, throwing an EJB rolledback exception is ideal [15:45] you can do it in an efficient way, but yes I agree you'd have to patch several areas of code. [15:45] I'd do it incrementally though, start with the Session and Query APIs, see if people like it [15:45] our previous attempt that failed, added a pre-check at the front of every Hibernate session call, tail end and middle [15:46] but that didn't work because it didn't handle remote transactions or distributed transactions [15:46] the EntityManager implementation has some kind of "exception translator" [15:46] and performance suffered [15:46] all you need to do is catch exceptions, and re-throw the better explanation [15:46] so, we have less of the checking today and still don't handle remote transactions and distributed transactions [15:47] the TXM just needs to flag a volatile field in the Session to inject the error it wants us to tell [15:47] so on the optimal path you just have a volatile field read operation, which is a zero cost essentially [15:47] (optimal path I mean the case in which there are no errors) [15:48] then we need to poll for that flag in the start/middle/end (or so) if every Hibernate method [15:48] no [15:48] or maybe in the finally clause of every method [15:48] you just need to catch exceptions [15:48] and we happen to already do that, because you need to translate all Hibernate specific exceptions to JPA specific ones [15:49] so it's actually a very simple patch with zero overhead I think [15:49] at worse, we catch exceptions (including NPE) and notice the flag and then eat the cause exception? [15:49] +1 [15:49] if we show the cause, its confusing [15:49] you don't need the finally method either though [15:49] if we eat it, its confusing [15:49] right, don't show the cause. [15:49] I hate when exceptions are eaten [15:50] well.. the TXM should provide you a sensible error message, like "aborted because of ... ", and we take that as explanation. [15:50] but only if that flag is set [15:50] of course! [15:50] sounds like a worthwhile idea, thanks [15:51] np, I'm very happy if it works :) [15:51] the exception translation is already done somewhere in the EM project [15:51] I don't remember the details, but I'm sure you're more familiar with it [15:51] just make sure you look that up [15:52] it catches all exceptions from Hibernate to wrap them in something else, to satisfy the spec requirements -- Sanne From gunnar at hibernate.org Thu Aug 7 11:26:24 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Thu, 7 Aug 2014 17:26:24 +0200 Subject: [hibernate-dev] Using raw vs. wildcard types Message-ID: Hi, every now and then I run into usages of raw types in our code bases: * Class entityType (instead of Class) * Set querySpaces (instead of Set) ... I first thought that'd be left-overs from ancient times but apparently this is also done in newly written code. I don't like it as in some cases it's clearly a loss of information which requires investigation in surrounding code to find out e.g. which types are put into a raw Set. In other cases (e.g. Class) I prefer to use the wildcard type (Class) as it avoids many raw-type warnings in the IDE (which otherwise may obfuscate legitimate warnings). Is there any reason for using raw types in new code rather than full generic or wildcard types? Personally I try to fix existing usages of raw types and avoid to add new ones if possible, but sometimes I can't (e.g. one cannot override a method expecting a Class with a method expecting a Class). Thanks, --Gunnar From smarlow at redhat.com Thu Aug 7 11:33:29 2014 From: smarlow at redhat.com (Scott Marlow) Date: Thu, 07 Aug 2014 11:33:29 -0400 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> <53E29B9D.1090305@redhat.com> Message-ID: <53E39C49.5010309@redhat.com> Sanne, One question that I didn't ask before, when the Hibernate Synchronization.afterCompletion(int) is called (with rolledback TX status), how does Hibernate know if the transaction was rolled back from the transaction reaper thread? I tried checking the thread name in WildFly integration code but that is wrong, as the thread name may be a transaction manager communications thread that is invoked on behalf of a remote (JVM) reaper thread. Currently, are checking thread ids which does not work for the distributed case involving multiple jvms. The current approach also does not work for remote invocations that use the same JTA transaction (as the below test case simulates). Scott On 08/07/2014 11:02 AM, Sanne Grinovero wrote: > Steve, > we had a conversation about this on IRC, I think we came to a > ? hopefully? > nice > ? > ?solution > . > > [15:18] andrigtmiller: I still think you're locking out > the TXM, not making it possible to legitimately timeout queries.. > [15:19] (but I don't have the full picture.. not really > my area) > [15:19] that is a transaction manager concern but they already > handled calling other synchronization call backs. currently, Arjuna > holds a lock on the collection of synchronizations at that time, so > there should be no conflict > [15:20] I asked about your concern yesterday to make sure we > wouldn't deadlock > [15:20] I wasn't actually thinking about deadlock, I > just don't see what you're aiming at with the single lock on the Session > [15:22] to avoid calling Hibernate session.clear from a > background thread while the application thread is also doing a Hibernate > session invocation. which can lead to random exceptions > [15:22] I'm aiming at solving the concurrency concern ^ > [15:22] But I guess you'd need to talk with sebersole, > this lock thing you're proposing comes out of the blue for me :) > [15:22] yes I get that > [15:23] but you should allow the session.clear() to > proceed, not lock it out > [15:23] sure, I'm just trying to talk to who ever listens and > have feedback. Before I get anyway near code changes, Sebersole needs > to be on board (he isn't yet) > [15:24] I'm neither :) willing to discuss for sake of > interest, but can't replace sebersole on this I think :) > [15:24] I posted on as7 dev mailing list a few years ago and > the only feedback that I got was that only Hibernate was not handling > concurrency but there could be others > [15:25] what is the effect you expect to have users see > when the background thread kills the current session? > [15:25] I cross posted as well > [15:25] users shouldn't get NPE errors or unexpected exceptions > [15:26] sure, but what kind of effect would you propose? > [15:26] I guess a different exception with a better > error message? > [15:26] my goal is ensuring that only one thread is invoking > the Hibernate session at a time > [15:27] No that's not true, as you're saying that you > want to allow the TXM to rollback the transaction > [15:27] well, want is a strong word :) > [15:28] IBM/Oracle/JBoss all do that > [15:28] and that's an implementation detail what you > just explained :) > [15:28] what I'm asking is what you expect the user to > experience when this needs to happen > [15:29] when the transaction is rolled back, depending on > where the application code is in the Hibernate session invocation, a > JDBC error might occur or something related to that. The goal is to > avoid mutating the Hibernate session from two different threads concurrently > [15:30] you're not answering my question, that's an > implementation detail :) > [15:30] if we can avoid violating concurrency of the hibernate > session, I think we will be more robust. > [15:31] The goal of the TXM timeout, is to kill stuff > which is taking too long.. not allowing it to finish in a safe lock. > andrigtmiller am I understanding the basics correctly? > [15:31] currently, what the user will experience is poor. The > scope of turning that into a more pleasant experience is a good question > but involves many moving and separate parts > [15:32] so you actually _need_ to allow concurrent > access, to kill and rollback the operations which are being done > [15:32] the goal of TXM timeout handling in JBoss/Oracle/IBM > is to also handle deadlocks that might not otherwise be recovered from > [15:32] the concurrent access happens at the resource level > [15:33] from the background, with components that handle > concurrency. Hibernate doesn't > [15:33] that's just one part of the things > [15:33] and we can definitely have Hibernate handle > some concurrent events > [15:33] Hibernate sessions are not supposed to handle > concurrency, so its a design flaw > [15:33] the TXM shouldn't invoke clear() (which is > public API) but invoke a specific method which could provide the needed > semantics > [15:33] its not some events, its many events > [15:34] why do you say it's a design flaw? it's not, > for the "normal" public API usage > [15:34] the TXM, calls the Hibernate > Synchronization.afterCompletion(int) and Hibernate detaches entities > [15:34] and Hibernate does other cleaning up as well > [15:35] its a design flaw as its not handled in our system > [15:35] I don't feel I'm making progress in the > conversation if you keep repeating the implementation details, we can > fix that as we please > [15:35] but you have to explain the expected user > experience > [15:36] you mean if we didn't have any constraints of any of > the existing specs that we implement? > [15:36] yes, just explain what you think it should do > please, that would help me understand, and I think I can propose you > something more concrete > [15:37] if we ignore XA, JTA + JPA, I can answer the question > better and will attempt that > [15:37] the problem is the user sees an NPE right? > [15:38] could be an NPE or any unexpected exception that comes > from using a thread-unsafe component from multiple threads > [15:38] so the basic question is what do you think the > user should "see".. I guess another exception, say > HibernateRolledBackException("The Transaction Manager decided we run out > of time") > [15:38] sure. would you like the above proposal ^ > [15:39] Because implementing that is easy :) > [15:41] ? If you're busy I'm happy to talk later, I am > 3h late with my lunch > [15:41] in a perfect world, 1) the user registers an > application event listener that tells that the transaction timed out. > 2) whether the application thread catches a signal that the > transaction is about to be rolled back. 3) The application thread then > catches a signal that the transaction was rolled back > [15:41] that doesn't explain what you expect the client > code to experience. > [15:41] 4) the application thread then catches a signal that > Synchronization call backs are going to happen to clean up after the > roll back > [15:42] say the user was incoking a "Query.list()" .. > what do we return? > [15:42] what could they expect? They could be in the middle > of code that doesn't use the Hibernate session or could be in code that does > [15:43] Exactly my point, so we'd return an exception > like I proposed above right? > [15:43] if you say so but no one knows how to do that > [15:43] I mean, I'm not sure what returns that > [15:44] we had tried doing what you suggest but it was too > performance expensive and covered too few cases > [15:44] but sure, throwing an EJB rolledback exception is ideal > [15:45] you can do it in an efficient way, but yes I > agree you'd have to patch several areas of code. > [15:45] I'd do it incrementally though, start with the > Session and Query APIs, see if people like it > [15:45] our previous attempt that failed, added a pre-check at > the front of every Hibernate session call, tail end and middle > [15:46] but that didn't work because it didn't handle remote > transactions or distributed transactions > [15:46] the EntityManager implementation has some kind > of "exception translator" > [15:46] and performance suffered > [15:46] all you need to do is catch exceptions, and > re-throw the better explanation > [15:46] so, we have less of the checking today and still don't > handle remote transactions and distributed transactions > [15:47] the TXM just needs to flag a volatile field in > the Session to inject the error it wants us to tell > [15:47] so on the optimal path you just have a volatile > field read operation, which is a zero cost essentially > [15:47] (optimal path I mean the case in which there > are no errors) > [15:48] then we need to poll for that flag in the > start/middle/end (or so) if every Hibernate method > [15:48] no > [15:48] or maybe in the finally clause of every method > [15:48] you just need to catch exceptions > [15:48] and we happen to already do that, because you > need to translate all Hibernate specific exceptions to JPA specific ones > [15:49] so it's actually a very simple patch with zero > overhead I think > [15:49] at worse, we catch exceptions (including NPE) and > notice the flag and then eat the cause exception? > [15:49] +1 > [15:49] if we show the cause, its confusing > [15:49] you don't need the finally method either though > [15:49] if we eat it, its confusing > [15:49] right, don't show the cause. > [15:49] I hate when exceptions are eaten > [15:50] well.. the TXM should provide you a sensible > error message, like "aborted because of ... ", and we take that as > explanation. > [15:50] but only if that flag is set > [15:50] of course! > [15:50] sounds like a worthwhile idea, thanks > [15:51] np, I'm very happy if it works :) > [15:51] the exception translation is already done > somewhere in the EM project > [15:51] I don't remember the details, but I'm sure > you're more familiar with it > [15:51] just make sure you look that up > [15:52] it catches all exceptions from Hibernate to > wrap them in something else, to satisfy the spec requirements > > -- Sanne From smarlow at redhat.com Thu Aug 7 11:43:19 2014 From: smarlow at redhat.com (Scott Marlow) Date: Thu, 07 Aug 2014 11:43:19 -0400 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: <53E39C49.5010309@redhat.com> References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> <53E29B9D.1090305@redhat.com> <53E39C49.5010309@redhat.com> Message-ID: <53E39E97.3010603@redhat.com> Also, detecting that the background thread may of violated the Hibernate session concurrency requirements for only one thread to use it at a time, is not as good as preventing the concurrency violation. If anyone wants to also give feedback on the Transaction Manager side of this, the forum thread is https://community.jboss.org/thread/243360. On 08/07/2014 11:33 AM, Scott Marlow wrote: > Sanne, > > One question that I didn't ask before, when the Hibernate > Synchronization.afterCompletion(int) is called (with rolledback TX > status), how does Hibernate know if the transaction was rolled back from > the transaction reaper thread? I tried checking the thread name in > WildFly integration code but that is wrong, as the thread name may be a > transaction manager communications thread that is invoked on behalf of a > remote (JVM) reaper thread. > > Currently, are checking thread ids which does not work for the > distributed case involving multiple jvms. The current approach also > does not work for remote invocations that use the same JTA transaction > (as the below test case simulates). > > Scott > > On 08/07/2014 11:02 AM, Sanne Grinovero wrote: >> Steve, >> we had a conversation about this on IRC, I think we came to a >> ? hopefully? >> nice >> ? >> ?solution >> . >> >> [15:18] andrigtmiller: I still think you're locking out >> the TXM, not making it possible to legitimately timeout queries.. >> [15:19] (but I don't have the full picture.. not really >> my area) >> [15:19] that is a transaction manager concern but they already >> handled calling other synchronization call backs. currently, Arjuna >> holds a lock on the collection of synchronizations at that time, so >> there should be no conflict >> [15:20] I asked about your concern yesterday to make sure we >> wouldn't deadlock >> [15:20] I wasn't actually thinking about deadlock, I >> just don't see what you're aiming at with the single lock on the Session >> [15:22] to avoid calling Hibernate session.clear from a >> background thread while the application thread is also doing a Hibernate >> session invocation. which can lead to random exceptions >> [15:22] I'm aiming at solving the concurrency concern ^ >> [15:22] But I guess you'd need to talk with sebersole, >> this lock thing you're proposing comes out of the blue for me :) >> [15:22] yes I get that >> [15:23] but you should allow the session.clear() to >> proceed, not lock it out >> [15:23] sure, I'm just trying to talk to who ever listens and >> have feedback. Before I get anyway near code changes, Sebersole needs >> to be on board (he isn't yet) >> [15:24] I'm neither :) willing to discuss for sake of >> interest, but can't replace sebersole on this I think :) >> [15:24] I posted on as7 dev mailing list a few years ago and >> the only feedback that I got was that only Hibernate was not handling >> concurrency but there could be others >> [15:25] what is the effect you expect to have users see >> when the background thread kills the current session? >> [15:25] I cross posted as well >> [15:25] users shouldn't get NPE errors or unexpected exceptions >> [15:26] sure, but what kind of effect would you propose? >> [15:26] I guess a different exception with a better >> error message? >> [15:26] my goal is ensuring that only one thread is invoking >> the Hibernate session at a time >> [15:27] No that's not true, as you're saying that you >> want to allow the TXM to rollback the transaction >> [15:27] well, want is a strong word :) >> [15:28] IBM/Oracle/JBoss all do that >> [15:28] and that's an implementation detail what you >> just explained :) >> [15:28] what I'm asking is what you expect the user to >> experience when this needs to happen >> [15:29] when the transaction is rolled back, depending on >> where the application code is in the Hibernate session invocation, a >> JDBC error might occur or something related to that. The goal is to >> avoid mutating the Hibernate session from two different threads concurrently >> [15:30] you're not answering my question, that's an >> implementation detail :) >> [15:30] if we can avoid violating concurrency of the hibernate >> session, I think we will be more robust. >> [15:31] The goal of the TXM timeout, is to kill stuff >> which is taking too long.. not allowing it to finish in a safe lock. >> andrigtmiller am I understanding the basics correctly? >> [15:31] currently, what the user will experience is poor. The >> scope of turning that into a more pleasant experience is a good question >> but involves many moving and separate parts >> [15:32] so you actually _need_ to allow concurrent >> access, to kill and rollback the operations which are being done >> [15:32] the goal of TXM timeout handling in JBoss/Oracle/IBM >> is to also handle deadlocks that might not otherwise be recovered from >> [15:32] the concurrent access happens at the resource level >> [15:33] from the background, with components that handle >> concurrency. Hibernate doesn't >> [15:33] that's just one part of the things >> [15:33] and we can definitely have Hibernate handle >> some concurrent events >> [15:33] Hibernate sessions are not supposed to handle >> concurrency, so its a design flaw >> [15:33] the TXM shouldn't invoke clear() (which is >> public API) but invoke a specific method which could provide the needed >> semantics >> [15:33] its not some events, its many events >> [15:34] why do you say it's a design flaw? it's not, >> for the "normal" public API usage >> [15:34] the TXM, calls the Hibernate >> Synchronization.afterCompletion(int) and Hibernate detaches entities >> [15:34] and Hibernate does other cleaning up as well >> [15:35] its a design flaw as its not handled in our system >> [15:35] I don't feel I'm making progress in the >> conversation if you keep repeating the implementation details, we can >> fix that as we please >> [15:35] but you have to explain the expected user >> experience >> [15:36] you mean if we didn't have any constraints of any of >> the existing specs that we implement? >> [15:36] yes, just explain what you think it should do >> please, that would help me understand, and I think I can propose you >> something more concrete >> [15:37] if we ignore XA, JTA + JPA, I can answer the question >> better and will attempt that >> [15:37] the problem is the user sees an NPE right? >> [15:38] could be an NPE or any unexpected exception that comes >> from using a thread-unsafe component from multiple threads >> [15:38] so the basic question is what do you think the >> user should "see".. I guess another exception, say >> HibernateRolledBackException("The Transaction Manager decided we run out >> of time") >> [15:38] sure. would you like the above proposal ^ >> [15:39] Because implementing that is easy :) >> [15:41] ? If you're busy I'm happy to talk later, I am >> 3h late with my lunch >> [15:41] in a perfect world, 1) the user registers an >> application event listener that tells that the transaction timed out. >> 2) whether the application thread catches a signal that the >> transaction is about to be rolled back. 3) The application thread then >> catches a signal that the transaction was rolled back >> [15:41] that doesn't explain what you expect the client >> code to experience. >> [15:41] 4) the application thread then catches a signal that >> Synchronization call backs are going to happen to clean up after the >> roll back >> [15:42] say the user was incoking a "Query.list()" .. >> what do we return? >> [15:42] what could they expect? They could be in the middle >> of code that doesn't use the Hibernate session or could be in code that does >> [15:43] Exactly my point, so we'd return an exception >> like I proposed above right? >> [15:43] if you say so but no one knows how to do that >> [15:43] I mean, I'm not sure what returns that >> [15:44] we had tried doing what you suggest but it was too >> performance expensive and covered too few cases >> [15:44] but sure, throwing an EJB rolledback exception is ideal >> [15:45] you can do it in an efficient way, but yes I >> agree you'd have to patch several areas of code. >> [15:45] I'd do it incrementally though, start with the >> Session and Query APIs, see if people like it >> [15:45] our previous attempt that failed, added a pre-check at >> the front of every Hibernate session call, tail end and middle >> [15:46] but that didn't work because it didn't handle remote >> transactions or distributed transactions >> [15:46] the EntityManager implementation has some kind >> of "exception translator" >> [15:46] and performance suffered >> [15:46] all you need to do is catch exceptions, and >> re-throw the better explanation >> [15:46] so, we have less of the checking today and still don't >> handle remote transactions and distributed transactions >> [15:47] the TXM just needs to flag a volatile field in >> the Session to inject the error it wants us to tell >> [15:47] so on the optimal path you just have a volatile >> field read operation, which is a zero cost essentially >> [15:47] (optimal path I mean the case in which there >> are no errors) >> [15:48] then we need to poll for that flag in the >> start/middle/end (or so) if every Hibernate method >> [15:48] no >> [15:48] or maybe in the finally clause of every method >> [15:48] you just need to catch exceptions >> [15:48] and we happen to already do that, because you >> need to translate all Hibernate specific exceptions to JPA specific ones >> [15:49] so it's actually a very simple patch with zero >> overhead I think >> [15:49] at worse, we catch exceptions (including NPE) and >> notice the flag and then eat the cause exception? >> [15:49] +1 >> [15:49] if we show the cause, its confusing >> [15:49] you don't need the finally method either though >> [15:49] if we eat it, its confusing >> [15:49] right, don't show the cause. >> [15:49] I hate when exceptions are eaten >> [15:50] well.. the TXM should provide you a sensible >> error message, like "aborted because of ... ", and we take that as >> explanation. >> [15:50] but only if that flag is set >> [15:50] of course! >> [15:50] sounds like a worthwhile idea, thanks >> [15:51] np, I'm very happy if it works :) >> [15:51] the exception translation is already done >> somewhere in the EM project >> [15:51] I don't remember the details, but I'm sure >> you're more familiar with it >> [15:51] just make sure you look that up >> [15:52] it catches all exceptions from Hibernate to >> wrap them in something else, to satisfy the spec requirements >> >> -- Sanne > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From steve at hibernate.org Thu Aug 7 13:10:39 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 7 Aug 2014 12:10:39 -0500 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> <53E29B9D.1090305@redhat.com> Message-ID: Don't y'all believe in summarization? ;) I'll read through this tonight/tomorrow... On Thu, Aug 7, 2014 at 10:02 AM, Sanne Grinovero wrote: > Steve, > we had a conversation about this on IRC, I think we came to a > ? hopefully? > nice > ? > ?solution > . > > [15:18] andrigtmiller: I still think you're locking out > the TXM, not making it possible to legitimately timeout queries.. > [15:19] (but I don't have the full picture.. not really > my area) > [15:19] that is a transaction manager concern but they already > handled calling other synchronization call backs. currently, Arjuna holds > a lock on the collection of synchronizations at that time, so there should > be no conflict > [15:20] I asked about your concern yesterday to make sure we > wouldn't deadlock > [15:20] I wasn't actually thinking about deadlock, I just > don't see what you're aiming at with the single lock on the Session > [15:22] to avoid calling Hibernate session.clear from a > background thread while the application thread is also doing a Hibernate > session invocation. which can lead to random exceptions > [15:22] I'm aiming at solving the concurrency concern ^ > [15:22] But I guess you'd need to talk with sebersole, > this lock thing you're proposing comes out of the blue for me :) > [15:22] yes I get that > [15:23] but you should allow the session.clear() to > proceed, not lock it out > [15:23] sure, I'm just trying to talk to who ever listens and > have feedback. Before I get anyway near code changes, Sebersole needs to > be on board (he isn't yet) > [15:24] I'm neither :) willing to discuss for sake of > interest, but can't replace sebersole on this I think :) > [15:24] I posted on as7 dev mailing list a few years ago and the > only feedback that I got was that only Hibernate was not handling > concurrency but there could be others > [15:25] what is the effect you expect to have users see > when the background thread kills the current session? > [15:25] I cross posted as well > [15:25] users shouldn't get NPE errors or unexpected exceptions > [15:26] sure, but what kind of effect would you propose? > [15:26] I guess a different exception with a better error > message? > [15:26] my goal is ensuring that only one thread is invoking the > Hibernate session at a time > [15:27] No that's not true, as you're saying that you > want to allow the TXM to rollback the transaction > [15:27] well, want is a strong word :) > [15:28] IBM/Oracle/JBoss all do that > [15:28] and that's an implementation detail what you just > explained :) > [15:28] what I'm asking is what you expect the user to > experience when this needs to happen > [15:29] when the transaction is rolled back, depending on where > the application code is in the Hibernate session invocation, a JDBC error > might occur or something related to that. The goal is to avoid mutating > the Hibernate session from two different threads concurrently > [15:30] you're not answering my question, that's an > implementation detail :) > [15:30] if we can avoid violating concurrency of the hibernate > session, I think we will be more robust. > [15:31] The goal of the TXM timeout, is to kill stuff > which is taking too long.. not allowing it to finish in a safe lock. > andrigtmiller am I understanding the basics correctly? > [15:31] currently, what the user will experience is poor. The > scope of turning that into a more pleasant experience is a good question > but involves many moving and separate parts > [15:32] so you actually _need_ to allow concurrent > access, to kill and rollback the operations which are being done > [15:32] the goal of TXM timeout handling in JBoss/Oracle/IBM is > to also handle deadlocks that might not otherwise be recovered from > [15:32] the concurrent access happens at the resource level > [15:33] from the background, with components that handle > concurrency. Hibernate doesn't > [15:33] that's just one part of the things > [15:33] and we can definitely have Hibernate handle some > concurrent events > [15:33] Hibernate sessions are not supposed to handle > concurrency, so its a design flaw > [15:33] the TXM shouldn't invoke clear() (which is public > API) but invoke a specific method which could provide the needed semantics > [15:33] its not some events, its many events > [15:34] why do you say it's a design flaw? it's not, for > the "normal" public API usage > [15:34] the TXM, calls the Hibernate > Synchronization.afterCompletion(int) and Hibernate detaches entities > [15:34] and Hibernate does other cleaning up as well > [15:35] its a design flaw as its not handled in our system > [15:35] I don't feel I'm making progress in the > conversation if you keep repeating the implementation details, we can fix > that as we please > [15:35] but you have to explain the expected user > experience > [15:36] you mean if we didn't have any constraints of any of the > existing specs that we implement? > [15:36] yes, just explain what you think it should do > please, that would help me understand, and I think I can propose you > something more concrete > [15:37] if we ignore XA, JTA + JPA, I can answer the question > better and will attempt that > [15:37] the problem is the user sees an NPE right? > [15:38] could be an NPE or any unexpected exception that comes > from using a thread-unsafe component from multiple threads > [15:38] so the basic question is what do you think the > user should "see".. I guess another exception, say > HibernateRolledBackException("The Transaction Manager decided we run out of > time") > [15:38] sure. would you like the above proposal ^ > [15:39] Because implementing that is easy :) > [15:41] ? If you're busy I'm happy to talk later, I am 3h > late with my lunch > [15:41] in a perfect world, 1) the user registers an application > event listener that tells that the transaction timed out. 2) whether the > application thread catches a signal that the transaction is about to be > rolled back. 3) The application thread then catches a signal that the > transaction was rolled back > [15:41] that doesn't explain what you expect the client > code to experience. > [15:41] 4) the application thread then catches a signal that > Synchronization call backs are going to happen to clean up after the roll > back > [15:42] say the user was incoking a "Query.list()" .. > what do we return? > [15:42] what could they expect? They could be in the middle of > code that doesn't use the Hibernate session or could be in code that does > [15:43] Exactly my point, so we'd return an exception > like I proposed above right? > [15:43] if you say so but no one knows how to do that > [15:43] I mean, I'm not sure what returns that > [15:44] we had tried doing what you suggest but it was too > performance expensive and covered too few cases > [15:44] but sure, throwing an EJB rolledback exception is ideal > [15:45] you can do it in an efficient way, but yes I > agree you'd have to patch several areas of code. > [15:45] I'd do it incrementally though, start with the > Session and Query APIs, see if people like it > [15:45] our previous attempt that failed, added a pre-check at > the front of every Hibernate session call, tail end and middle > [15:46] but that didn't work because it didn't handle remote > transactions or distributed transactions > [15:46] the EntityManager implementation has some kind of > "exception translator" > [15:46] and performance suffered > [15:46] all you need to do is catch exceptions, and > re-throw the better explanation > [15:46] so, we have less of the checking today and still don't > handle remote transactions and distributed transactions > [15:47] the TXM just needs to flag a volatile field in > the Session to inject the error it wants us to tell > [15:47] so on the optimal path you just have a volatile > field read operation, which is a zero cost essentially > [15:47] (optimal path I mean the case in which there are > no errors) > [15:48] then we need to poll for that flag in the > start/middle/end (or so) if every Hibernate method > [15:48] no > [15:48] or maybe in the finally clause of every method > [15:48] you just need to catch exceptions > [15:48] and we happen to already do that, because you > need to translate all Hibernate specific exceptions to JPA specific ones > [15:49] so it's actually a very simple patch with zero > overhead I think > [15:49] at worse, we catch exceptions (including NPE) and notice > the flag and then eat the cause exception? > [15:49] +1 > [15:49] if we show the cause, its confusing > [15:49] you don't need the finally method either though > [15:49] if we eat it, its confusing > [15:49] right, don't show the cause. > [15:49] I hate when exceptions are eaten > [15:50] well.. the TXM should provide you a sensible > error message, like "aborted because of ... ", and we take that as > explanation. > [15:50] but only if that flag is set > [15:50] of course! > [15:50] sounds like a worthwhile idea, thanks > [15:51] np, I'm very happy if it works :) > [15:51] the exception translation is already done > somewhere in the EM project > [15:51] I don't remember the details, but I'm sure you're > more familiar with it > [15:51] just make sure you look that up > [15:52] it catches all exceptions from Hibernate to wrap > them in something else, to satisfy the spec requirements > > -- Sanne > From steve at hibernate.org Thu Aug 7 13:12:25 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 7 Aug 2014 12:12:25 -0500 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: <53E39C49.5010309@redhat.com> References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> <53E29B9D.1090305@redhat.com> <53E39C49.5010309@redhat.com> Message-ID: We only check whether the thread is different from the "application thread". As I have mentioned to you about a bazillion times now (give or take ;) this is all a best effort. As you well know, we simply do not have all the pertinent information we need to know what the nature of the various threads in play are. On Thu, Aug 7, 2014 at 10:33 AM, Scott Marlow wrote: > Sanne, > > One question that I didn't ask before, when the Hibernate Synchronization.afterCompletion(int) > is called (with rolledback TX status), how does Hibernate know if the > transaction was rolled back from the transaction reaper thread? I tried > checking the thread name in WildFly integration code but that is wrong, as > the thread name may be a transaction manager communications thread that is > invoked on behalf of a remote (JVM) reaper thread. > > Currently, are checking thread ids which does not work for the distributed > case involving multiple jvms. The current approach also does not work for > remote invocations that use the same JTA transaction (as the below test > case simulates). > > Scott > > > On 08/07/2014 11:02 AM, Sanne Grinovero wrote: > >> Steve, >> we had a conversation about this on IRC, I think we came to a >> ? hopefully? >> nice >> ? >> ?solution >> . >> >> [15:18] andrigtmiller: I still think you're locking out >> the TXM, not making it possible to legitimately timeout queries.. >> [15:19] (but I don't have the full picture.. not really >> my area) >> [15:19] that is a transaction manager concern but they already >> handled calling other synchronization call backs. currently, Arjuna >> holds a lock on the collection of synchronizations at that time, so >> there should be no conflict >> [15:20] I asked about your concern yesterday to make sure we >> wouldn't deadlock >> [15:20] I wasn't actually thinking about deadlock, I >> just don't see what you're aiming at with the single lock on the Session >> [15:22] to avoid calling Hibernate session.clear from a >> background thread while the application thread is also doing a Hibernate >> session invocation. which can lead to random exceptions >> [15:22] I'm aiming at solving the concurrency concern ^ >> [15:22] But I guess you'd need to talk with sebersole, >> this lock thing you're proposing comes out of the blue for me :) >> [15:22] yes I get that >> [15:23] but you should allow the session.clear() to >> proceed, not lock it out >> [15:23] sure, I'm just trying to talk to who ever listens and >> have feedback. Before I get anyway near code changes, Sebersole needs >> to be on board (he isn't yet) >> [15:24] I'm neither :) willing to discuss for sake of >> interest, but can't replace sebersole on this I think :) >> [15:24] I posted on as7 dev mailing list a few years ago and >> the only feedback that I got was that only Hibernate was not handling >> concurrency but there could be others >> [15:25] what is the effect you expect to have users see >> when the background thread kills the current session? >> [15:25] I cross posted as well >> [15:25] users shouldn't get NPE errors or unexpected exceptions >> [15:26] sure, but what kind of effect would you propose? >> [15:26] I guess a different exception with a better >> error message? >> [15:26] my goal is ensuring that only one thread is invoking >> the Hibernate session at a time >> [15:27] No that's not true, as you're saying that you >> want to allow the TXM to rollback the transaction >> [15:27] well, want is a strong word :) >> [15:28] IBM/Oracle/JBoss all do that >> [15:28] and that's an implementation detail what you >> just explained :) >> [15:28] what I'm asking is what you expect the user to >> experience when this needs to happen >> [15:29] when the transaction is rolled back, depending on >> where the application code is in the Hibernate session invocation, a >> JDBC error might occur or something related to that. The goal is to >> avoid mutating the Hibernate session from two different threads >> concurrently >> [15:30] you're not answering my question, that's an >> implementation detail :) >> [15:30] if we can avoid violating concurrency of the hibernate >> session, I think we will be more robust. >> [15:31] The goal of the TXM timeout, is to kill stuff >> which is taking too long.. not allowing it to finish in a safe lock. >> andrigtmiller am I understanding the basics correctly? >> [15:31] currently, what the user will experience is poor. The >> scope of turning that into a more pleasant experience is a good question >> but involves many moving and separate parts >> [15:32] so you actually _need_ to allow concurrent >> access, to kill and rollback the operations which are being done >> [15:32] the goal of TXM timeout handling in JBoss/Oracle/IBM >> is to also handle deadlocks that might not otherwise be recovered from >> [15:32] the concurrent access happens at the resource level >> [15:33] from the background, with components that handle >> concurrency. Hibernate doesn't >> [15:33] that's just one part of the things >> [15:33] and we can definitely have Hibernate handle >> some concurrent events >> [15:33] Hibernate sessions are not supposed to handle >> concurrency, so its a design flaw >> [15:33] the TXM shouldn't invoke clear() (which is >> public API) but invoke a specific method which could provide the needed >> semantics >> [15:33] its not some events, its many events >> [15:34] why do you say it's a design flaw? it's not, >> for the "normal" public API usage >> [15:34] the TXM, calls the Hibernate >> Synchronization.afterCompletion(int) and Hibernate detaches entities >> [15:34] and Hibernate does other cleaning up as well >> [15:35] its a design flaw as its not handled in our system >> [15:35] I don't feel I'm making progress in the >> conversation if you keep repeating the implementation details, we can >> fix that as we please >> [15:35] but you have to explain the expected user >> experience >> [15:36] you mean if we didn't have any constraints of any of >> the existing specs that we implement? >> [15:36] yes, just explain what you think it should do >> please, that would help me understand, and I think I can propose you >> something more concrete >> [15:37] if we ignore XA, JTA + JPA, I can answer the question >> better and will attempt that >> [15:37] the problem is the user sees an NPE right? >> [15:38] could be an NPE or any unexpected exception that comes >> from using a thread-unsafe component from multiple threads >> [15:38] so the basic question is what do you think the >> user should "see".. I guess another exception, say >> HibernateRolledBackException("The Transaction Manager decided we run out >> of time") >> [15:38] sure. would you like the above proposal ^ >> [15:39] Because implementing that is easy :) >> [15:41] ? If you're busy I'm happy to talk later, I am >> 3h late with my lunch >> [15:41] in a perfect world, 1) the user registers an >> application event listener that tells that the transaction timed out. >> 2) whether the application thread catches a signal that the >> transaction is about to be rolled back. 3) The application thread then >> catches a signal that the transaction was rolled back >> [15:41] that doesn't explain what you expect the client >> code to experience. >> [15:41] 4) the application thread then catches a signal that >> Synchronization call backs are going to happen to clean up after the >> roll back >> [15:42] say the user was incoking a "Query.list()" .. >> what do we return? >> [15:42] what could they expect? They could be in the middle >> of code that doesn't use the Hibernate session or could be in code that >> does >> [15:43] Exactly my point, so we'd return an exception >> like I proposed above right? >> [15:43] if you say so but no one knows how to do that >> [15:43] I mean, I'm not sure what returns that >> [15:44] we had tried doing what you suggest but it was too >> performance expensive and covered too few cases >> [15:44] but sure, throwing an EJB rolledback exception is ideal >> [15:45] you can do it in an efficient way, but yes I >> agree you'd have to patch several areas of code. >> [15:45] I'd do it incrementally though, start with the >> Session and Query APIs, see if people like it >> [15:45] our previous attempt that failed, added a pre-check at >> the front of every Hibernate session call, tail end and middle >> [15:46] but that didn't work because it didn't handle remote >> transactions or distributed transactions >> [15:46] the EntityManager implementation has some kind >> of "exception translator" >> [15:46] and performance suffered >> [15:46] all you need to do is catch exceptions, and >> re-throw the better explanation >> [15:46] so, we have less of the checking today and still don't >> handle remote transactions and distributed transactions >> [15:47] the TXM just needs to flag a volatile field in >> the Session to inject the error it wants us to tell >> [15:47] so on the optimal path you just have a volatile >> field read operation, which is a zero cost essentially >> [15:47] (optimal path I mean the case in which there >> are no errors) >> [15:48] then we need to poll for that flag in the >> start/middle/end (or so) if every Hibernate method >> [15:48] no >> [15:48] or maybe in the finally clause of every method >> [15:48] you just need to catch exceptions >> [15:48] and we happen to already do that, because you >> need to translate all Hibernate specific exceptions to JPA specific ones >> [15:49] so it's actually a very simple patch with zero >> overhead I think >> [15:49] at worse, we catch exceptions (including NPE) and >> notice the flag and then eat the cause exception? >> [15:49] +1 >> [15:49] if we show the cause, its confusing >> [15:49] you don't need the finally method either though >> [15:49] if we eat it, its confusing >> [15:49] right, don't show the cause. >> [15:49] I hate when exceptions are eaten >> [15:50] well.. the TXM should provide you a sensible >> error message, like "aborted because of ... ", and we take that as >> explanation. >> [15:50] but only if that flag is set >> [15:50] of course! >> [15:50] sounds like a worthwhile idea, thanks >> [15:51] np, I'm very happy if it works :) >> [15:51] the exception translation is already done >> somewhere in the EM project >> [15:51] I don't remember the details, but I'm sure >> you're more familiar with it >> [15:51] just make sure you look that up >> [15:52] it catches all exceptions from Hibernate to >> wrap them in something else, to satisfy the spec requirements >> >> -- Sanne >> > > From sanne at hibernate.org Thu Aug 7 13:56:56 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 7 Aug 2014 18:56:56 +0100 Subject: [hibernate-dev] [Search] @Transformable vs @ProvidedId Message-ID: There are two annotations clashing for same responsibilities: - org.infinispan.query.Transformable - org.hibernate.search.annotations.ProvidedId as documented at the following link, these two different ways to apply "Id indexing options" in Infinispan Query, IMHO quite unclear when a user should use one vs. the other. - http://infinispan.org/docs/7.0.x/user_guide/user_guide.html#_requirements_for_the_key_transformable_and_providedid The benefit of @Transformable is that Infinispan provides one out of the box which will work for any user case: it will serialize the whole object representing the id, then hex-encode the buffer into a String: horribly inefficient but works on any serializable type. @ProvidedId originally marked the indexed entry in such a way that the indexing engine would consider the id "provided externally", i.e. given at runtime. It would also assume that its type would be static for a specific type - which is I think a reasonable expectation but doesn't really hold as an absolute truth in the case of Infinispan: nothing prevents me to store an indexed entry of type "Person" for index "personindex" with an Integer typed key in the cache, and also duplicate the same information under a say String typed key. So there's an expectation mismatch: in ORM world the key type is strongly related to the value type, but when indexing Infinispan entries the reality is that we're indexing two independent "modules". I was hoping to drop @ProvidedId today as the original "marker" functionality is no longer needed: since we have org.hibernate.search.cfg.spi.SearchConfiguration.isIdProvidedImplicit() the option can be implicitly applied to all indexed entries, and the annotation is mostly redundant in Infinispan since we added this. But actually it turns out it's a bit more complex as it servers a second function as well: it's the only way for users to be able to specify a FieldBridge for the ID.. so the functionality of this annotation is not consumed yet. So my proposal is to get rid of both @Transformable and @ProvidedId. There needs to be a single way in Infinispan to define both the indexing options and transformation; ideally this should be left to the Search Engine and its provided collection of FieldBridge implementations. Since the id type and the value type in Infinispan are not necessarily strongly related (still the id is unique of course), I think this option doesn't even belong on the @Indexed value but should be specified on the key type. Problem is that to define a class-level annotation to be used on the Infinispan keys doesn't really belong in the collection of annotations of Hibernate Search; I'm tempted to require that the key used for the type must be one of those for which an out-of-the-box FieldBridge is provided: the good thing is that now the set is extensible. In a second phase Infinispan could opt to create a custom annotation like @Transformable to register these options in a simplified way. Even more, I've witnessed cases in which in Infinispan it makes sense to encode some more information in the key than what's strictly necessary to identify the key (like having attributes which are not included in the hashcode and equals definitions). It sounds like the user should be allowed to annotate the Key types, to allow such additional properties to contribute to the index definition. Comments welcome, but I feel strongly that these two annotations need to be removed to make room for better solutions: we have an opportunity now as I'm rewriting the mapping engine. Sanne From smarlow at redhat.com Thu Aug 7 14:42:07 2014 From: smarlow at redhat.com (Scott Marlow) Date: Thu, 07 Aug 2014 14:42:07 -0400 Subject: [hibernate-dev] [renamed] multiple invocations on same transaction, separate thread is not working unless is changed to false... In-Reply-To: References: <529F65EE.3060308@hibernate.org> <53A1D588.3070204@redhat.com> <53AA3284.3070309@redhat.com> <53E0EF9A.4060306@redhat.com> <53E0F91E.6040005@redhat.com> <53E29B9D.1090305@redhat.com> <53E39C49.5010309@redhat.com> Message-ID: <53E3C87F.1010602@redhat.com> On 08/07/2014 01:12 PM, Steve Ebersole wrote: > We only check whether the thread is different from the "application > thread". As I have mentioned to you about a bazillion times now (give > or take ;) this is all a best effort. As you well know, we simply do > not have all the pertinent information we need to know what the nature > of the various threads in play are. I just figured out that synchronizing the Hibernate session would not be enough, as the Hibernate session could potentially be called by the application thread to mutate the session state (after all entities are detached). I thought we had a valid suggestion, of changing the transaction manager to set rollback only instead of rolling the transaction back from the background but that doesn't seem to be happening. Not an easy problem. > > > On Thu, Aug 7, 2014 at 10:33 AM, Scott Marlow > wrote: > > Sanne, > > One question that I didn't ask before, when the Hibernate > Synchronization.__afterCompletion(int) is called (with rolledback TX > status), how does Hibernate know if the transaction was rolled back > from the transaction reaper thread? I tried checking the thread > name in WildFly integration code but that is wrong, as the thread > name may be a transaction manager communications thread that is > invoked on behalf of a remote (JVM) reaper thread. > > Currently, are checking thread ids which does not work for the > distributed case involving multiple jvms. The current approach also > does not work for remote invocations that use the same JTA > transaction (as the below test case simulates). > > Scott > > > On 08/07/2014 11:02 AM, Sanne Grinovero wrote: > > Steve, > we had a conversation about this on IRC, I think we came to a > ? hopefully? > nice > ? > ?solution > . > > [15:18] andrigtmiller: I still think you're > locking out > the TXM, not making it possible to legitimately timeout queries.. > [15:19] (but I don't have the full picture.. > not really > my area) > [15:19] that is a transaction manager concern but they > already > handled calling other synchronization call backs. currently, Arjuna > holds a lock on the collection of synchronizations at that time, so > there should be no conflict > [15:20] I asked about your concern yesterday to make > sure we > wouldn't deadlock > [15:20] I wasn't actually thinking about > deadlock, I > just don't see what you're aiming at with the single lock on the > Session > [15:22] to avoid calling Hibernate session.clear from a > background thread while the application thread is also doing a > Hibernate > session invocation. which can lead to random exceptions > [15:22] I'm aiming at solving the concurrency concern ^ > [15:22] But I guess you'd need to talk with > sebersole, > this lock thing you're proposing comes out of the blue for me :) > [15:22] yes I get that > [15:23] but you should allow the session.clear() to > proceed, not lock it out > [15:23] sure, I'm just trying to talk to who ever > listens and > have feedback. Before I get anyway near code changes, Sebersole > needs > to be on board (he isn't yet) > [15:24] I'm neither :) willing to discuss for > sake of > interest, but can't replace sebersole on this I think :) > [15:24] I posted on as7 dev mailing list a few years > ago and > the only feedback that I got was that only Hibernate was not > handling > concurrency but there could be others > [15:25] what is the effect you expect to have > users see > when the background thread kills the current session? > [15:25] I cross posted as well > [15:25] users shouldn't get NPE errors or unexpected > exceptions > [15:26] sure, but what kind of effect would you > propose? > [15:26] I guess a different exception with a better > error message? > [15:26] my goal is ensuring that only one thread is > invoking > the Hibernate session at a time > [15:27] No that's not true, as you're saying > that you > want to allow the TXM to rollback the transaction > [15:27] well, want is a strong word :) > [15:28] IBM/Oracle/JBoss all do that > [15:28] and that's an implementation detail > what you > just explained :) > [15:28] what I'm asking is what you expect the > user to > experience when this needs to happen > [15:29] when the transaction is rolled back, depending on > where the application code is in the Hibernate session invocation, a > JDBC error might occur or something related to that. The goal is to > avoid mutating the Hibernate session from two different threads > concurrently > [15:30] you're not answering my question, that's an > implementation detail :) > [15:30] if we can avoid violating concurrency of the > hibernate > session, I think we will be more robust. > [15:31] The goal of the TXM timeout, is to kill > stuff > which is taking too long.. not allowing it to finish in a safe lock. > andrigtmiller am I understanding the basics correctly? > [15:31] currently, what the user will experience is > poor. The > scope of turning that into a more pleasant experience is a good > question > but involves many moving and separate parts > [15:32] so you actually _need_ to allow concurrent > access, to kill and rollback the operations which are being done > [15:32] the goal of TXM timeout handling in > JBoss/Oracle/IBM > is to also handle deadlocks that might not otherwise be > recovered from > [15:32] the concurrent access happens at the resource > level > [15:33] from the background, with components that handle > concurrency. Hibernate doesn't > [15:33] that's just one part of the things > [15:33] and we can definitely have Hibernate handle > some concurrent events > [15:33] Hibernate sessions are not supposed to handle > concurrency, so its a design flaw > [15:33] the TXM shouldn't invoke clear() (which is > public API) but invoke a specific method which could provide the > needed > semantics > [15:33] its not some events, its many events > [15:34] why do you say it's a design flaw? it's > not, > for the "normal" public API usage > [15:34] the TXM, calls the Hibernate > Synchronization.__afterCompletion(int) and Hibernate detaches > entities > [15:34] and Hibernate does other cleaning up as well > [15:35] its a design flaw as its not handled in our system > [15:35] I don't feel I'm making progress in the > conversation if you keep repeating the implementation details, > we can > fix that as we please > [15:35] but you have to explain the expected user > experience > [15:36] you mean if we didn't have any constraints of > any of > the existing specs that we implement? > [15:36] yes, just explain what you think it > should do > please, that would help me understand, and I think I can propose you > something more concrete > [15:37] if we ignore XA, JTA + JPA, I can answer the > question > better and will attempt that > [15:37] the problem is the user sees an NPE right? > [15:38] could be an NPE or any unexpected exception > that comes > from using a thread-unsafe component from multiple threads > [15:38] so the basic question is what do you > think the > user should "see".. I guess another exception, say > HibernateRolledBackException("__The Transaction Manager decided > we run out > of time") > [15:38] sure. would you like the above proposal ^ > [15:39] Because implementing that is easy :) > [15:41] ? If you're busy I'm happy to talk > later, I am > 3h late with my lunch > [15:41] in a perfect world, 1) the user registers an > application event listener that tells that the transaction timed > out. > 2) whether the application thread catches a signal that the > transaction is about to be rolled back. 3) The application > thread then > catches a signal that the transaction was rolled back > [15:41] that doesn't explain what you expect > the client > code to experience. > [15:41] 4) the application thread then catches a > signal that > Synchronization call backs are going to happen to clean up after the > roll back > [15:42] say the user was incoking a > "Query.list()" .. > what do we return? > [15:42] what could they expect? They could be in the > middle > of code that doesn't use the Hibernate session or could be in > code that does > [15:43] Exactly my point, so we'd return an > exception > like I proposed above right? > [15:43] if you say so but no one knows how to do that > [15:43] I mean, I'm not sure what returns that > [15:44] we had tried doing what you suggest but it was too > performance expensive and covered too few cases > [15:44] but sure, throwing an EJB rolledback exception > is ideal > [15:45] you can do it in an efficient way, but > yes I > agree you'd have to patch several areas of code. > [15:45] I'd do it incrementally though, start > with the > Session and Query APIs, see if people like it > [15:45] our previous attempt that failed, added a > pre-check at > the front of every Hibernate session call, tail end and middle > [15:46] but that didn't work because it didn't handle > remote > transactions or distributed transactions > [15:46] the EntityManager implementation has > some kind > of "exception translator" > [15:46] and performance suffered > [15:46] all you need to do is catch exceptions, and > re-throw the better explanation > [15:46] so, we have less of the checking today and > still don't > handle remote transactions and distributed transactions > [15:47] the TXM just needs to flag a volatile > field in > the Session to inject the error it wants us to tell > [15:47] so on the optimal path you just have a > volatile > field read operation, which is a zero cost essentially > [15:47] (optimal path I mean the case in which > there > are no errors) > [15:48] then we need to poll for that flag in the > start/middle/end (or so) if every Hibernate method > [15:48] no > [15:48] or maybe in the finally clause of every method > [15:48] you just need to catch exceptions > [15:48] and we happen to already do that, > because you > need to translate all Hibernate specific exceptions to JPA > specific ones > [15:49] so it's actually a very simple patch > with zero > overhead I think > [15:49] at worse, we catch exceptions (including NPE) and > notice the flag and then eat the cause exception? > [15:49] +1 > [15:49] if we show the cause, its confusing > [15:49] you don't need the finally method > either though > [15:49] if we eat it, its confusing > [15:49] right, don't show the cause. > [15:49] I hate when exceptions are eaten > [15:50] well.. the TXM should provide you a > sensible > error message, like "aborted because of ... ", and we take that as > explanation. > [15:50] but only if that flag is set > [15:50] of course! > [15:50] sounds like a worthwhile idea, thanks > [15:51] np, I'm very happy if it works :) > [15:51] the exception translation is already done > somewhere in the EM project > [15:51] I don't remember the details, but I'm sure > you're more familiar with it > [15:51] just make sure you look that up > [15:52] it catches all exceptions from Hibernate to > wrap them in something else, to satisfy the spec requirements > > -- Sanne > > > From sanne at hibernate.org Thu Aug 7 17:42:58 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 7 Aug 2014 22:42:58 +0100 Subject: [hibernate-dev] [Search] @Transformable vs @ProvidedId In-Reply-To: <98A842C3-7F45-4F20-8542-40A592F56C76@hibernate.org> References: <98A842C3-7F45-4F20-8542-40A592F56C76@hibernate.org> Message-ID: On 7 August 2014 22:37, Hardy Ferentschik wrote: > > On 7 Jan 2014, at 19:56, Sanne Grinovero wrote: > > > I was hoping to drop @ProvidedId today as the original "marker" > > functionality is no longer needed: since we have > > > > org.hibernate.search.cfg.spi.SearchConfiguration.isIdProvidedImplicit() > > > > the option can be implicitly applied to all indexed entries, and the > > annotation is mostly redundant in Infinispan since we added this. > > > > But actually it turns out it's a bit more complex as it servers a second > > function as well: it's the only way for users to be able to specify a > > FieldBridge for the ID.. so the functionality of this annotation is not > > consumed yet. > > Wouldn?t an additional explicit @FieldBridge annotation work as well? > ?Yes! But we'd need to apply it to the key type. This implies changing it to allow target @Target(TYPE?), which doesn't make much sense for our ORM users, but also the name "FieldBridge" is rather odd to be applied on a type and not a field. From sanne at hibernate.org Thu Aug 7 18:40:24 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 7 Aug 2014 23:40:24 +0100 Subject: [hibernate-dev] [Search] @Transformable vs @ProvidedId In-Reply-To: References: <98A842C3-7F45-4F20-8542-40A592F56C76@hibernate.org> Message-ID: There is an additional complex choice to make. Considering that Infinispan has this separate notion of Key vs Value, and both have to contribute to building the final indexed Document, why is it that we allow the decision of which index is being targeted to be made by *the type of the value*? I think the index definition belongs as a responsibility to the *type of the identifier*, the value should at most help to identify a shard among the ones identified by its key. !!! -> We might want to consider imposing a hard limitation of not allowing a single index to be shared across multiple key types. This implies the @Indexed annotation and its other key options should be defined on the keys, not the values. If we did that, it wouldn't matter if the index is defined on the key or on the value as there would be a 1:1 possible combination. Does anyone see this as a strong limitation or usability concern? This would also resolve a couple of performance problems. Beyond this, considering it's valid (and sometimes useful) to store PersonFile p = ... cache.put( p.taxcode, p ); cache.put( p.uniquename, p ); As a user I think I might even want to define an alternative index mapping for PersonFile, depending on if it's being stored by uniquename or by taxcode. That's totally doable with the Search engine, but how do you envision the user to define this mapping? He can't use annotations on PersonFile, so the user needs to be able to register some form of programmatic mapping linked to the different key types. There is an additional flaw, which is that I'm implying that taxcode and uniquname are of a different type: otherwise we couldn't distinguish the two different meanings of the two put operations. This is generally a fair assumption as you wouldn't want to have key collisions if you're storing in such a fashion, but there might be a known business rule for which such a collision is impossible (i.e. the two codes having a different format). So while you probably shouldn't do this in a strong domain, it's a legal usage of the Cache API. Considering these pitfalls I think I have successfully convinced myself that we should not allow for a different mapping for the same type of key. Question remains if it's more correct to bind the index identification (the name) to the key type. @Hardy yes I will need the Infinispan team's thoughts too, but don't feel excluded, there aren't many smart engineers around knowing about the Infinispan/Query usage :) Cheers, Sanne On 7 August 2014 22:50, Hardy Ferentschik wrote: > > On 7 Jan 2014, at 23:42, Sanne Grinovero wrote: > > > > > > > > > On 7 August 2014 22:37, Hardy Ferentschik wrote: > > > > On 7 Jan 2014, at 19:56, Sanne Grinovero wrote: > > > > > I was hoping to drop @ProvidedId today as the original "marker" > > > functionality is no longer needed: since we have > > > > > > > org.hibernate.search.cfg.spi.SearchConfiguration.isIdProvidedImplicit() > > > > > > the option can be implicitly applied to all indexed entries, and the > > > annotation is mostly redundant in Infinispan since we added this. > > > > > > But actually it turns out it's a bit more complex as it servers a > second > > > function as well: it's the only way for users to be able to specify a > > > FieldBridge for the ID.. so the functionality of this annotation is not > > > consumed yet. > > > > Wouldn?t an additional explicit @FieldBridge annotation work as well? > > > > ?Yes! But we'd need to apply it to the key type. > > This implies changing it to allow target @Target(TYPE?), which doesn't > make much sense for our ORM users, but also the name "FieldBridge" is > rather odd to be applied on a type and not a field. > > Fair enough. I also know too little about the Infinispan usage of Search > in this case. > Either way, @ProvidedId should go, at least from a pure Search point of > view. > > ?Hardy > > From gunnar at hibernate.org Fri Aug 8 08:27:17 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Fri, 8 Aug 2014 14:27:17 +0200 Subject: [hibernate-dev] Query improvements and better Neo4j support - Hibernate OGM 4.1.0.Beta6 is out Message-ID: All, It is my pleasure to announce the release of Beta6 of Hibernate OGM 4.1. Progress has been made with respect to query execution and the Neo4j dialect. Also we do provide a so-called Bill of Materials POM now. Please refer to [1] for all the details. --Gunnar [1] http://in.relation.to/Bloggers/QueryImprovementsAndBetterNeo4jSupportHibernateOGM410Beta6IsOut From gavin.king at gmail.com Fri Aug 8 15:24:39 2014 From: gavin.king at gmail.com (Gavin King) Date: Fri, 8 Aug 2014 21:24:39 +0200 Subject: [hibernate-dev] support for non-JDK collections Message-ID: Hi all, I have a question: I seem to remember that back in the day Hibernate had some level of support for integrating associations based on custom collection types. Is that abstraction still there? That would be one of the things we need to make Hibernate work on Ceylon. Thanks. -- Gavin King gavin at ceylon-lang.org http://profiles.google.com/gavin.king http://ceylon-lang.org http://hibernate.org http://seamframework.org From steve at hibernate.org Sat Aug 9 10:55:24 2014 From: steve at hibernate.org (Steve Ebersole) Date: Sat, 9 Aug 2014 09:55:24 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki Message-ID: There was a discussion in regards to our view on backwards compatibility in reference to HHH-9316. I realized that we talk about this amongst ourselves, but that I have never written these down. So I did that: https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations This is a first draft. Let me know what you think. From steve at hibernate.org Mon Aug 11 17:25:15 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 11 Aug 2014 16:25:15 -0500 Subject: [hibernate-dev] support for non-JDK collections In-Reply-To: References: Message-ID: There is still the org.hibernate.type.CollectionType / org.hibernate.usertype.UserCollectionType contracts On Fri, Aug 8, 2014 at 2:24 PM, Gavin King wrote: > Hi all, I have a question: I seem to remember that back in the day > Hibernate had some level of support for integrating associations based > on custom collection types. Is that abstraction still there? That > would be one of the things we need to make Hibernate work on Ceylon. > > Thanks. > > -- > Gavin King > gavin at ceylon-lang.org > http://profiles.google.com/gavin.king > http://ceylon-lang.org > http://hibernate.org > http://seamframework.org > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From gavin.king at gmail.com Mon Aug 11 17:47:55 2014 From: gavin.king at gmail.com (Gavin King) Date: Mon, 11 Aug 2014 23:47:55 +0200 Subject: [hibernate-dev] support for non-JDK collections In-Reply-To: References: Message-ID: OK, thanks. Now I'm sorta remembering how this stuff works. You have this thing that wraps the real collection and tracks changes to it. Forgot about that. On Mon, Aug 11, 2014 at 11:25 PM, Steve Ebersole wrote: > There is still the org.hibernate.type.CollectionType / > org.hibernate.usertype.UserCollectionType contracts > > > On Fri, Aug 8, 2014 at 2:24 PM, Gavin King wrote: >> >> Hi all, I have a question: I seem to remember that back in the day >> Hibernate had some level of support for integrating associations based >> on custom collection types. Is that abstraction still there? That >> would be one of the things we need to make Hibernate work on Ceylon. >> >> Thanks. >> >> -- >> Gavin King >> gavin at ceylon-lang.org >> http://profiles.google.com/gavin.king >> http://ceylon-lang.org >> http://hibernate.org >> http://seamframework.org >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > -- Gavin King gavin at ceylon-lang.org http://profiles.google.com/gavin.king http://ceylon-lang.org http://hibernate.org http://seamframework.org From steve at hibernate.org Mon Aug 11 18:06:21 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 11 Aug 2014 17:06:21 -0500 Subject: [hibernate-dev] support for non-JDK collections In-Reply-To: References: Message-ID: That's the org.hibernate.collection.spi.PersistentCollection On Mon, Aug 11, 2014 at 4:47 PM, Gavin King wrote: > OK, thanks. Now I'm sorta remembering how this stuff works. You have > this thing that wraps the real collection and tracks changes to it. > Forgot about that. > > On Mon, Aug 11, 2014 at 11:25 PM, Steve Ebersole > wrote: > > There is still the org.hibernate.type.CollectionType / > > org.hibernate.usertype.UserCollectionType contracts > > > > > > On Fri, Aug 8, 2014 at 2:24 PM, Gavin King wrote: > >> > >> Hi all, I have a question: I seem to remember that back in the day > >> Hibernate had some level of support for integrating associations based > >> on custom collection types. Is that abstraction still there? That > >> would be one of the things we need to make Hibernate work on Ceylon. > >> > >> Thanks. > >> > >> -- > >> Gavin King > >> gavin at ceylon-lang.org > >> http://profiles.google.com/gavin.king > >> http://ceylon-lang.org > >> http://hibernate.org > >> http://seamframework.org > >> _______________________________________________ > >> hibernate-dev mailing list > >> hibernate-dev at lists.jboss.org > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > > > > > > -- > Gavin King > gavin at ceylon-lang.org > http://profiles.google.com/gavin.king > http://ceylon-lang.org > http://hibernate.org > http://seamframework.org > From gavin.king at gmail.com Mon Aug 11 18:43:43 2014 From: gavin.king at gmail.com (Gavin King) Date: Tue, 12 Aug 2014 00:43:43 +0200 Subject: [hibernate-dev] support for non-JDK collections In-Reply-To: References: Message-ID: Yes, right. On Tue, Aug 12, 2014 at 12:06 AM, Steve Ebersole wrote: > That's the org.hibernate.collection.spi.PersistentCollection > > > On Mon, Aug 11, 2014 at 4:47 PM, Gavin King wrote: >> >> OK, thanks. Now I'm sorta remembering how this stuff works. You have >> this thing that wraps the real collection and tracks changes to it. >> Forgot about that. >> >> On Mon, Aug 11, 2014 at 11:25 PM, Steve Ebersole >> wrote: >> > There is still the org.hibernate.type.CollectionType / >> > org.hibernate.usertype.UserCollectionType contracts >> > >> > >> > On Fri, Aug 8, 2014 at 2:24 PM, Gavin King wrote: >> >> >> >> Hi all, I have a question: I seem to remember that back in the day >> >> Hibernate had some level of support for integrating associations based >> >> on custom collection types. Is that abstraction still there? That >> >> would be one of the things we need to make Hibernate work on Ceylon. >> >> >> >> Thanks. >> >> >> >> -- >> >> Gavin King >> >> gavin at ceylon-lang.org >> >> http://profiles.google.com/gavin.king >> >> http://ceylon-lang.org >> >> http://hibernate.org >> >> http://seamframework.org >> >> _______________________________________________ >> >> hibernate-dev mailing list >> >> hibernate-dev at lists.jboss.org >> >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > >> > >> >> >> >> -- >> Gavin King >> gavin at ceylon-lang.org >> http://profiles.google.com/gavin.king >> http://ceylon-lang.org >> http://hibernate.org >> http://seamframework.org > > -- Gavin King gavin at ceylon-lang.org http://profiles.google.com/gavin.king http://ceylon-lang.org http://hibernate.org http://seamframework.org From steve at hibernate.org Tue Aug 12 09:15:29 2014 From: steve at hibernate.org (Steve Ebersole) Date: Tue, 12 Aug 2014 08:15:29 -0500 Subject: [hibernate-dev] Exposing Hibernate statistics via JMX In-Reply-To: References: Message-ID: There is a general purpose approach for exposing things via JMX starting in 4.2. The difficulty I always get myself into is trying to plan through the classloading issues with JMX. I think its easy enough in the java.lang.management.ManagementFactory#getPlatformMBeanServer case. The concern is more embedded MBeanServer cases. This came from discussions with the JBoss JMX folks, as this is honestly outside my field of expertise. So long story short, we currently do not expose any MBeans ourselves. I simply provide the mechanism. See org.hibernate.jmx.spi.JmxService On Mon, Aug 4, 2014 at 3:30 AM, Gunnar Morling wrote: > Anyone with an idea of what's the recommended way of exposing Hibernate > statistics via JMX as of 4.3? > > Thanks, > > --Gunnar > > > 2014-07-31 14:02 GMT+02:00 Gunnar Morling : > > > Steve, all, > > > > I've been asked about the Hibernate statistics functionality which used > to > > be accessible via JMX. > > > > There used to be StatisticsService which was an MBean and which one could > > register with the JMX platform. This has been removed a while ago, and > > there is the related issue HHH-6190 which still is open. > > > > Until this is resolved, what is the recommended strategy towards making > > the statistics available via JMX? Should users create and export their > own > > MBean based on SessionFactory#getStatistics()? Or is there any other > > replacement for StatisticsService? > > > > Thanks, > > > > --Gunnar > > > > [1] https://hibernate.atlassian.net/browse/HHH-6190 > > > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Wed Aug 13 10:32:22 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 13 Aug 2014 15:32:22 +0100 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: Thanks Steve! that's extremely useful. My only doubt is the relation between release families, quoting: >> Hibernate considers the {major}.{minor} combination a release "family". and then later below in paragraph "The rules" : >> API contracts should be considered stable across all releases in a family. I'm not sure if you mean that 4.4.0 and 4.4.1 are (promised to be) API compatible, while 4.3.0 and 4.4.0 are not.. I would say from the definition above that I should not expect that as the two are in a different family, still the following example seems to point out that any 4.x will be drop-in compatible with 4.0.0 ? It would also help to understand the rules better to explain when the team decides to bump the major version. Sanne On 9 August 2014 15:55, Steve Ebersole wrote: > There was a discussion in regards to our view on backwards compatibility in > reference to HHH-9316. I realized that we talk about this amongst > ourselves, but that I have never written these down. So I did that: > > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > > This is a first draft. Let me know what you think. > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From smarlow at redhat.com Thu Aug 14 11:23:11 2014 From: smarlow at redhat.com (Scott Marlow) Date: Thu, 14 Aug 2014 11:23:11 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? Message-ID: <53ECD45F.4080900@redhat.com> I'm trying to help a user [1] that is complaining that a local database transaction is used, instead of the JTA transaction as they expect. I asked them to enable TRACE logging for { org.jboss.jca, org.hibernate, org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync registration due to auto join checking" log message. What does the "skipping JTA sync registration due to auto join checking" mean exactly? [2] shows a small example of the log output with an active JTA transaction in use. Scott [1] https://issues.jboss.org/browse/WFLY-3619 XA END / un-enlist for database connection called to early [2] http://fpaste.org/125603/80296401/ From steve at hibernate.org Thu Aug 14 11:59:08 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 14 Aug 2014 10:59:08 -0500 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53ECD45F.4080900@redhat.com> References: <53ECD45F.4080900@redhat.com> Message-ID: Well it *should* mean that the EM in question was created outside the scope of a transaction. The JPA spec says that in cases of an application-managed PC where the EM is created outside the scope of the JTA txn, the provider should not automatically join the EM to any JTA txn later implicitly. Instead the expectation is for the application to explicitly join the EM to the transaction via the EM.joinTransaction method: When a JTA application-managed entity manager is used, if the entity manager is created outside the scope of the current JTA transaction, it is the responsibility of the application to join the entity manager to the transaction (if desired) by calling EntityManager.joinTransaction. If the entity man- ager is created outside the scope of a JTA transaction, it is not joined to the transaction unless Entity- Manager.joinTransaction is called. Note this behavior was made somewhat controllable in JPA 2.1 with the introduction of SynchronizationType. I'd have to refresh my memory on the expectation here wrt container-managed PCs. So that would be my first question to you of the situation... Is this a app or container managed PC? It is odd that they see a "local database transaction" instead though. You sure this isn't a series of auto-commit transactions? On Thu, Aug 14, 2014 at 10:23 AM, Scott Marlow wrote: > I'm trying to help a user [1] that is complaining that a local database > transaction is used, instead of the JTA transaction as they expect. I > asked them to enable TRACE logging for { org.jboss.jca, org.hibernate, > org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync > registration due to auto join checking" log message. > > What does the "skipping JTA sync registration due to auto join checking" > mean exactly? [2] shows a small example of the log output with an > active JTA transaction in use. > > Scott > > > [1] https://issues.jboss.org/browse/WFLY-3619 XA END / un-enlist for > database connection called to early > > [2] http://fpaste.org/125603/80296401/ > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From smarlow at redhat.com Thu Aug 14 12:28:41 2014 From: smarlow at redhat.com (Scott Marlow) Date: Thu, 14 Aug 2014 12:28:41 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: References: <53ECD45F.4080900@redhat.com> Message-ID: <53ECE3B9.6040208@redhat.com> On 08/14/2014 11:59 AM, Steve Ebersole wrote: > Well it *should* mean that the EM in question was created outside the > scope of a transaction. The JPA spec says that in cases of an > application-managed PC where the EM is created outside the scope of the > JTA txn, the provider should not automatically join the EM to any JTA > txn later implicitly. Instead the expectation is for the application to > explicitly join the EM to the transaction via the EM.joinTransaction method: > > > When a JTA application-managed entity manager is used, if the entity > manager is created outside the > scope of the current JTA transaction, it is the responsibility of the > application to join the entity manager > to the transaction (if desired) by calling > EntityManager.joinTransaction. If the entity man- > ager is created outside the scope of a JTA transaction, it is not joined > to the transaction unless Entity- > Manager.joinTransaction is called. > > > Note this behavior was made somewhat controllable in JPA 2.1 with the > introduction of SynchronizationType. > > I'd have to refresh my memory on the expectation here wrt > container-managed PCs. So that would be my first question to you of the > situation... Is this a app or container managed PC? > > It is odd that they see a "local database transaction" instead though. > You sure this isn't a series of auto-commit transactions? I won't be sure until they enable TRACE logging for org.jboss.as.jpa and give us more logs. I'm waiting for that. > > > > > On Thu, Aug 14, 2014 at 10:23 AM, Scott Marlow > wrote: > > I'm trying to help a user [1] that is complaining that a local database > transaction is used, instead of the JTA transaction as they expect. I > asked them to enable TRACE logging for { org.jboss.jca, org.hibernate, > org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync > registration due to auto join checking" log message. > > What does the "skipping JTA sync registration due to auto join checking" > mean exactly? [2] shows a small example of the log output with an > active JTA transaction in use. > > Scott > > > [1] https://issues.jboss.org/browse/WFLY-3619 XA END / un-enlist for > database connection called to early > > [2] http://fpaste.org/125603/80296401/ > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > > From steve at hibernate.org Thu Aug 14 12:32:25 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 14 Aug 2014 11:32:25 -0500 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53ECE3B9.6040208@redhat.com> References: <53ECD45F.4080900@redhat.com> <53ECE3B9.6040208@redhat.com> Message-ID: Or you could just ask them ;) On Thu, Aug 14, 2014 at 11:28 AM, Scott Marlow wrote: > > On 08/14/2014 11:59 AM, Steve Ebersole wrote: > >> Well it *should* mean that the EM in question was created outside the >> scope of a transaction. The JPA spec says that in cases of an >> application-managed PC where the EM is created outside the scope of the >> JTA txn, the provider should not automatically join the EM to any JTA >> txn later implicitly. Instead the expectation is for the application to >> explicitly join the EM to the transaction via the EM.joinTransaction >> method: >> >> >> When a JTA application-managed entity manager is used, if the entity >> manager is created outside the >> scope of the current JTA transaction, it is the responsibility of the >> application to join the entity manager >> to the transaction (if desired) by calling >> EntityManager.joinTransaction. If the entity man- >> ager is created outside the scope of a JTA transaction, it is not joined >> to the transaction unless Entity- >> Manager.joinTransaction is called. >> >> >> Note this behavior was made somewhat controllable in JPA 2.1 with the >> introduction of SynchronizationType. >> >> I'd have to refresh my memory on the expectation here wrt >> container-managed PCs. So that would be my first question to you of the >> situation... Is this a app or container managed PC? >> >> It is odd that they see a "local database transaction" instead though. >> You sure this isn't a series of auto-commit transactions? >> > > I won't be sure until they enable TRACE logging for org.jboss.as.jpa and > give us more logs. I'm waiting for that. > > >> >> >> >> On Thu, Aug 14, 2014 at 10:23 AM, Scott Marlow > > wrote: >> >> I'm trying to help a user [1] that is complaining that a local >> database >> transaction is used, instead of the JTA transaction as they expect. I >> asked them to enable TRACE logging for { org.jboss.jca, org.hibernate, >> org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync >> registration due to auto join checking" log message. >> >> What does the "skipping JTA sync registration due to auto join >> checking" >> mean exactly? [2] shows a small example of the log output with an >> active JTA transaction in use. >> >> Scott >> >> >> [1] https://issues.jboss.org/browse/WFLY-3619 XA END / un-enlist for >> database connection called to early >> >> [2] http://fpaste.org/125603/80296401/ >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> >> >> > From steve at hibernate.org Thu Aug 14 13:21:20 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 14 Aug 2014 12:21:20 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: That should read "API contracts should be considered stable within all releases within a major version". As an example, an application developer should be able to develop against APIs as available in 4.2 and be able to drop 4.3 into that application without changes, so long as they rely only on defined APIs. This is what is called backwards compatibility: meaning that any changes done in 4.3 are done in such a way as to remain compatible with older (backward) versions. Personally, I find the terms confusing because I think of it in terms of "porting" the application forward to use a newer version of a library. The inverse is something we actually do not guarantee in regards to APIs and going back to an older version (reverting). An example here would be developing an application using the natural-id API developed in 4.2 and then trying to port that application to use 4.1. That won't work. So within a major version we guarantee APIs to be backwards compatible, but not forward compatible. Does that wording help clarify? On Wed, Aug 13, 2014 at 9:32 AM, Sanne Grinovero wrote: > Thanks Steve! > that's extremely useful. > > My only doubt is the relation between release families, quoting: > >> Hibernate considers the {major}.{minor} combination a release "family". > > and then later below in paragraph "The rules" : > >> API contracts should be considered stable across all releases in a > family. > > I'm not sure if you mean that 4.4.0 and 4.4.1 are (promised to be) API > compatible, while 4.3.0 and 4.4.0 are not.. > I would say from the definition above that I should not expect that as > the two are in a different family, still the following example seems > to point out that any 4.x will be drop-in compatible with 4.0.0 ? > > It would also help to understand the rules better to explain when the > team decides to bump the major version. > > Sanne > > > On 9 August 2014 15:55, Steve Ebersole wrote: > > There was a discussion in regards to our view on backwards compatibility > in > > reference to HHH-9316. I realized that we talk about this amongst > > ourselves, but that I have never written these down. So I did that: > > > > > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > > > > This is a first draft. Let me know what you think. > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From steve at hibernate.org Thu Aug 14 13:40:33 2014 From: steve at hibernate.org (Steve Ebersole) Date: Thu, 14 Aug 2014 12:40:33 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: Check out my edits and see if that is better On Thu, Aug 14, 2014 at 12:21 PM, Steve Ebersole wrote: > That should read "API contracts should be considered stable within all > releases within a major version". As an example, an application developer > should be able to develop against APIs as available in 4.2 and be able to > drop 4.3 into that application without changes, so long as they rely only > on defined APIs. > > This is what is called backwards compatibility: meaning that any changes > done in 4.3 are done in such a way as to remain compatible with older > (backward) versions. Personally, I find the terms confusing because I > think of it in terms of "porting" the application forward to use a newer > version of a library. > > The inverse is something we actually do not guarantee in regards to APIs > and going back to an older version (reverting). An example here would be > developing an application using the natural-id API developed in 4.2 and > then trying to port that application to use 4.1. That won't work. > > So within a major version we guarantee APIs to be backwards compatible, > but not forward compatible. > > Does that wording help clarify? > > > > On Wed, Aug 13, 2014 at 9:32 AM, Sanne Grinovero > wrote: > >> Thanks Steve! >> that's extremely useful. >> >> My only doubt is the relation between release families, quoting: >> >> Hibernate considers the {major}.{minor} combination a release >> "family". >> >> and then later below in paragraph "The rules" : >> >> API contracts should be considered stable across all releases in a >> family. >> >> I'm not sure if you mean that 4.4.0 and 4.4.1 are (promised to be) API >> compatible, while 4.3.0 and 4.4.0 are not.. >> I would say from the definition above that I should not expect that as >> the two are in a different family, still the following example seems >> to point out that any 4.x will be drop-in compatible with 4.0.0 ? >> >> It would also help to understand the rules better to explain when the >> team decides to bump the major version. >> >> Sanne >> >> >> On 9 August 2014 15:55, Steve Ebersole wrote: >> > There was a discussion in regards to our view on backwards >> compatibility in >> > reference to HHH-9316. I realized that we talk about this amongst >> > ourselves, but that I have never written these down. So I did that: >> > >> > >> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >> > >> > This is a first draft. Let me know what you think. >> > _______________________________________________ >> > hibernate-dev mailing list >> > hibernate-dev at lists.jboss.org >> > https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > > From gunnar at hibernate.org Fri Aug 15 06:24:44 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Fri, 15 Aug 2014 12:24:44 +0200 Subject: [hibernate-dev] Contributing to OGM / Cassandra In-Reply-To: References: <6B5FA68A-59CD-4CAD-81EB-3AC2CCBBE55C@hibernate.org> Message-ID: Hi John, First off, sorry again for the late response. 2014-08-07 10:10 GMT+02:00 John Worrell : > Hi Emmanuel et al., > > My apologies for the log radio silence. I've taken a look at the code-base > on Jon Halliday's repo, and have set up a nick on freenode - #jlesinge. > > On the time-series question I was wondering how you envisaged the data > stored: I tend to think of a single row under an primary key with an > object-instance per column. Now what we have typically done (generally the > data has been immutable) is to store the data serialized as a blob (JSON or > XML), but I understand you do not favour this approach. With this sort of > model I imagine the collection is then all the objects stored in the row, > and the challenge is to page through the objects in the row. > I cannot really comment on the time-series question, I'll leave that to Emmanuel. You're right though that data should not be stored as BLOBs or any other "non-natural" representation. Querying and interaction with other applications using the same store would then be a problem. > > An approach we have often taken is to create multiple copies of data in > different (obviously works well only for immutable objects) or better to > create a table of keys to a main table where in either approach the > row-keys are effectively a foreign-key and there is column per object > associated through the foreign-key. Could you maybe give an example for how this would look like? > Another approach though might be to use > a column with type list (or set, or map) to contain keys to the associated > objects - this would be a little like the extensions Oracle have for > mapping 1-* associations, though with the caveat that a column of > collection type may only contain 64k elements. I wondered if some though > had been given to this strategy (which I must admit I have not yet used > myself). > A very good question, unfortunately my knowledge of data modeling with Cassandra is still a bit limited. Storing "foreign keys" in collection columns seems like a good idea. It's somewhat similar to the "in entity" mode we have for MongoDB. Do list columns support null values? I think we'd need that for ordered collections containing nulls. Another question is how to deal with compound map keys. For the document stores (MongoDB, CouchDB) we offer an alternative "association document" mode which persists association information not within the referencing entity but within separate entity documents, circumventing similar issues with the max size of documents. IIUC, that's somewhat similar to the first mode you describe. It might make sense to support both modes in a similar fashion for Cassandra, configurable per association. Out of interest, how are associations handled in the branch created by Jonathan? What concerns de-normalization, some thoughts have been made, it's planned for the 4.2 release at this point. It seems very likely that different mapping strategies should be > specifiable, but then I have still to understand how these might fit with > treiid. > What is "treiid"? Do you mean Teiid (http://teiid.jboss.org/)? +1 for making different strategies configurable where it makes sense. That's what we do for other stores as well. You might want to have a look at the AssociationStorage option. Currently that's specific to document stores, but it might make sense to further generify it. > > Can I ask about assumptions: is it fair to assume that for Cassandra, OGM > will target only CQL 3 (which means Cassandra 2 or maybe 1.2)? This would > certainly make life simpler. > Yes, I think that's fair to assume. We still can add support for earlier versions later on, should there be the need for it. > > An issue I don't see addressed is the choice of consistency-level (read or > write) and I wondered if there was a plan for this? Assumptions can be made > on a per table basis, but, certainly for ad hoc queries, it is important > think to have the flexibility to specify on a per-query basis. > Configuring it on a per-table basis seems sensible. You can have a look at how we do it for MongoDB (read preference, write concern) [1]. There is a generic option mechanism which allows to add store-specific options and let the user configure them via annotations or API, globally, per entity or per property. Specifying options per query is still an open issue. We plan to support options specific to one Session [2] which will override the otherwise defined settings, but per operation is something different yet. The main challenge is that the existing APIs (createQuery() etc.) don't accept any additional context, so we need to find a way to establish such option context valid to one operation somehow. > Those are my thoughts so far... I'll see about doing a POC of some of what > I have described above > Awesome. Looking forward to it very much. If you want to discuss anything specific in the code, just let us know. If you like, you also can send an "early review" pull request as the basis for discussion of the general approach. Do you have any branch newer than the original one from Jonathan already on GitHub? I could then take a look to make myself acquainted with the current state. Cheers, > > John > Many thanks for your help and with best regards, --Gunnar [1] https://docs.jboss.org/hibernate/ogm/4.1/reference/en-US/html_single/#_configuring_mongodb [2] https://hibernate.atlassian.net/browse/OGM-343 > > > On Mon, Jul 21, 2014 at 4:48 PM, John Worrell wrote: > > > Hi Emmanuel, > > > > I'll take a look at what is there, and I'll get up and running on IRC. > > > > I'll particularly look at the time-series issue - non-trivial I think. > > > > Cheers, > > > > John > > > > > > On Mon, Jul 21, 2014 at 1:06 PM, Emmanuel Bernard < > emmanuel at hibernate.org> > > wrote: > > > >> Hi John, > >> > >> I thought I had replied to you on Friday but apparently the email never > >> went through :/ > >> > >> That is good news :) > >> Jonathan worked on a Cassandra prototype but had to drop due to other > >> duties. He pushed everything at > >> https://github.com/jhalliday/hibernate-ogm/tree/jonathan_cassandra > >> > >> Have a look at what he has done and come ask any question to Gunnar, > >> Davide or me. There are a bunch of moving pieces. We are mostly on > >> freenode?s #hibernate-dev ( you need a freenode login > >> http://freenode.net/faq.shtml#nicksetup ). If you are allergic to IRC, > >> let me know and we will find alternatives. > >> > >> The most interesting challenge will be to see how we can map time series > >> into a collection and make sure we let the user decide how much he > wants to > >> load. > >> > >> Emmanuel > >> > >> On 16 Jul 2014, at 13:17, John Worrell wrote: > >> > >> > Hi, > >> > > >> > I'm interested in contributing to the Cassandra module of > Hibernate-OGM > >> - > >> > what would be the baest way to go about this? > >> > > >> > Thanks, > >> > > >> > John > >> > _______________________________________________ > >> > 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 Fri Aug 15 07:02:54 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Fri, 15 Aug 2014 12:02:54 +0100 Subject: [hibernate-dev] New disruptive API possibilities in Java8: what do we do? Message-ID: As in this forum post: - https://forum.hibernate.org/viewtopic.php?f=1&t=1036010 and some conversations I catched on the twitter radar, SO and other posts, lots of people are wondering what our "amazing plans" are around powerful innovations we could to thanks to Java8. I understand we're all quite stretched and I don't think I can take the lead on this either, but I think we should at least provide potential contributors with some options to experiment and see where we can get. As soon as we have confluence we could have a page to describe our constraints and possibly to collect nice ideas. Beyond that, what about having some kind of sandbox project for an ORM wrapper (and maybe others) to play with experimental API proposals? I would love to be able to suggest some "get prototyping here" plan to smart proposals like the one in this forum post. --Sanne From sanne at hibernate.org Fri Aug 15 10:58:34 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Fri, 15 Aug 2014 15:58:34 +0100 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: thanks Steve, yes that's very clear and also easy to follow. Sanne On 14 August 2014 18:40, Steve Ebersole wrote: > Check out my edits and see if that is better > > > On Thu, Aug 14, 2014 at 12:21 PM, Steve Ebersole > wrote: >> >> That should read "API contracts should be considered stable within all >> releases within a major version". As an example, an application developer >> should be able to develop against APIs as available in 4.2 and be able to >> drop 4.3 into that application without changes, so long as they rely only on >> defined APIs. >> >> This is what is called backwards compatibility: meaning that any changes >> done in 4.3 are done in such a way as to remain compatible with older >> (backward) versions. Personally, I find the terms confusing because I think >> of it in terms of "porting" the application forward to use a newer version >> of a library. >> >> The inverse is something we actually do not guarantee in regards to APIs >> and going back to an older version (reverting). An example here would be >> developing an application using the natural-id API developed in 4.2 and then >> trying to port that application to use 4.1. That won't work. >> >> So within a major version we guarantee APIs to be backwards compatible, >> but not forward compatible. >> >> Does that wording help clarify? >> >> >> >> On Wed, Aug 13, 2014 at 9:32 AM, Sanne Grinovero >> wrote: >>> >>> Thanks Steve! >>> that's extremely useful. >>> >>> My only doubt is the relation between release families, quoting: >>> >> Hibernate considers the {major}.{minor} combination a release >>> "family". >>> >>> and then later below in paragraph "The rules" : >>> >> API contracts should be considered stable across all releases in a >>> family. >>> >>> I'm not sure if you mean that 4.4.0 and 4.4.1 are (promised to be) API >>> compatible, while 4.3.0 and 4.4.0 are not.. >>> I would say from the definition above that I should not expect that as >>> the two are in a different family, still the following example seems >>> to point out that any 4.x will be drop-in compatible with 4.0.0 ? >>> >>> It would also help to understand the rules better to explain when the >>> team decides to bump the major version. >>> >>> Sanne >>> >>> >>> On 9 August 2014 15:55, Steve Ebersole wrote: >>> > There was a discussion in regards to our view on backwards >>> > compatibility in >>> > reference to HHH-9316. I realized that we talk about this amongst >>> > ourselves, but that I have never written these down. So I did that: >>> > >>> > >>> > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >>> > >>> > This is a first draft. Let me know what you think. >>> > _______________________________________________ >>> > hibernate-dev mailing list >>> > hibernate-dev at lists.jboss.org >>> > https://lists.jboss.org/mailman/listinfo/hibernate-dev >> >> > From jmnarloch at gmail.com Fri Aug 15 12:28:20 2014 From: jmnarloch at gmail.com (Jakub Narloch) Date: Fri, 15 Aug 2014 18:28:20 +0200 Subject: [hibernate-dev] New disruptive API possibilities in Java8: what do we do? In-Reply-To: References: Message-ID: Hi Sanne, I've already grab the code and do some experiments by implementing the proposed API: https://github.com/jmnarloch/hibernate-orm/tree/java-8-optional https://github.com/jmnarloch/hibernate-orm/tree/java-8-streams Only to find that the build system itself it not yet ready to be moved to Java 8, by that I mean - animal sniffer is not yet capable to generate the Java 8 signatures - ( http://jira.codehaus.org/browse/MANIMALSNIFFER-45) - (that might be a minor thing) - Gradle 2.0 or to be more exact Groovy 2.3.2 has an bug within ( https://jira.codehaus.org/browse/GROOVY-7023 - well that is not exactly a bug that's a feature ;)) that makes the hibernate-enhance-maven-plugin build to fail. This is kind of blocker for now. As you may notice I've made the changes in the core module, which is not exactly the direction you would wish to take due to backward compatibiility with older JVMs. So since this changes affect so much basic API, could you deliberate more how would you expect this to be handled? What would be your approach? I think that the migration to Java 8 is either way unavoidable and will happen at some point in time, If that's ok with you I will create an umbrella JIRA task, that could gather ideas for API changes. Regards, Jakub 2014-08-15 13:02 GMT+02:00 Sanne Grinovero : As in this forum post: > - https://forum.hibernate.org/viewtopic.php?f=1&t=1036010 > and some conversations I catched on the twitter radar, SO and other > posts, lots of people are wondering what our "amazing plans" are > around powerful innovations we could to thanks to Java8. > > I understand we're all quite stretched and I don't think I can take > the lead on this either, but I think we should at least provide > potential contributors with some options to experiment and see where > we can get. > > As soon as we have confluence we could have a page to describe our > constraints and possibly to collect nice ideas. Beyond that, what > about having some kind of sandbox project for an ORM wrapper (and > maybe others) to play with experimental API proposals? > > I would love to be able to suggest some "get prototyping here" plan to > smart proposals like the one in this forum post. > > --Sanne > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > 2014-08-15 13:02 GMT+02:00 Sanne Grinovero : > As in this forum post: > - https://forum.hibernate.org/viewtopic.php?f=1&t=1036010 > and some conversations I catched on the twitter radar, SO and other > posts, lots of people are wondering what our "amazing plans" are > around powerful innovations we could to thanks to Java8. > > I understand we're all quite stretched and I don't think I can take > the lead on this either, but I think we should at least provide > potential contributors with some options to experiment and see where > we can get. > > As soon as we have confluence we could have a page to describe our > constraints and possibly to collect nice ideas. Beyond that, what > about having some kind of sandbox project for an ORM wrapper (and > maybe others) to play with experimental API proposals? > > I would love to be able to suggest some "get prototyping here" plan to > smart proposals like the one in this forum post. > > --Sanne > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Fri Aug 15 12:53:07 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Fri, 15 Aug 2014 17:53:07 +0100 Subject: [hibernate-dev] New disruptive API possibilities in Java8: what do we do? In-Reply-To: References: Message-ID: Hi Jakub, welcome! Some comments inline: On 15 August 2014 17:28, Jakub Narloch wrote: > Hi Sanne, > > I've already grab the code and do some experiments by implementing the > proposed API: > > https://github.com/jmnarloch/hibernate-orm/tree/java-8-optional > https://github.com/jmnarloch/hibernate-orm/tree/java-8-streams > > Only to find that the build system itself it not yet ready to be moved to > Java 8, by that I mean > - animal sniffer is not yet capable to generate the Java 8 signatures - > (http://jira.codehaus.org/browse/MANIMALSNIFFER-45) - (that might be a minor > thing) Assuming this will be handled in a separate experimental module, we could disable the animal sniffer in that one. It's a known problem which affects our CI builds too: Animal Sniffer relies on an older version of ASM which isn't able to decode the class format generated by Java8. I'm not sure how minor that is: there are newer ASM versions available which support it but the API changed too so someone would need to work on animal sniffer; it's certainly minor for us as this plugin is not important in this context: it's meant to help spotting backwards compatible changes and we know it breaks ;-) > - Gradle 2.0 or to be more exact Groovy 2.3.2 has an bug within > (https://jira.codehaus.org/browse/GROOVY-7023 - well that is not exactly a > bug that's a feature ;)) that makes the hibernate-enhance-maven-plugin build > to fail. This is kind of blocker for now. Thanks. I'm not an expert of Gradle at all, Steve might be able to help? > As you may notice I've made the changes in the core module, which is not > exactly the direction you would wish to take due to backward compatibiility > with older JVMs. So since this changes affect so much basic API, could you > deliberate more how would you expect this to be handled? What would be your > approach? Steve Ebersole is the project lead so I'm looking forward to his reaction. What I wrote in the forum post, to create a wrapper and allow a bit of rapid prototyping is I hope acceptable but it's his decision. I suspect we'll want to at least maintain (some version) of Hibernate compatible with Java7 for years still, and it would be good to not have to backport a lot, i.e. to not have to maintain a separate branch. So if we start with some kind of experimental module separate from the main jar which users can optionally use, this module could eventually drop the "experimental" label but still be built separately: we could then eventually merge it in the core jar but with the benefit of postponing this decision. Having already large independent projects such as Hibernate Search and Hibernate OGM which deeply tie into the ORM lifecycle, but also wrappers like the JPA compatibility layer (EntityManager) is I hope a sign of maturity of the extension points: it should be easy to keep things nicely isolated, and we can definitely help. Also considering that all these other projects build on top of the ORM API and integration points, merging such changes right away would require those other projects to keep following up with changes; that would slow us down too much if the API keeps changing - as I initially expect while more people will join the brainstorming. > I think that the migration to Java 8 is either way unavoidable and will > happen at some point in time, If that's ok with you I will create an > umbrella JIRA task, that could gather ideas for API changes. Yes please do! Regards, Sanne > > Regards, > Jakub > > 2014-08-15 13:02 GMT+02:00 Sanne Grinovero : > >> As in this forum post: >> - https://forum.hibernate.org/viewtopic.php?f=1&t=1036010 >> and some conversations I catched on the twitter radar, SO and other >> posts, lots of people are wondering what our "amazing plans" are >> around powerful innovations we could to thanks to Java8. >> >> I understand we're all quite stretched and I don't think I can take >> the lead on this either, but I think we should at least provide >> potential contributors with some options to experiment and see where >> we can get. >> >> As soon as we have confluence we could have a page to describe our >> constraints and possibly to collect nice ideas. Beyond that, what >> about having some kind of sandbox project for an ORM wrapper (and >> maybe others) to play with experimental API proposals? >> >> I would love to be able to suggest some "get prototyping here" plan to >> smart proposals like the one in this forum post. >> >> --Sanne >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > > > > 2014-08-15 13:02 GMT+02:00 Sanne Grinovero : >> >> As in this forum post: >> >> - https://forum.hibernate.org/viewtopic.php?f=1&t=1036010 >> and some conversations I catched on the twitter radar, SO and other >> posts, lots of people are wondering what our "amazing plans" are >> around powerful innovations we could to thanks to Java8. >> >> I understand we're all quite stretched and I don't think I can take >> the lead on this either, but I think we should at least provide >> potential contributors with some options to experiment and see where >> we can get. >> >> As soon as we have confluence we could have a page to describe our >> constraints and possibly to collect nice ideas. Beyond that, what >> about having some kind of sandbox project for an ORM wrapper (and >> maybe others) to play with experimental API proposals? >> >> I would love to be able to suggest some "get prototyping here" plan to >> smart proposals like the one in this forum post. >> >> --Sanne >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev > > From etienne.miret at ens-lyon.org Sun Aug 17 03:07:27 2014 From: etienne.miret at ens-lyon.org (Etienne Miret) Date: Sun, 17 Aug 2014 09:07:27 +0200 Subject: [hibernate-dev] JPQL versus HQL Message-ID: <0A8244DD-E412-4C6A-9CE1-1B3B8DDA2577@ens-lyon.org> Hello all, Is HQL a superset of JPQL or a completely different language? I?m asking because I?m currently adding JPAQL constructions to HQL (see HHH-9342 and HHH-9345), and I want to be sure it is the right thing to do. Since the reference documentation doesn?t say anything about JPQL, I suspect the former (HQL superset of JPQL), but I?d like to be sure. Regards, -- Etienne Miret From gunnar at hibernate.org Sun Aug 17 06:19:07 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Sun, 17 Aug 2014 12:19:07 +0200 Subject: [hibernate-dev] JPQL versus HQL In-Reply-To: <0A8244DD-E412-4C6A-9CE1-1B3B8DDA2577@ens-lyon.org> References: <0A8244DD-E412-4C6A-9CE1-1B3B8DDA2577@ens-lyon.org> Message-ID: Hi Etienne, 2014-08-17 9:07 GMT+02:00 Etienne Miret : > Hello all, > > Is HQL a superset of JPQL or a completely different language? > Yes, HQL is a superset. > > I?m asking because I?m currently adding JPAQL constructions to HQL (see > HHH-9342 and HHH-9345), and I want to be sure it is the right thing to do. > > Since the reference documentation doesn?t say anything about JPQL, I > suspect the former (HQL superset of JPQL), but I?d like to be sure. > The Developer Guide [1] has this to say: "The Hibernate Query Language (HQL) and Java Persistence Query Language (JPQL) are both object model focused query languages similar in nature to SQL. JPQL is a heavily-inspired-by subset of HQL. A JPQL query is always a valid HQL query, the reverse is not true however." Hth, --Gunnar [1] https://docs.jboss.org/hibernate/orm/4.3/devguide/en-US/html/ch11.html > > Regards, > > -- > Etienne Miret > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From etienne.miret at ens-lyon.org Sun Aug 17 07:18:38 2014 From: etienne.miret at ens-lyon.org (Etienne Miret) Date: Sun, 17 Aug 2014 13:18:38 +0200 Subject: [hibernate-dev] JPQL versus HQL In-Reply-To: References: <0A8244DD-E412-4C6A-9CE1-1B3B8DDA2577@ens-lyon.org> Message-ID: <3D72A007-801A-4B06-84AA-E22E1DB9C843@ens-lyon.org> Hi Gunnar, Thank you for your reply, and sorry I missed the answer in the Developer Guide. I?ll search it more carefully next time. Regards, -- Etienne Miret From sanne at hibernate.org Sun Aug 17 13:25:26 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Sun, 17 Aug 2014 18:25:26 +0100 Subject: [hibernate-dev] JPQL versus HQL In-Reply-To: <3D72A007-801A-4B06-84AA-E22E1DB9C843@ens-lyon.org> References: <0A8244DD-E412-4C6A-9CE1-1B3B8DDA2577@ens-lyon.org> <3D72A007-801A-4B06-84AA-E22E1DB9C843@ens-lyon.org> Message-ID: Hi Etienne, don't worry, it's actually great to know that you're working on that. Always welcome to ask! Cheers, Sanne On 17 August 2014 12:18, Etienne Miret wrote: > Hi Gunnar, > > Thank you for your reply, and sorry I missed the answer in the Developer Guide. I?ll search it more carefully next time. > > Regards, > > -- > Etienne Miret > > > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From etienne.miret at ens-lyon.org Sun Aug 17 17:14:01 2014 From: etienne.miret at ens-lyon.org (Etienne Miret) Date: Sun, 17 Aug 2014 23:14:01 +0200 Subject: [hibernate-dev] Gradle not running some unit tests In-Reply-To: References: Message-ID: <65F9A268-BA89-4E79-8F7B-D7BFFF435FAB@ens-lyon.org> Hello all, On 2014-07-07 I wrote: > Willing to investigate some Hibernate bugs, I downloaded the sources (from github), compiled them and ran unit tests. I used the provided Gradle wrapper to compile and run the tests. However, hibernate-core/target/reports/tests/index.html reports a number of test classes as not containing any tests. Okay, I found what was happening: BaseCoreFunctionalTestCase.buildSessionFactory() was throwing an exception, which causes the test to fail in Eclipse but, oddly, makes it disappear in Gradle?s report. I created HHH-9348 about those tests failing. I guess I should report a bug to Gradle too. Regards, -- Etienne Miret From gunnar at hibernate.org Mon Aug 18 03:14:33 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Mon, 18 Aug 2014 09:14:33 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: Hi Steve, Thanks for writing up these rules. That's very valuable information for users and us as well. Only two remarks on the following: > The use of package names for this is unfortunately not granular enough oftentimes. > Ultimately I would envision a better solution (annotations?) In which cases is it not granular enough? Can such case not always be circumvented by refactoring code into separate classes within separate packages? I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. internal parts on a finer level than the package, as that's what OSGi but also JBoss Modules rely on. We cannot fully leverage the ability of these module systems to "hide" internal parts of a module in that case. Also I think annotations are easier to "miss" than package names when importing classes into an application, thus I'm concerned about accidental referencing internal classes. > SPI contracts should be considered stable within a release family, not necessarily across different release families. A specific example, similar to the API section, would be nice, e.g.: "If you implement an application against an integration point from Hibernate ORM 4.3.0, the expectation is that it works without changes when updating to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x in the very most cases, but that's not guaranteed." --Gunnar 2014-08-09 16:55 GMT+02:00 Steve Ebersole : > There was a discussion in regards to our view on backwards compatibility in > reference to HHH-9316. I realized that we talk about this amongst > ourselves, but that I have never written these down. So I did that: > > > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > > This is a first draft. Let me know what you think. > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Mon Aug 18 07:12:51 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Mon, 18 Aug 2014 12:12:51 +0100 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: I won't speak for Steve's reasons, but I agree with the granularity problem. For example you might not want to refactor the code to promote an SPI to API (or simply fix a mistake), or viceversa demote an API to SPI, as you moving the packages around would break backwards compatibility. Essentially this means you can only fix the packages in that short time in which you're in Alpha/Beta phase for a new major release, which is a short period in which usually the team has other priorities. The best example is ORM itself in it's current shape: we all know that some classes should be moved into SPI or Impl, but we can't touch them. If your goal is to publish a nice set of javadocs for users which has API only, annotations would allow to do this. Sanne On 18 August 2014 08:14, Gunnar Morling wrote: > Hi Steve, > > Thanks for writing up these rules. That's very valuable information for > users and us as well. > > Only two remarks on the following: > >> The use of package names for this is unfortunately not granular enough > oftentimes. >> Ultimately I would envision a better solution (annotations?) > > In which cases is it not granular enough? Can such case not always be > circumvented by refactoring code into separate classes within separate > packages? > > I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. > internal parts on a finer level than the package, as that's what OSGi but > also JBoss Modules rely on. We cannot fully leverage the ability of these > module systems to "hide" internal parts of a module in that case. > > Also I think annotations are easier to "miss" than package names when > importing classes into an application, thus I'm concerned about accidental > referencing internal classes. > >> SPI contracts should be considered stable within a release family, not > necessarily across different release families. > > A specific example, similar to the API section, would be nice, e.g.: "If > you implement an application against an integration point from Hibernate > ORM 4.3.0, the expectation is that it works without changes when updating > to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x in > the very most cases, but that's not guaranteed." > > --Gunnar > > > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : > >> There was a discussion in regards to our view on backwards compatibility in >> reference to HHH-9316. I realized that we talk about this amongst >> ourselves, but that I have never written these down. So I did that: >> >> >> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >> >> This is a first draft. Let me know what you think. >> _______________________________________________ >> 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 Mon Aug 18 08:13:59 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Mon, 18 Aug 2014 14:13:59 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: 2014-08-18 13:12 GMT+02:00 Sanne Grinovero : > I won't speak for Steve's reasons, but I agree with the granularity > problem. > > For example you might not want to refactor the code to promote an SPI > to API (or simply fix a mistake), or viceversa demote an API to SPI, > as you moving the packages around would break backwards compatibility. > Yes, it's not so much about mixing API/SPI types in one package (maybe there is even an overlap in some cases) but it's public (i.e. API + SPI) vs. internal parts which I don't think should be in one package. > Essentially this means you can only fix the packages in that short > time in which you're in Alpha/Beta phase for a new major release, > which is a short period in which usually the team has other > priorities. But shouldn't you really know about that nature of an exposed type after a Beta phase? There is still the possibility to mark API/SPI members as incubating (we have an annotation @Experimental for this in OGM, not sure about others) if it's something still evolving. And the document reserves the right to fix "errors" anyways. > > The best example is ORM itself in it's current shape: we all know that > some classes should be moved into SPI or Impl, but we can't touch > them. > Agreed on SPI (see above), but is there really a problem with moving an accidentally exposed type to an "impl" package? It has not been designed to be accessed publicly, so ideally there should be no public users anyways. But if there are and we want to avoid breaking them, then it's actually a public contract by its nature and it should be maintained, no? To me, something is either public (then we need to keep compatibility in mind when changing it) or its internal (then we can change it as we like), but I don't think there is something in between. Having an internal type which we cannot touch seems like a paradox to me. If your goal is to publish a nice set of javadocs for users which has > API only, annotations would allow to do this. > It's more the public vs. private API distinction of e.g. OSGi I have in mind and its way for making sure only public parts are ever consumed by clients. Sanne > > > On 18 August 2014 08:14, Gunnar Morling wrote: > > Hi Steve, > > > > Thanks for writing up these rules. That's very valuable information for > > users and us as well. > > > > Only two remarks on the following: > > > >> The use of package names for this is unfortunately not granular enough > > oftentimes. > >> Ultimately I would envision a better solution (annotations?) > > > > In which cases is it not granular enough? Can such case not always be > > circumvented by refactoring code into separate classes within separate > > packages? > > > > I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. > > internal parts on a finer level than the package, as that's what OSGi but > > also JBoss Modules rely on. We cannot fully leverage the ability of these > > module systems to "hide" internal parts of a module in that case. > > > > Also I think annotations are easier to "miss" than package names when > > importing classes into an application, thus I'm concerned about > accidental > > referencing internal classes. > > > >> SPI contracts should be considered stable within a release family, not > > necessarily across different release families. > > > > A specific example, similar to the API section, would be nice, e.g.: "If > > you implement an application against an integration point from Hibernate > > ORM 4.3.0, the expectation is that it works without changes when updating > > to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x > in > > the very most cases, but that's not guaranteed." > > > > --Gunnar > > > > > > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : > > > >> There was a discussion in regards to our view on backwards > compatibility in > >> reference to HHH-9316. I realized that we talk about this amongst > >> ourselves, but that I have never written these down. So I did that: > >> > >> > >> > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > >> > >> This is a first draft. Let me know what you think. > >> _______________________________________________ > >> 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 Mon Aug 18 08:28:04 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Mon, 18 Aug 2014 13:28:04 +0100 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: in an ideal world, absolutely, and I didn't mean that annotations should be a replacement for correct package choices. Having the "right" annotations mature over time might also be a great help to define how to exactly move things when you're allowed to break things. Just that reality has proven that we need more flexibility, especially in things like ORM were the community is extremely large, from tooling, IDE support and even most Java profilers nowadays have special support for Hibernate, and will probably do "special things" beyond API. I'd guess that any fix in ORM makes some stuff break somewhere in the world, so anything which can help us redefine and adjust these boundaries without moving packages is welcome. Cheers, Sanne On 18 August 2014 13:13, Gunnar Morling wrote: > 2014-08-18 13:12 GMT+02:00 Sanne Grinovero : > >> I won't speak for Steve's reasons, but I agree with the granularity >> problem. >> >> For example you might not want to refactor the code to promote an SPI >> to API (or simply fix a mistake), or viceversa demote an API to SPI, >> as you moving the packages around would break backwards compatibility. > > > Yes, it's not so much about mixing API/SPI types in one package (maybe there > is even an overlap in some cases) but it's public (i.e. API + SPI) vs. > internal parts which I don't think should be in one package. > >> >> Essentially this means you can only fix the packages in that short >> time in which you're in Alpha/Beta phase for a new major release, >> which is a short period in which usually the team has other >> priorities. > > > But shouldn't you really know about that nature of an exposed type after a > Beta phase? There is still the possibility to mark API/SPI members as > incubating (we have an annotation @Experimental for this in OGM, not sure > about others) if it's something still evolving. And the document reserves > the right to fix "errors" anyways. >> >> >> The best example is ORM itself in it's current shape: we all know that >> some classes should be moved into SPI or Impl, but we can't touch >> them. > > > Agreed on SPI (see above), but is there really a problem with moving an > accidentally exposed type to an "impl" package? It has not been designed to > be accessed publicly, so ideally there should be no public users anyways. > But if there are and we want to avoid breaking them, then it's actually a > public contract by its nature and it should be maintained, no? > > To me, something is either public (then we need to keep compatibility in > mind when changing it) or its internal (then we can change it as we like), > but I don't think there is something in between. Having an internal type > which we cannot touch seems like a paradox to me. > >> If your goal is to publish a nice set of javadocs for users which has >> API only, annotations would allow to do this. > > > It's more the public vs. private API distinction of e.g. OSGi I have in mind > and its way for making sure only public parts are ever consumed by clients. > >> Sanne >> >> >> On 18 August 2014 08:14, Gunnar Morling wrote: >> > Hi Steve, >> > >> > Thanks for writing up these rules. That's very valuable information for >> > users and us as well. >> > >> > Only two remarks on the following: >> > >> >> The use of package names for this is unfortunately not granular enough >> > oftentimes. >> >> Ultimately I would envision a better solution (annotations?) >> > >> > In which cases is it not granular enough? Can such case not always be >> > circumvented by refactoring code into separate classes within separate >> > packages? >> > >> > I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. >> > internal parts on a finer level than the package, as that's what OSGi >> > but >> > also JBoss Modules rely on. We cannot fully leverage the ability of >> > these >> > module systems to "hide" internal parts of a module in that case. >> > >> > Also I think annotations are easier to "miss" than package names when >> > importing classes into an application, thus I'm concerned about >> > accidental >> > referencing internal classes. >> > >> >> SPI contracts should be considered stable within a release family, not >> > necessarily across different release families. >> > >> > A specific example, similar to the API section, would be nice, e.g.: "If >> > you implement an application against an integration point from Hibernate >> > ORM 4.3.0, the expectation is that it works without changes when >> > updating >> > to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x >> > in >> > the very most cases, but that's not guaranteed." >> > >> > --Gunnar >> > >> > >> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >> > >> >> There was a discussion in regards to our view on backwards >> >> compatibility in >> >> reference to HHH-9316. I realized that we talk about this amongst >> >> ourselves, but that I have never written these down. So I did that: >> >> >> >> >> >> >> >> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >> >> >> >> This is a first draft. Let me know what you think. >> >> _______________________________________________ >> >> 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 rob at zcore.org Tue Aug 19 05:46:01 2014 From: rob at zcore.org (Robert Heine) Date: Tue, 19 Aug 2014 11:46:01 +0200 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? Message-ID: <53F31CD9.1050802@zcore.org> Hi, the missing logfile is now attached to the issue listed below, the direct link is: https://issues.jboss.org/secure/attachment/12384220/server-org-jboss-as-jpa.log Regards, Rob On Thu, Aug 14, 2014 at 11:28 AM, Scott Marlow wrote: > > On 08/14/2014 11:59 AM, Steve Ebersole wrote: > >> Well it *should* mean that the EM in question was created outside the >> scope of a transaction. The JPA spec says that in cases of an >> application-managed PC where the EM is created outside the scope of the >> JTA txn, the provider should not automatically join the EM to any JTA >> txn later implicitly. Instead the expectation is for the application to >> explicitly join the EM to the transaction via the EM.joinTransaction >> method: >> >> >> When a JTA application-managed entity manager is used, if the entity >> manager is created outside the >> scope of the current JTA transaction, it is the responsibility of the >> application to join the entity manager >> to the transaction (if desired) by calling >> EntityManager.joinTransaction. If the entity man- >> ager is created outside the scope of a JTA transaction, it is not joined >> to the transaction unless Entity- >> Manager.joinTransaction is called. >> >> >> Note this behavior was made somewhat controllable in JPA 2.1 with the >> introduction of SynchronizationType. >> >> I'd have to refresh my memory on the expectation here wrt >> container-managed PCs. So that would be my first question to you of the >> situation... Is this a app or container managed PC? >> >> It is odd that they see a "local database transaction" instead though. >> You sure this isn't a series of auto-commit transactions? >> > > I won't be sure until they enable TRACE logging for org.jboss.as.jpa and > give us more logs. I'm waiting for that. > > >> >> >> >> On Thu, Aug 14, 2014 at 10:23 AM, Scott Marlow > > wrote: >> >> I'm trying to help a user [1] that is complaining that a local >> database >> transaction is used, instead of the JTA transaction as they expect. I >> asked them to enable TRACE logging for { org.jboss.jca, org.hibernate, >> org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync >> registration due to auto join checking" log message. >> >> What does the "skipping JTA sync registration due to auto join >> checking" >> mean exactly? [2] shows a small example of the log output with an >> active JTA transaction in use. >> >> Scott >> >> >> [1] https://issues.jboss.org/browse/WFLY-3619 XA END / un-enlist for >> database connection called to early >> >> [2] http://fpaste.org/125603/80296401/ >> _______________________________________________ >> From deepak.raut77 at gmail.com Tue Aug 19 06:50:24 2014 From: deepak.raut77 at gmail.com (deepak raut) Date: Tue, 19 Aug 2014 16:20:24 +0530 Subject: [hibernate-dev] Unexpected behavior for @PrePersist/@PreUpdate callback when using EntityManager#merge() on transient object Message-ID: I have an entity class like - public class Item { @Id //mapping private Long id; @ElementCollection //mapping private Set wrapperSet; @Transient private Map itemPredecessor; .......... .......... @PrePersist @PreUpdate private void populateSet() { wrapperSet.clear(); for(Map.Entry entry : itemPredecessor.entrySet()) { wrapperSet.add(...); } } .............. } What happens is when I call entityManager.merge(...) with newly instantiated object with itemPredecessor map having some entries in it. Hibernate invokes callback method populateSet() with copy of instance passed to merge() which doesn't contain itemPredecessor map with respective entries as itemPredecessor is marked @Transient. I am using hibernate 4.3.5. Is this the right behavior? -- Regards, Deepak A. Raut From deepak.raut77 at gmail.com Tue Aug 19 07:11:00 2014 From: deepak.raut77 at gmail.com (deepak raut) Date: Tue, 19 Aug 2014 16:41:00 +0530 Subject: [hibernate-dev] Unexpected behavior for @PrePersist/@PreUpdate callback when using EntityManager#merge() on transient object In-Reply-To: References: Message-ID: Forgot to mention :- in case of calling persist(), hibernate doesn't invoke callback method with copy object but the actual object passed to persist(); so for persist() it works correctly. On Tue, Aug 19, 2014 at 4:20 PM, deepak raut wrote: > I have an entity class like - > > public class Item { > @Id > //mapping > private Long id; > > @ElementCollection > //mapping > private Set wrapperSet; > > @Transient > private Map itemPredecessor; > > .......... > .......... > > @PrePersist > @PreUpdate > private void populateSet() { > wrapperSet.clear(); > for(Map.Entry entry : itemPredecessor.entrySet()) { > wrapperSet.add(...); > } > > } > .............. > } > > What happens is when I call entityManager.merge(...) with newly > instantiated object with itemPredecessor map having some entries in it. > Hibernate invokes callback method populateSet() with copy of instance > passed to merge() which doesn't contain itemPredecessor map with respective > entries as itemPredecessor is marked @Transient. I am using hibernate > 4.3.5. Is this the right behavior? > > -- > Regards, > Deepak A. Raut > -- Regards, Deepak A. Raut From m.schipperheyn at gmail.com Tue Aug 19 08:07:18 2014 From: m.schipperheyn at gmail.com (Marc Schipperheyn) Date: Tue, 19 Aug 2014 09:07:18 -0300 Subject: [hibernate-dev] HSearch 5.0 Message-ID: Hi, Is there any tentative idea on Hibernate Search 5.0 will come out? It just feels like progress is extremely slow and when I look at JIRA I keep seeing issues being added and fixed that seem extremely contextual (WildFly, improve errorHandler, etc) and nothing to do with the ambition to deliver the cool new features of Lucene 4 to the masses. I mean, I'm extremely anxious to work with Lucene 4 like forever, because it brings so much to the table and it will be great to have that power at your fingertips, but of course, it would be even greater if that power is brought to the Hibernate Search API. Cheers, Marc From smarlow at redhat.com Tue Aug 19 09:07:10 2014 From: smarlow at redhat.com (Scott Marlow) Date: Tue, 19 Aug 2014 09:07:10 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F31CD9.1050802@zcore.org> References: <53F31CD9.1050802@zcore.org> Message-ID: <53F34BFE.8030904@redhat.com> Hi Rob, The new logfile is missing TRACE logging for the other categories. Please attach a new log with TRACE enabled for: org.jboss.jca, org.hibernate, org.jboss.as.jpa, com.arjuna com.arjuna will show the transaction boundaries, org.jboss.jca will show connection pooling related information, org.jboss.as.jpa will us how the application requested the EE/JPA container to create the persistence context and of course, org.hibernate will show what is occurring in Hibernate ORM. Scott On 08/19/2014 05:46 AM, Robert Heine wrote: > Hi, > > the missing logfile is now attached to the issue listed below, the > direct link is: > > https://issues.jboss.org/secure/attachment/12384220/server-org-jboss-as-jpa.log > > Regards, > Rob > > On Thu, Aug 14, 2014 at 11:28 AM, Scott Marlow > wrote: > > > > > On 08/14/2014 11:59 AM, Steve Ebersole wrote: > > > >> Well it *should* mean that the EM in question was created outside the > >> scope of a transaction. The JPA spec says that in cases of an > >> application-managed PC where the EM is created outside the scope of the > >> JTA txn, the provider should not automatically join the EM to any JTA > >> txn later implicitly. Instead the expectation is for the application to > >> explicitly join the EM to the transaction via the EM.joinTransaction > >> method: > >> > >> > >> When a JTA application-managed entity manager is used, if the entity > >> manager is created outside the > >> scope of the current JTA transaction, it is the responsibility of the > >> application to join the entity manager > >> to the transaction (if desired) by calling > >> EntityManager.joinTransaction. If the entity man- > >> ager is created outside the scope of a JTA transaction, it is not joined > >> to the transaction unless Entity- > >> Manager.joinTransaction is called. > >> > >> > >> Note this behavior was made somewhat controllable in JPA 2.1 with the > >> introduction of SynchronizationType. > >> > >> I'd have to refresh my memory on the expectation here wrt > >> container-managed PCs. So that would be my first question to you of the > >> situation... Is this a app or container managed PC? > >> > >> It is odd that they see a "local database transaction" instead though. > >> You sure this isn't a series of auto-commit transactions? > >> > > > > I won't be sure until they enable TRACE logging for org.jboss.as.jpa and > > give us more logs. I'm waiting for that. > > > > > >> > >> > >> > >> On Thu, Aug 14, 2014 at 10:23 AM, Scott Marlow >> > wrote: > >> > >> I'm trying to help a user [1] that is complaining that a local > >> database > >> transaction is used, instead of the JTA transaction as they > expect. I > >> asked them to enable TRACE logging for { org.jboss.jca, > org.hibernate, > >> org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync > >> registration due to auto join checking" log message. > >> > >> What does the "skipping JTA sync registration due to auto join > >> checking" > >> mean exactly? [2] shows a small example of the log output with an > >> active JTA transaction in use. > >> > >> Scott > >> > >> > >> [1] https://issues.jboss.org/browse/WFLY-3619 XA END / un-enlist for > >> database connection called to early > >> > >> [2] http://fpaste.org/125603/80296401/ > >> _______________________________________________ > >> > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From emmanuel at hibernate.org Tue Aug 19 11:24:54 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Tue, 19 Aug 2014 17:24:54 +0200 Subject: [hibernate-dev] [NoORM] meeting Message-ID: <20140819152454.GB77678@hibernate.org> Mostly a status check and some kind of planning. Meeting ended Tue Aug 19 15:22:13 2014 UTC. Information about MeetBot at http://wiki.debian.org/MeetBot . (v 0.1.4) Minutes: http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2014/hibernate-dev.2014-08-19-14.00.html Minutes (text): http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2014/hibernate-dev.2014-08-19-14.00.txt Log: http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2014/hibernate-dev.2014-08-19-14.00.log.html From smarlow at redhat.com Tue Aug 19 21:40:46 2014 From: smarlow at redhat.com (Scott Marlow) Date: Tue, 19 Aug 2014 21:40:46 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F34BFE.8030904@redhat.com> References: <53F31CD9.1050802@zcore.org> <53F34BFE.8030904@redhat.com> Message-ID: <53F3FC9E.8070000@redhat.com> On 08/19/2014 09:07 AM, Scott Marlow wrote: > Hi Rob, > > The new logfile is missing TRACE logging for the other categories. > Please attach a new log with TRACE enabled for: org.jboss.jca, > org.hibernate, org.jboss.as.jpa, com.arjuna Just add the log file with the above categories, to the WFLY-3619 jira (not this email thread). > > com.arjuna will show the transaction boundaries, org.jboss.jca will show > connection pooling related information, org.jboss.as.jpa will us how the > application requested the EE/JPA container to create the persistence > context and of course, org.hibernate will show what is occurring in > Hibernate ORM. > > Scott From rob at zcore.org Wed Aug 20 05:37:51 2014 From: rob at zcore.org (Robert Heine) Date: Wed, 20 Aug 2014 11:37:51 +0200 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F3FC9E.8070000@redhat.com> References: <53F31CD9.1050802@zcore.org> <53F34BFE.8030904@redhat.com> <53F3FC9E.8070000@redhat.com> Message-ID: <53F46C6F.3060307@zcore.org> Hi Scott, I added the latest log with all required log levels to the jira ticket. Rob On 20.08.2014 03:40, Scott Marlow wrote: > On 08/19/2014 09:07 AM, Scott Marlow wrote: >> Hi Rob, >> >> The new logfile is missing TRACE logging for the other categories. >> Please attach a new log with TRACE enabled for: org.jboss.jca, >> org.hibernate, org.jboss.as.jpa, com.arjuna > > Just add the log file with the above categories, to the WFLY-3619 jira > (not this email thread). > >> >> com.arjuna will show the transaction boundaries, org.jboss.jca will show >> connection pooling related information, org.jboss.as.jpa will us how the >> application requested the EE/JPA container to create the persistence >> context and of course, org.hibernate will show what is occurring in >> Hibernate ORM. >> >> Scott > From sanne at hibernate.org Wed Aug 20 05:38:58 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 20 Aug 2014 10:38:58 +0100 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: Message-ID: Hi Marc, we've been slower than expected, apologies from my part as I've been distracted in fixing stuff in a project building on Hibernate Search; in a way that has been good for the project as we nailed some issues in Search, gives us valuable input on performance and validation under high load. Considering holidays & similar, we should be fully focused on Search again next week and first goal is of course to challenge the roadmap and see what can be cut to speedup a 5.0.0.Final release.. However many users are already using the current previews and I am expecting the same from you as you would give us precious feedback as usual ;-) We discussed the release timeframe yesterday during our fortnight IRC meeting; Emmanuel sent the logs to this same list in case you want to see the details (And feel free to join when you can). No date was mentioned, we need to spend a couple of days first to investigate what can be sensibly dropped. We're all agreeing that we should rather move some issues out from the plan and release early; having said that, which features of Lucene 4 would you love to see exposed on the API? I also expected many big changes but it turned out we could provide most of it as "under the hood" internal changes; unless I'm missing something the issues still open on JIRA are not expected to make a significant dent on our public API (that is, excluding some changes in defaults and meaning of annotations as discussed previously, but that's not Lucene4 specific). Please open issues about features we should expose, and feel free to suggest a priority. I'll probably defer anything which shouldn't block the 5.0, but it would be very helpful. Cheers, Sanne On 19 August 2014 13:07, Marc Schipperheyn wrote: > Hi, > > Is there any tentative idea on Hibernate Search 5.0 will come out? It just > feels like progress is extremely slow and when I look at JIRA I keep seeing > issues being added and fixed that seem extremely contextual (WildFly, > improve errorHandler, etc) and nothing to do with the ambition to deliver > the cool new features of Lucene 4 to the masses. I mean, I'm extremely > anxious to work with Lucene 4 like forever, because it brings so much to > the table and it will be great to have that power at your fingertips, but > of course, it would be even greater if that power is brought to the > Hibernate Search API. > > Cheers, > Marc > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Wed Aug 20 06:14:28 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 20 Aug 2014 11:14:28 +0100 Subject: [hibernate-dev] Survey about Licensing of hibernate-orm In-Reply-To: <20140820034229.79E033AC2B2@th101c-6.CS.WM.EDU> References: <20140820034229.79E033AC2B2@th101c-6.CS.WM.EDU> Message-ID: Hi Christopher, I'm sorry but I don't understand what you're asking, this project didn't change licenses. It might contain some classes copied from Apache2 projects, and some of its components use an ASL2 license (it's split in independent modules), but no part of Hibernate ORM changed license. At best it's possible that your tool found some human error case of some headers being misplaced and then fixed, but I'm not aware of such a case. Regards, Sanne On 20 August 2014 04:42, Christopher G Vendome wrote: > Hello, > > I'm a Ph.D. student conducting a study on Open Source projects hosted on GitHub with respect to licensing considerations. Specifically, we are interested in understanding the developer rationale for both picking and changing a license. We found your project: "hibernate-orm" experienced the following license change to its files: Apache:2->null:null LGPL:2.1+->null:null (if the change has a null:null value, it represents no license or an unknown license as determined Ninka - a state of the art license extraction tool. Also, patterns are split by a space). If you would be willing to answer a short survey of 6 questions, please respond to the survey below. The answers are strictly for research purposes that we plan to publish. We will keep responses private and if quoted, we will not directly link you to any responses in the publication. > > The survey link is: https://wmsurveys.qualtrics.com/SE/?SID=SV_0qQEhAEp08bKEZf > > We appreciate your time and thank you for your help understanding developer rationale with respect to software licensing. > > Regards, > Christopher Vendome > http://www.cs.wm.edu/~cvendome From smarlow at redhat.com Wed Aug 20 09:07:28 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 20 Aug 2014 09:07:28 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F46C6F.3060307@zcore.org> References: <53F31CD9.1050802@zcore.org> <53F34BFE.8030904@redhat.com> <53F3FC9E.8070000@redhat.com> <53F46C6F.3060307@zcore.org> Message-ID: <53F49D90.7000104@redhat.com> Hi Rob, I don't see the "com.microsoft.sqlserver.jdbc.SQLServerException: Das Timeout f?r Sperranforderung wurde ?berschritten" error in the logs. Did you get that when generating the latest log? Scott On 08/20/2014 05:37 AM, Robert Heine wrote: > Hi Scott, > > I added the latest log with all required log levels to the jira ticket. > > Rob > > On 20.08.2014 03:40, Scott Marlow wrote: >> On 08/19/2014 09:07 AM, Scott Marlow wrote: >>> Hi Rob, >>> >>> The new logfile is missing TRACE logging for the other categories. >>> Please attach a new log with TRACE enabled for: org.jboss.jca, >>> org.hibernate, org.jboss.as.jpa, com.arjuna >> >> Just add the log file with the above categories, to the WFLY-3619 jira >> (not this email thread). >> >>> >>> com.arjuna will show the transaction boundaries, org.jboss.jca will show >>> connection pooling related information, org.jboss.as.jpa will us how the >>> application requested the EE/JPA container to create the persistence >>> context and of course, org.hibernate will show what is occurring in >>> Hibernate ORM. >>> >>> Scott >> From rob at zcore.org Wed Aug 20 09:36:25 2014 From: rob at zcore.org (Robert Heine) Date: Wed, 20 Aug 2014 15:36:25 +0200 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F49D90.7000104@redhat.com> References: <53F31CD9.1050802@zcore.org> <53F34BFE.8030904@redhat.com> <53F3FC9E.8070000@redhat.com> <53F46C6F.3060307@zcore.org> <53F49D90.7000104@redhat.com> Message-ID: <53F4A459.2070307@zcore.org> Hi Scott, looks like the file got a immature , I reattached the full log again. Can you please remove the defective log to reduce confusion? :) Thanks Rob On 20.08.2014 15:07, Scott Marlow wrote: > Hi Rob, > > I don't see the "com.microsoft.sqlserver.jdbc.SQLServerException: Das > Timeout f?r Sperranforderung wurde ?berschritten" error in the logs. Did > you get that when generating the latest log? > > Scott > > On 08/20/2014 05:37 AM, Robert Heine wrote: >> Hi Scott, >> >> I added the latest log with all required log levels to the jira ticket. >> >> Rob >> >> On 20.08.2014 03:40, Scott Marlow wrote: >>> On 08/19/2014 09:07 AM, Scott Marlow wrote: >>>> Hi Rob, >>>> >>>> The new logfile is missing TRACE logging for the other categories. >>>> Please attach a new log with TRACE enabled for: org.jboss.jca, >>>> org.hibernate, org.jboss.as.jpa, com.arjuna >>> >>> Just add the log file with the above categories, to the WFLY-3619 jira >>> (not this email thread). >>> >>>> >>>> com.arjuna will show the transaction boundaries, org.jboss.jca will >>>> show >>>> connection pooling related information, org.jboss.as.jpa will us how >>>> the >>>> application requested the EE/JPA container to create the persistence >>>> context and of course, org.hibernate will show what is occurring in >>>> Hibernate ORM. >>>> >>>> Scott >>> > From m.schipperheyn at gmail.com Wed Aug 20 10:13:50 2014 From: m.schipperheyn at gmail.com (Marc Schipperheyn) Date: Wed, 20 Aug 2014 11:13:50 -0300 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: Message-ID: Hi Sanne, Thanks for that extensive reply. > Considering holidays & similar, we should be fully focused on Search > again next week and first goal is of course to challenge the roadmap > and see what can be cut to speedup a 5.0.0.Final release.. However > many users are already using the current previews and I am expecting > the same from you as you would give us precious feedback as usual ;-) > Yeah, I'd love that. However, I've been having some delays of my own and I will need to upgrade a bunch of related dependencies in order to move to 5.0 which is a project in itself. It's high on my list but the marketing people are also breathing down my neck for end user features. You know how it is. We're all agreeing that we should rather move some issues out from the > plan and release early; having said that, which features of Lucene 4 > would you love to see exposed on the API? > I personally really like the Grouping and QueryTimeJoin functionalities and am using them to great effect through the Lucene API. Also, I'm looking forward to implementing some of the new suggest / autocomplete analyzers, but that would prob not need any API changes. I think on the analyzer front, things look really interesting with 4.x. Other than that, just very interested in general to experience the numerous performance improvements that have been made. Cheers, Marc From smarlow at redhat.com Wed Aug 20 10:27:32 2014 From: smarlow at redhat.com (Scott Marlow) Date: Wed, 20 Aug 2014 10:27:32 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F4A459.2070307@zcore.org> References: <53F31CD9.1050802@zcore.org> <53F34BFE.8030904@redhat.com> <53F3FC9E.8070000@redhat.com> <53F46C6F.3060307@zcore.org> <53F49D90.7000104@redhat.com> <53F4A459.2070307@zcore.org> Message-ID: <53F4B054.4010506@redhat.com> Looks like we are creating a (container managed) transaction scoped entity manager (persistence context) inside the JTA transaction and we get the "Skipping JTA sync registration due to auto join checking" message logged quite a bit but no failures seem to be related to that. What are your persistence.xml settings? With regard to the jira, I'll respond there about the transaction timeout error that your getting (this thread is more for answering my question about the above "Skipping JTA sync registration" message.) On 08/20/2014 09:36 AM, Robert Heine wrote: > Hi Scott, > > looks like the file got a immature , I reattached the full log again. > > Can you please remove the defective log to reduce confusion? :) > > Thanks > Rob > > On 20.08.2014 15:07, Scott Marlow wrote: >> Hi Rob, >> >> I don't see the "com.microsoft.sqlserver.jdbc.SQLServerException: Das >> Timeout f?r Sperranforderung wurde ?berschritten" error in the logs. Did >> you get that when generating the latest log? >> >> Scott >> >> On 08/20/2014 05:37 AM, Robert Heine wrote: >>> Hi Scott, >>> >>> I added the latest log with all required log levels to the jira ticket. >>> >>> Rob >>> >>> On 20.08.2014 03:40, Scott Marlow wrote: >>>> On 08/19/2014 09:07 AM, Scott Marlow wrote: >>>>> Hi Rob, >>>>> >>>>> The new logfile is missing TRACE logging for the other categories. >>>>> Please attach a new log with TRACE enabled for: org.jboss.jca, >>>>> org.hibernate, org.jboss.as.jpa, com.arjuna >>>> >>>> Just add the log file with the above categories, to the WFLY-3619 jira >>>> (not this email thread). >>>> >>>>> >>>>> com.arjuna will show the transaction boundaries, org.jboss.jca will >>>>> show >>>>> connection pooling related information, org.jboss.as.jpa will us how >>>>> the >>>>> application requested the EE/JPA container to create the persistence >>>>> context and of course, org.hibernate will show what is occurring in >>>>> Hibernate ORM. >>>>> >>>>> Scott >>>> >> From jholusa at redhat.com Wed Aug 20 10:28:05 2014 From: jholusa at redhat.com (Jiri Holusa) Date: Wed, 20 Aug 2014 10:28:05 -0400 (EDT) Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> Message-ID: <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> Hi everybody, I'm Jirka Holusa and I work JDG QA (Infinispan) team, just for you to know, this email has nothing to do with JDG :) Currently, I looking for a nice topic for a diploma thesis and I came across one. I worked with Elasticsearch in my bachelor thesis and I thought it would be nice to integrate it with Hibernate. So I found Hibernate OGM and thought thaht I would like to develop the Elasticsearch module for Hibernate OGM. I talked to Emmanuel and Sanne and they pretty liked the idea, so they suggested to move the discussion here on dev list. I would love to read all your suggestions/proposals/tip etc. The rough plan is to first implement the JPA API (therefor CRUD operations) and once this is finished, implement search capabilities via Hibernate Search API. I looking forward to your replies. Cheers, Jirka From rob at zcore.org Wed Aug 20 10:39:41 2014 From: rob at zcore.org (Robert Heine) Date: Wed, 20 Aug 2014 16:39:41 +0200 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: <53F4B054.4010506@redhat.com> References: <53F31CD9.1050802@zcore.org> <53F34BFE.8030904@redhat.com> <53F3FC9E.8070000@redhat.com> <53F46C6F.3060307@zcore.org> <53F49D90.7000104@redhat.com> <53F4A459.2070307@zcore.org> <53F4B054.4010506@redhat.com> Message-ID: <53F4B32D.9010900@zcore.org> Hi again, I uploaded persistence.xml to the jira ticket. Regards, Rob On 20.08.2014 16:27, Scott Marlow wrote: > Looks like we are creating a (container managed) transaction scoped > entity manager (persistence context) inside the JTA transaction and we > get the "Skipping JTA sync registration due to auto join checking" > message logged quite a bit but no failures seem to be related to that. > What are your persistence.xml settings? > > With regard to the jira, I'll respond there about the transaction > timeout error that your getting (this thread is more for answering my > question about the above "Skipping JTA sync registration" message.) > > On 08/20/2014 09:36 AM, Robert Heine wrote: >> Hi Scott, >> >> looks like the file got a immature , I reattached the full log >> again. >> >> Can you please remove the defective log to reduce confusion? :) >> >> Thanks >> Rob >> >> On 20.08.2014 15:07, Scott Marlow wrote: >>> Hi Rob, >>> >>> I don't see the "com.microsoft.sqlserver.jdbc.SQLServerException: Das >>> Timeout f?r Sperranforderung wurde ?berschritten" error in the logs. Did >>> you get that when generating the latest log? >>> >>> Scott >>> >>> On 08/20/2014 05:37 AM, Robert Heine wrote: >>>> Hi Scott, >>>> >>>> I added the latest log with all required log levels to the jira ticket. >>>> >>>> Rob >>>> >>>> On 20.08.2014 03:40, Scott Marlow wrote: >>>>> On 08/19/2014 09:07 AM, Scott Marlow wrote: >>>>>> Hi Rob, >>>>>> >>>>>> The new logfile is missing TRACE logging for the other categories. >>>>>> Please attach a new log with TRACE enabled for: org.jboss.jca, >>>>>> org.hibernate, org.jboss.as.jpa, com.arjuna >>>>> >>>>> Just add the log file with the above categories, to the WFLY-3619 jira >>>>> (not this email thread). >>>>> >>>>>> >>>>>> com.arjuna will show the transaction boundaries, org.jboss.jca will >>>>>> show >>>>>> connection pooling related information, org.jboss.as.jpa will us how >>>>>> the >>>>>> application requested the EE/JPA container to create the persistence >>>>>> context and of course, org.hibernate will show what is occurring in >>>>>> Hibernate ORM. >>>>>> >>>>>> Scott >>>>> >>> > From paranoiabla at gmail.com Wed Aug 20 12:36:54 2014 From: paranoiabla at gmail.com (Petar Tahchiev) Date: Wed, 20 Aug 2014 19:36:54 +0300 Subject: [hibernate-dev] JCS Hibernate Region Factory Message-ID: Hi guys, I would really like to give apache commons jcs a spin (the FAQ says performancewise it's faster than EHCache) but I don't really know what to set this property to: hibernate.cache.region.factory_class With EHCache and Hibernate 4 I have it set as following: hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory.class.getCanonicalName() Any plans to make a region factory for JCS? The guys from jcs team are pushing for a 2.0 release any minute soon so it might be a good idea to test now and if you have some suggestions you could ask them to include it in the 2.0 release. -- Regards, Petar! Karlovo, Bulgaria. --- Public PGP Key at: https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 From guillaume.smet at gmail.com Wed Aug 20 12:56:37 2014 From: guillaume.smet at gmail.com (Guillaume Smet) Date: Wed, 20 Aug 2014 18:56:37 +0200 Subject: [hibernate-dev] JCS Hibernate Region Factory In-Reply-To: References: Message-ID: Hi Petar, On Wed, Aug 20, 2014 at 6:36 PM, Petar Tahchiev wrote: > I would really like to give apache commons jcs a spin (the FAQ says > performancewise it's faster than EHCache) I don't know JCS but I find it funny they criticize the fact that Ehcache published an old benchmark and that they still have a very old one in their FAQ. It might be interesting to have more recent performance information comparing the latest versions of both before deciding if it's really worth it. -- Guillaume From alex.snaps at gmail.com Wed Aug 20 13:14:33 2014 From: alex.snaps at gmail.com (Alex Snaps) Date: Wed, 20 Aug 2014 13:14:33 -0400 Subject: [hibernate-dev] JCS Hibernate Region Factory In-Reply-To: References: Message-ID: I'll try avoiding a flame war here... especially as I'm a Terracotta employee and working on Ehcache. That being said, the FAQ says: "I just built both EHCache (1.2-beta4) and JCS (1.2.7.0) from head, (...)", where 1.3.0 was released over 7 years ago, I guess "just" has relative semantics here. Latest stable JCS release is 5 years old now too, so whether you still manage to find the Ehcache perf results, or are reading the ones on the JCS website... there are, how would I best put it, ... utterly out of date. On a side note, if the 2.0 release will be 107 compliant, I have a JSR-107 caching provider more or less done (missing a couple of things for the read-write strategy around collections), but I'd love to test with that too then (not necessarily perf only though here). Anyways, random biased thoughts :) Alex On Wed, Aug 20, 2014 at 12:56 PM, Guillaume Smet wrote: > Hi Petar, > > On Wed, Aug 20, 2014 at 6:36 PM, Petar Tahchiev > wrote: > > I would really like to give apache commons jcs a spin (the FAQ says > > performancewise it's faster than EHCache) > > I don't know JCS but I find it funny they criticize the fact that > Ehcache published an old benchmark and that they still have a very old > one in their FAQ. > > It might be interesting to have more recent performance information > comparing the latest versions of both before deciding if it's really > worth it. > > -- > Guillaume > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > -- Alex Snaps Principal Software Engineer - Terracotta http://twitter.com/alexsnaps http://about.me/alexsnaps http://www.devoxx4kids.org/quebec/ From paranoiabla at gmail.com Wed Aug 20 13:18:39 2014 From: paranoiabla at gmail.com (Petar Tahchiev) Date: Wed, 20 Aug 2014 20:18:39 +0300 Subject: [hibernate-dev] JCS Hibernate Region Factory In-Reply-To: References: Message-ID: Hi all, seems like the documentation on the website is too old. So we can ignore the performance bit. But still, it would be nice to provide a region factory, so the end-client has the choice whichever they like. @Alex: There's a 2.0-SNAPSHOT here: https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-jcs/ and yes, seems like it is JCache complient. 2014-08-20 20:14 GMT+03:00 Alex Snaps : > I'll try avoiding a flame war here... especially as I'm a Terracotta > employee and working on Ehcache. > That being said, the FAQ says: > "I just built both EHCache (1.2-beta4) and JCS (1.2.7.0) from head, > (...)", where 1.3.0 was released over 7 years ago, I guess "just" has > relative semantics here. > Latest stable JCS release is 5 years old now too, so whether you still > manage to find the Ehcache perf results, or are reading the ones on the JCS > website... there are, how would I best put it, ... utterly out of date. > > On a side note, if the 2.0 release will be 107 compliant, I have a JSR-107 > caching provider more or less done (missing a couple of things for the > read-write strategy around collections), but I'd love to test with that too > then (not necessarily perf only though here). > > Anyways, random biased thoughts :) > Alex > > > On Wed, Aug 20, 2014 at 12:56 PM, Guillaume Smet > wrote: > >> Hi Petar, >> >> On Wed, Aug 20, 2014 at 6:36 PM, Petar Tahchiev >> wrote: >> > I would really like to give apache commons jcs a spin (the FAQ says >> > performancewise it's faster than EHCache) >> >> I don't know JCS but I find it funny they criticize the fact that >> Ehcache published an old benchmark and that they still have a very old >> one in their FAQ. >> >> It might be interesting to have more recent performance information >> comparing the latest versions of both before deciding if it's really >> worth it. >> >> -- >> Guillaume >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev >> > > > > -- > Alex Snaps > Principal Software Engineer - Terracotta > http://twitter.com/alexsnaps > http://about.me/alexsnaps > http://www.devoxx4kids.org/quebec/ > -- Regards, Petar! Karlovo, Bulgaria. --- Public PGP Key at: https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 From alex.snaps at gmail.com Wed Aug 20 13:23:21 2014 From: alex.snaps at gmail.com (Alex Snaps) Date: Wed, 20 Aug 2014 13:23:21 -0400 Subject: [hibernate-dev] JCS Hibernate Region Factory In-Reply-To: References: Message-ID: Petar, thanks, I'll have a look at it! I'll try to clear up some time this week (no promise here though! But if you'd like to help...) to finally finish this jsr107 provider for h2lc and try to test it against the JCS impl. then. That would let you use JCS with Hibernate. If you want a "native" JCS provider though, there'd be more code to write though... Alex On Wed, Aug 20, 2014 at 1:18 PM, Petar Tahchiev wrote: > Hi all, > > seems like the documentation on the website is too old. So we can ignore > the performance bit. But still, it would be nice to provide a region > factory, so the end-client has the choice whichever they like. > > @Alex: There's a 2.0-SNAPSHOT here: > https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-jcs/ > and yes, seems like it is JCache complient. > > > 2014-08-20 20:14 GMT+03:00 Alex Snaps : > > I'll try avoiding a flame war here... especially as I'm a Terracotta >> employee and working on Ehcache. >> That being said, the FAQ says: >> "I just built both EHCache (1.2-beta4) and JCS (1.2.7.0) from head, >> (...)", where 1.3.0 was released over 7 years ago, I guess "just" has >> relative semantics here. >> Latest stable JCS release is 5 years old now too, so whether you still >> manage to find the Ehcache perf results, or are reading the ones on the JCS >> website... there are, how would I best put it, ... utterly out of date. >> >> On a side note, if the 2.0 release will be 107 compliant, I have a >> JSR-107 caching provider more or less done (missing a couple of things for >> the read-write strategy around collections), but I'd love to test with that >> too then (not necessarily perf only though here). >> >> Anyways, random biased thoughts :) >> Alex >> >> >> On Wed, Aug 20, 2014 at 12:56 PM, Guillaume Smet < >> guillaume.smet at gmail.com> wrote: >> >>> Hi Petar, >>> >>> On Wed, Aug 20, 2014 at 6:36 PM, Petar Tahchiev >>> wrote: >>> > I would really like to give apache commons jcs a spin (the FAQ says >>> > performancewise it's faster than EHCache) >>> >>> I don't know JCS but I find it funny they criticize the fact that >>> Ehcache published an old benchmark and that they still have a very old >>> one in their FAQ. >>> >>> It might be interesting to have more recent performance information >>> comparing the latest versions of both before deciding if it's really >>> worth it. >>> >>> -- >>> Guillaume >>> _______________________________________________ >>> hibernate-dev mailing list >>> hibernate-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev >>> >> >> >> >> -- >> Alex Snaps >> Principal Software Engineer - Terracotta >> http://twitter.com/alexsnaps >> http://about.me/alexsnaps >> http://www.devoxx4kids.org/quebec/ >> > > > > -- > Regards, Petar! > Karlovo, Bulgaria. > --- > Public PGP Key at: > https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 > Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 > -- Alex Snaps Principal Software Engineer - Terracotta http://twitter.com/alexsnaps http://about.me/alexsnaps http://www.devoxx4kids.org/quebec/ From paranoiabla at gmail.com Wed Aug 20 14:26:41 2014 From: paranoiabla at gmail.com (Petar Tahchiev) Date: Wed, 20 Aug 2014 21:26:41 +0300 Subject: [hibernate-dev] JCS Hibernate Region Factory In-Reply-To: References: Message-ID: Hi Alex, sure - keep me in the loop when you have the jsr107 provider ready and i'll give it and jcs a try. Cheers 2014-08-20 20:23 GMT+03:00 Alex Snaps : > Petar, thanks, I'll have a look at it! > I'll try to clear up some time this week (no promise here though! But if > you'd like to help...) to finally finish this jsr107 provider for h2lc and > try to test it against the JCS impl. then. > That would let you use JCS with Hibernate. If you want a "native" JCS > provider though, there'd be more code to write though... > Alex > > > On Wed, Aug 20, 2014 at 1:18 PM, Petar Tahchiev > wrote: > >> Hi all, >> >> seems like the documentation on the website is too old. So we can ignore >> the performance bit. But still, it would be nice to provide a region >> factory, so the end-client has the choice whichever they like. >> >> @Alex: There's a 2.0-SNAPSHOT here: >> https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-jcs/ >> and yes, seems like it is JCache complient. >> >> >> 2014-08-20 20:14 GMT+03:00 Alex Snaps : >> >> I'll try avoiding a flame war here... especially as I'm a Terracotta >>> employee and working on Ehcache. >>> That being said, the FAQ says: >>> "I just built both EHCache (1.2-beta4) and JCS (1.2.7.0) from head, >>> (...)", where 1.3.0 was released over 7 years ago, I guess "just" has >>> relative semantics here. >>> Latest stable JCS release is 5 years old now too, so whether you still >>> manage to find the Ehcache perf results, or are reading the ones on the JCS >>> website... there are, how would I best put it, ... utterly out of date. >>> >>> On a side note, if the 2.0 release will be 107 compliant, I have a >>> JSR-107 caching provider more or less done (missing a couple of things for >>> the read-write strategy around collections), but I'd love to test with that >>> too then (not necessarily perf only though here). >>> >>> Anyways, random biased thoughts :) >>> Alex >>> >>> >>> On Wed, Aug 20, 2014 at 12:56 PM, Guillaume Smet < >>> guillaume.smet at gmail.com> wrote: >>> >>>> Hi Petar, >>>> >>>> On Wed, Aug 20, 2014 at 6:36 PM, Petar Tahchiev >>>> wrote: >>>> > I would really like to give apache commons jcs a spin (the FAQ says >>>> > performancewise it's faster than EHCache) >>>> >>>> I don't know JCS but I find it funny they criticize the fact that >>>> Ehcache published an old benchmark and that they still have a very old >>>> one in their FAQ. >>>> >>>> It might be interesting to have more recent performance information >>>> comparing the latest versions of both before deciding if it's really >>>> worth it. >>>> >>>> -- >>>> Guillaume >>>> _______________________________________________ >>>> hibernate-dev mailing list >>>> hibernate-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev >>>> >>> >>> >>> >>> -- >>> Alex Snaps >>> Principal Software Engineer - Terracotta >>> http://twitter.com/alexsnaps >>> http://about.me/alexsnaps >>> http://www.devoxx4kids.org/quebec/ >>> >> >> >> >> -- >> Regards, Petar! >> Karlovo, Bulgaria. >> --- >> Public PGP Key at: >> https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 >> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 >> > > > > -- > Alex Snaps > Principal Software Engineer - Terracotta > http://twitter.com/alexsnaps > http://about.me/alexsnaps > http://www.devoxx4kids.org/quebec/ > -- Regards, Petar! Karlovo, Bulgaria. --- Public PGP Key at: https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 From gbadner at redhat.com Wed Aug 20 17:16:20 2014 From: gbadner at redhat.com (Gail Badner) Date: Wed, 20 Aug 2014 17:16:20 -0400 (EDT) Subject: [hibernate-dev] Unexpected behavior for @PrePersist/@PreUpdate callback when using EntityManager#merge() on transient object In-Reply-To: References: Message-ID: <374040523.42249260.1408569380507.JavaMail.zimbra@redhat.com> Hi Deepak, Please use the user forum (https://forum.hibernate.org/) to discuss your particular case. If after refining your description of the issue you believe it is a bug, then create a Jira issue. Thanks, Gail ----- Original Message ----- > From: "deepak raut" > To: hibernate-dev at lists.jboss.org > Sent: Tuesday, August 19, 2014 4:11:00 AM > Subject: Re: [hibernate-dev] Unexpected behavior for @PrePersist/@PreUpdate callback when using EntityManager#merge() > on transient object > > Forgot to mention :- > in case of calling persist(), hibernate doesn't invoke callback method with > copy object but the actual object passed to persist(); so for persist() it > works correctly. > > > On Tue, Aug 19, 2014 at 4:20 PM, deepak raut > wrote: > > > I have an entity class like - > > > > public class Item { > > @Id > > //mapping > > private Long id; > > > > @ElementCollection > > //mapping > > private Set wrapperSet; > > > > @Transient > > private Map itemPredecessor; > > > > .......... > > .......... > > > > @PrePersist > > @PreUpdate > > private void populateSet() { > > wrapperSet.clear(); > > for(Map.Entry entry : itemPredecessor.entrySet()) { > > wrapperSet.add(...); > > } > > > > } > > .............. > > } > > > > What happens is when I call entityManager.merge(...) with newly > > instantiated object with itemPredecessor map having some entries in it. > > Hibernate invokes callback method populateSet() with copy of instance > > passed to merge() which doesn't contain itemPredecessor map with respective > > entries as itemPredecessor is marked @Transient. I am using hibernate > > 4.3.5. Is this the right behavior? > > > > -- > > Regards, > > Deepak A. Raut > > > > > > -- > Regards, > Deepak A. Raut > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From guillaume.smet at gmail.com Wed Aug 20 18:30:44 2014 From: guillaume.smet at gmail.com (Guillaume Smet) Date: Thu, 21 Aug 2014 00:30:44 +0200 Subject: [hibernate-dev] Search - HSEARCH-1580 - Dependency graph In-Reply-To: References: <68C8A0F4-69D1-4C07-B8B7-147813F3EC51@hibernate.org> Message-ID: On Fri, Jul 25, 2014 at 9:59 PM, Guillaume Smet wrote: > Thanks for your feedback. I'll see what I can do next week about it. A little late to the party... but I finally pushed changes along those lines: https://github.com/hibernate/hibernate-search/pull/654 Not really sure the doc parts are OK but happy to fix them if not. Once an alpha version is released with this, we will be able to start testing Search 5 on our apps to see how it goes and provide (hopefully useful) feedback. -- Guillaume From gunnar at hibernate.org Thu Aug 21 02:55:49 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Thu, 21 Aug 2014 08:55:49 +0200 Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> References: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> Message-ID: Hi Jirka, Welcome and many thanks for your interest in contributing to our projects! 2014-08-20 16:28 GMT+02:00 Jiri Holusa : > Hi everybody, > > I'm Jirka Holusa and I work JDG QA (Infinispan) team, just for you to > know, this email has nothing to do with JDG :) > > Currently, I looking for a nice topic for a diploma thesis and I came > across one. I worked with Elasticsearch in my bachelor thesis and I thought > it would be nice to integrate it with Hibernate. > So I found Hibernate OGM and thought thaht I would like to develop the > Elasticsearch module for Hibernate OGM. I talked to Emmanuel and Sanne and > they pretty liked the idea, so they suggested to move the discussion here > on dev list. > +1 So for implementing support for a new datastore in OGM, you'd have to implement the GridDialect contract basically. This is a very generic contract which is responsible for persisting (and reading) tuples (representing entities) as well as associations. In addition, there are some "facets" which a grid dialect can implement optionally, namely support for batching (processing several operations in one atomic datastore invocation) and query support. To get started with CRUD, I'd recommend to take a look at the CouchDB (and MongoDB) dialect as I expect ES to be rather similar. For Couch we use JAX-RS/Jackson to interact with the store and convert tuples to/from JSON documents. I guess some parts of the CouchDB dialect could be extracted and shared by both backends. I would love to read all your suggestions/proposals/tip etc. The rough plan > is to first implement the JPA API (therefor CRUD operations) and once this > is finished, implement search capabilities via Hibernate Search API. > Ironically, search will be the more challenging part. As you know, HSearch only supports direct Lucene access at this point. Ideally, that issue would be resolved first (a very interesting topic for a diploma thesis on its own right ;). Then we could simply plug-in HSearch for full-text queries executed via ES. Note that in this case the complete entity can be obtained from the search backend, I'm not sure whether that possibility is already foreseen in HSearch? An alternative which may be a bit simpler and give quicker success for simplistic queries would be to implement an ES backend of our pluggable HQL/JP-QL parser. We already have implementations of this which take HQL queries and translate them into corresponding MongoDB/Neo4j queries, so the same should be doable for ES. But this wouldn't really carry semantics of full-text queries (fuzzy search etc.) as one could get it via HSearch and might expect for a backend such as ES. > I looking forward to your replies. > Regarding the diploma thesis, how would this exactly work? Are there e.g. any restrictions in the ways the code you write as part of this can be used, or are we meant to "supervise" parts of the thesis in any way? It'd be interesting to learn more about the formal/administrative aspects of this. Hope this provides some food for thought. Just ping us here on the list or #hibernate-dev on FreeNode to discuss any details. > > Cheers, > Jirka > --Gunnar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From sanne at hibernate.org Thu Aug 21 05:37:32 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 10:37:32 +0100 Subject: [hibernate-dev] JCS Hibernate Region Factory In-Reply-To: References: Message-ID: Hi Petar, willing to experiment with it is awesome, but I'm skeptical on that project. The benchmark I've found on the JCS site is not measuring what matters; for example the put an get operations are sequential and not multithreaded, so we have no clue about how it can handle contention or even smart eviction protocols *during* other concurrent get an put operations. The strategy of looping that way has also been proven to be severely misleading, they should better look at microbenchmark tools like JMH, or especially the reasons for which such tools were created. Also there is much more in a caching library than get/put: you need to manage a limited size of available memory, and it's very likely that the cost of evicting the wrong entries outshines by large the cost of a single get/put operation. In other words, it's far more important to measure how the eviction strategies are effective for a specific application load. And the test summarizes all performance with a rough average, as Gil Tene will explain in his awesome talk about measuring "performance" [1] you definitely don't want to do that, unless you're building batch applications (in which case I doubt you'd be using an ORM). What ultimately matters is the performance that you can get out of your full application: so your code, your hardware, your model, Hibernate, the caching library and the integration code you'll write. How you write that integration code is probably crucial: with Ehcache and Infinispan we're lucky that those integration points are maintained directly by experts of the respective technology, I think that's very important to make the right design choices to understand the underlying design. So I don't mean to discourage you, just that it might be a good idea to study the JCS internals carefully or maybe get advice from the JCS team; from our side as Hibernate maintainers it would be great to have an additional option but we can't take this responsibility unless you or other people interested in JCS can maintain it in future as well, as Alex and Galder nicely do for Ehcache and Infinispan integrations. Another option is to keep such code in the Commons JCS repository and have the JCS team maintain it, that's the strategy followed by Hazelcast as far as I know. Note that when I say I'm not liking the benchmark that doesn't imply that JCS itself is bad, just that the benchmark doesn't give me a clue. I honestly don't know it, what's great about it? I'm puzzled that people intend to revive it, when both Ehcache and Infinispan are well proven, and both are ASL2 as well.. personally I'd rather contribute to one of these [disclaimer: I actually did contribute to both projects, recently more on Infinispan but that's beyond caching reasons]. +1 to work on the JSR107 provider, that would be much more useful I think. -- Sanne 1 - https://www.youtube.com/watch?v=ZJG-tX7_dRg On 20 August 2014 19:26, Petar Tahchiev wrote: > Hi Alex, > > sure - keep me in the loop when you have the jsr107 provider ready and i'll > give it and jcs a try. > > Cheers > > > 2014-08-20 20:23 GMT+03:00 Alex Snaps : > >> Petar, thanks, I'll have a look at it! >> I'll try to clear up some time this week (no promise here though! But if >> you'd like to help...) to finally finish this jsr107 provider for h2lc and >> try to test it against the JCS impl. then. >> That would let you use JCS with Hibernate. If you want a "native" JCS >> provider though, there'd be more code to write though... >> Alex >> >> >> On Wed, Aug 20, 2014 at 1:18 PM, Petar Tahchiev >> wrote: >> >>> Hi all, >>> >>> seems like the documentation on the website is too old. So we can ignore >>> the performance bit. But still, it would be nice to provide a region >>> factory, so the end-client has the choice whichever they like. >>> >>> @Alex: There's a 2.0-SNAPSHOT here: >>> https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-jcs/ >>> and yes, seems like it is JCache complient. >>> >>> >>> 2014-08-20 20:14 GMT+03:00 Alex Snaps : >>> >>> I'll try avoiding a flame war here... especially as I'm a Terracotta >>>> employee and working on Ehcache. >>>> That being said, the FAQ says: >>>> "I just built both EHCache (1.2-beta4) and JCS (1.2.7.0) from head, >>>> (...)", where 1.3.0 was released over 7 years ago, I guess "just" has >>>> relative semantics here. >>>> Latest stable JCS release is 5 years old now too, so whether you still >>>> manage to find the Ehcache perf results, or are reading the ones on the JCS >>>> website... there are, how would I best put it, ... utterly out of date. >>>> >>>> On a side note, if the 2.0 release will be 107 compliant, I have a >>>> JSR-107 caching provider more or less done (missing a couple of things for >>>> the read-write strategy around collections), but I'd love to test with that >>>> too then (not necessarily perf only though here). >>>> >>>> Anyways, random biased thoughts :) >>>> Alex >>>> >>>> >>>> On Wed, Aug 20, 2014 at 12:56 PM, Guillaume Smet < >>>> guillaume.smet at gmail.com> wrote: >>>> >>>>> Hi Petar, >>>>> >>>>> On Wed, Aug 20, 2014 at 6:36 PM, Petar Tahchiev >>>>> wrote: >>>>> > I would really like to give apache commons jcs a spin (the FAQ says >>>>> > performancewise it's faster than EHCache) >>>>> >>>>> I don't know JCS but I find it funny they criticize the fact that >>>>> Ehcache published an old benchmark and that they still have a very old >>>>> one in their FAQ. >>>>> >>>>> It might be interesting to have more recent performance information >>>>> comparing the latest versions of both before deciding if it's really >>>>> worth it. >>>>> >>>>> -- >>>>> Guillaume >>>>> _______________________________________________ >>>>> hibernate-dev mailing list >>>>> hibernate-dev at lists.jboss.org >>>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev >>>>> >>>> >>>> >>>> >>>> -- >>>> Alex Snaps >>>> Principal Software Engineer - Terracotta >>>> http://twitter.com/alexsnaps >>>> http://about.me/alexsnaps >>>> http://www.devoxx4kids.org/quebec/ >>>> >>> >>> >>> >>> -- >>> Regards, Petar! >>> Karlovo, Bulgaria. >>> --- >>> Public PGP Key at: >>> https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 >>> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 >>> >> >> >> >> -- >> Alex Snaps >> Principal Software Engineer - Terracotta >> http://twitter.com/alexsnaps >> http://about.me/alexsnaps >> http://www.devoxx4kids.org/quebec/ >> > > > > -- > Regards, Petar! > Karlovo, Bulgaria. > --- > Public PGP Key at: > https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 > Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Thu Aug 21 06:20:03 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 11:20:03 +0100 Subject: [hibernate-dev] Released: Hibernate Search 5.0.0.Alpha6 Message-ID: Hi all, Hibernate Search version 5.0.0.Alpha6 is now available. I'm skipping the blog post this time as the only significant change for users is about fixing the Avro based serializer [HSEARCH-1637], which we had recently broken during 5.0 related refactorings. We also made it possible to serialize the "Flush" index command [HSEARCH-1650], and this had us bump the version of the serialization protocol from 1.0 to 1.1 [HSEARCH-1653]. Regards, Sanne From Itai at forter.com Thu Aug 21 06:38:41 2014 From: Itai at forter.com (Itai Frenkel) Date: Thu, 21 Aug 2014 10:38:41 +0000 Subject: [hibernate-dev] Possible bug in hibernate-validator ValidatorImpl Message-ID: <1408617520714.61420@forter.com> Hello, TL;DR: Need an opinion if to open a JIRA (since reproduction is very tricky) I am using the @UnwrapValidatedValue with a custom Guava OptionalUnwrapper and sometimes OptionalUnwrapper#getValidatedValueType() is called also for non-Optional<> fields. The bug reproduction is sporadic and tricky. I managed to pinpoint it to ValidatorImpl#setValidatedValueHandlerToValueContextIfPresent() that does not perform valueContext.setValidatedValueHandler( null ) when there is no need for an unwrapper. Since valueContext is re-used between fields, it is possible for the OptionalUnwrapper to be first called for Optional fields and then re-used for non-Optional fields with the same validatedValueHandler of the Optional field. If the code owner could quickly comment on this, it would be great. below are some code snippets I used. public class SomePOJO { @DecimalMin(value="0", inclusive=true) public Integer x = -1; @UnwrapValidatedValue @DecimalMin(value="1", inclusive=true) public Optional y = Optional.of(-1); @DecimalMin(value="0", inclusive=true) public Integer z = -1; } public class OptionalUnwrapper extends ValidatedValueUnwrapper> { private final TypeResolver typeResolver; public OptionalUnwrapper() { typeResolver = new TypeResolver(); } @Override public Object handleValidatedValue(Optional optional) { return optional == null? null : optional.orNull(); } @Override public Type getValidatedValueType(Type valueType) { final TypeToken typeToken = TypeToken.of(valueType); if (typeToken.getRawType().isAssignableFrom(Optional.class)) { Type rawType = typeToken.resolveType(Optional.class.getTypeParameters()[0]).getType(); return rawType; } else { Type rawType = typeToken.getType(); Preconditions.checkArgument(false, "type " + rawType + " is not supported by " + this.getClass() ); return null; } } } From sanne at hibernate.org Thu Aug 21 07:04:44 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 12:04:44 +0100 Subject: [hibernate-dev] Search - HSEARCH-1580 - Dependency graph In-Reply-To: References: <68C8A0F4-69D1-4C07-B8B7-147813F3EC51@hibernate.org> Message-ID: Thanks Guillaume! your patch is merged, I'll look forward for more feedback from your team now :) Sanne On 20 August 2014 23:30, Guillaume Smet wrote: > On Fri, Jul 25, 2014 at 9:59 PM, Guillaume Smet > wrote: >> Thanks for your feedback. I'll see what I can do next week about it. > > A little late to the party... but I finally pushed changes along those > lines: https://github.com/hibernate/hibernate-search/pull/654 > > Not really sure the doc parts are OK but happy to fix them if not. > > Once an alpha version is released with this, we will be able to start > testing Search 5 on our apps to see how it goes and provide (hopefully > useful) feedback. > > -- > Guillaume > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From gunnar at hibernate.org Thu Aug 21 07:57:20 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Thu, 21 Aug 2014 13:57:20 +0200 Subject: [hibernate-dev] Possible bug in hibernate-validator ValidatorImpl In-Reply-To: <1408617520714.61420@forter.com> References: <1408617520714.61420@forter.com> Message-ID: Hi, 2014-08-21 12:38 GMT+02:00 Itai Frenkel : > Hello, > > TL;DR: Need an opinion if to open a JIRA (since reproduction is very > tricky) > > > I am using the @UnwrapValidatedValue with a custom Guava OptionalUnwrapper > and sometimes OptionalUnwrapper#getValidatedValueType() is called also for > non-Optional<> fields. > > > The bug reproduction is sporadic and tricky. If you say sporadic, does it mean validating one and the same POJO sometimes shows the issue and in some other cases it doesn't, without altering any parts of the code? > I managed to pinpoint it to > ValidatorImpl#setValidatedValueHandlerToValueContextIfPresent() that does > not perform valueContext.setValidatedValueHandler( null ) when there is no > need for an unwrapper. Since valueContext is re-used between fields, it is > possible for the OptionalUnwrapper to be first called for Optional fields > and then re-used for non-Optional fields with the same > validatedValueHandler of the Optional field. > Interesting, this doesn't seem correct indeed. Without having a closer look I'd say the un-wrapper should be reset on the context between validation of different properties. If the code owner could quickly comment on this, it would be great. > It sounds like a legitimate bug description, so I suggest you move forward and open an issue in JIRA (https://hibernate.atlassian.net/browse/HV). It would be great if you could attach a complete executable test case which demonstrates the issue. > > > below are some code snippets I used. > > > public class SomePOJO { > > @DecimalMin(value="0", inclusive=true) > public Integer x = -1; > > @UnwrapValidatedValue > @DecimalMin(value="1", inclusive=true) > public Optional y = Optional.of(-1); > > @DecimalMin(value="0", inclusive=true) > public Integer z = -1; > } > > public class OptionalUnwrapper extends > ValidatedValueUnwrapper> { > > private final TypeResolver typeResolver; > > public OptionalUnwrapper() { > typeResolver = new TypeResolver(); > } > > @Override > public Object handleValidatedValue(Optional optional) { > return optional == null? null : optional.orNull(); > } > > @Override > public Type getValidatedValueType(Type valueType) { > > final TypeToken typeToken = TypeToken.of(valueType); > if (typeToken.getRawType().isAssignableFrom(Optional.class)) { > Type rawType = > typeToken.resolveType(Optional.class.getTypeParameters()[0]).getType(); > return rawType; > } > else { > Type rawType = typeToken.getType(); > Preconditions.checkArgument(false, "type " + rawType + " is > not supported by " + this.getClass() ); > return null; > } > } > } > Thanks for reporting this issue, much appreciated! Cheers, --Gunnar > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From emmanuel at hibernate.org Thu Aug 21 09:30:20 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 15:30:20 +0200 Subject: [hibernate-dev] Using raw vs. wildcard types In-Reply-To: References: Message-ID: <20140821133020.GF93689@hibernate.org> I do like you do. But I can see why some fall back to the raw type as it's less "annoying" when developing. On Thu 2014-08-07 17:26, Gunnar Morling wrote: > Hi, > > every now and then I run into usages of raw types in our code bases: > > * Class entityType (instead of Class) > * Set querySpaces (instead of Set) > ... > > I first thought that'd be left-overs from ancient times but apparently this > is also done in newly written code. I don't like it as in some cases it's > clearly a loss of information which requires investigation in surrounding > code to find out e.g. which types are put into a raw Set. In other cases > (e.g. Class) I prefer to use the wildcard type (Class) as it avoids many > raw-type warnings in the IDE (which otherwise may obfuscate legitimate > warnings). > > Is there any reason for using raw types in new code rather than full > generic or wildcard types? > > Personally I try to fix existing usages of raw types and avoid to add new > ones if possible, but sometimes I can't (e.g. one cannot override a method > expecting a Class with a method expecting a Class). > > Thanks, > > --Gunnar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From emmanuel at hibernate.org Thu Aug 21 09:42:55 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 15:42:55 +0200 Subject: [hibernate-dev] [Search] @Transformable vs @ProvidedId In-Reply-To: References: Message-ID: <20140821134255.GG93689@hibernate.org> I basically tl;dr; the whole thread for the obvious reason that it is too long :) But skimming through it made me think of the following. Would it make sense to index Map.Entry with @IndexedEmbedded or @FieldBridge on Map.Entry.getKey() / Map.Entry.getValue()? At a conceptual level at least. One more reasons to get free form entities. On Thu 2014-08-07 18:56, Sanne Grinovero wrote: > There are two annotations clashing for same responsibilities: > - org.infinispan.query.Transformable > - org.hibernate.search.annotations.ProvidedId > > as documented at the following link, these two different ways to apply "Id > indexing options" in Infinispan Query, IMHO quite unclear when a user > should use one vs. the other. > > - > http://infinispan.org/docs/7.0.x/user_guide/user_guide.html#_requirements_for_the_key_transformable_and_providedid > > The benefit of @Transformable is that Infinispan provides one out of the > box which will work for any user case: it will serialize the whole object > representing the id, then hex-encode the buffer into a String: horribly > inefficient but works on any serializable type. > > @ProvidedId originally marked the indexed entry in such a way that the > indexing engine would consider the id "provided externally", i.e. given at > runtime. It would also assume that its type would be static for a specific > type - which is I think a reasonable expectation but doesn't really hold as > an absolute truth in the case of Infinispan: nothing prevents me to store > an indexed entry of type "Person" for index "personindex" with an Integer > typed key in the cache, and also duplicate the same information under a say > String typed key. > > So there's an expectation mismatch: in ORM world the key type is strongly > related to the value type, but when indexing Infinispan entries the reality > is that we're indexing two independent "modules". > > I was hoping to drop @ProvidedId today as the original "marker" > functionality is no longer needed: since we have > > org.hibernate.search.cfg.spi.SearchConfiguration.isIdProvidedImplicit() > > the option can be implicitly applied to all indexed entries, and the > annotation is mostly redundant in Infinispan since we added this. > > But actually it turns out it's a bit more complex as it servers a second > function as well: it's the only way for users to be able to specify a > FieldBridge for the ID.. so the functionality of this annotation is not > consumed yet. > > So my proposal is to get rid of both @Transformable and @ProvidedId. There > needs to be a single way in Infinispan to define both the indexing options > and transformation; ideally this should be left to the Search Engine and > its provided collection of FieldBridge implementations. > > Since the id type and the value type in Infinispan are not necessarily > strongly related (still the id is unique of course), I think this option > doesn't even belong on the @Indexed value but should be specified on the > key type. > > Problem is that to define a class-level annotation to be used on the > Infinispan keys doesn't really belong in the collection of annotations of > Hibernate Search; I'm tempted to require that the key used for the type > must be one of those for which an out-of-the-box FieldBridge is provided: > the good thing is that now the set is extensible. In a second phase > Infinispan could opt to create a custom annotation like @Transformable to > register these options in a simplified way. > > Even more, I've witnessed cases in which in Infinispan it makes sense to > encode some more information in the key than what's strictly necessary to > identify the key (like having attributes which are not included in the > hashcode and equals definitions). It sounds like the user should be allowed > to annotate the Key types, to allow such additional properties to > contribute to the index definition. > > Comments welcome, but I feel strongly that these two annotations need to be > removed to make room for better solutions: we have an opportunity now as > I'm rewriting the mapping engine. > > Sanne > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Thu Aug 21 09:50:21 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 14:50:21 +0100 Subject: [hibernate-dev] [Search] Redefining inheritance mapping, and why to follow same rules as ORM Message-ID: First some context, we have issues open such as : = HSEARCH-1656 - Recognize annotations from implemented interfaces = HSEARCH-249 - Inheritance of annotations = HSEARCH-1231 - Discuss if @Indexed annotation should not be inherited by default I've always felt it odd that we would ignore subtypes for @Indexed entities, but when mentioned I got excellent counter-arguments. Nowadays though I've mostly forgotten why we don't, and I'm wondering if those arguments still stand, especially as our position to issues like: HSEARCH-383 - Hibernate Search does not respect the @AccessType annotation in respect to @Id fields. is that we don't necessarily follow the same rules as Hibernate ORM. Also we're currently aiming at more flexible models, not least as needed by protobuf encoded models like in Infinispan Query, but we want of course to be consistent for users of Hibernate ORM. So questions: #1 Why don't we assume subclasses of an @Indexed entity is indexed as well? A comment in HSEARCH-1231 points out that this would need classpath scanning, but a) If it makes sense we should JFDI, or explore Jandex superpowers to help. b) I'm not sure anymore that we need that: in the ORM use case users won't be allowed to run CRUD operations on unknown entities anyway, so I think it's safe to assume that any entity passed to Search has been known by ORM (and passed to us at bootstrap). Am I wrong? The question stands for non-ORM use cases, but for example Infinispan Query needs to apply on-the-fly registration of new types as needed already: not a new problem there. #2 Is HSEARCH-1656 a good idea? I find the idea fascinating, but we'd need to apply strict validations against the usual problems of multiple inheritance. Many of our class-level annotations do not allow repetitions and we'd need to evaluate each of them to see if they would be valid if you "inherit" multiple of them. For example, multiple @ClassBridge annotations could result in a composition, but things like @DocumentId shall not be repeated, and I wonder if we should allow conflicting fieldname writes. Other annotations are supposed to represent a function (having a unique answer), like @AnalyzerDiscriminator: currently we mandate to have only one of them, which keeps things simple and understandable; if I have multiple discriminators defined (one on each interface), would you expect the function to be applied independently on the @Field(s) defined by that interface? As someone defining different (independent) interfaces I would expect that, as I might not know about someone putting both (more) interfaces on a single concrete implementation, and probably the other annotations of each interface are expecting that specific AnalyzerDiscriminator to be applied to them. #3 Are #1 and #2 unrelated? I suspect they are not, IMHO if we do inheritance of annotations, inheriting them from interfaces is the next natural and consistent step. Or not? So it would be important to evaluate their link before committing on either, as it seems both have consequences. #4 Any example of inconsistent experience for ORM users to handle our inheritance "differently"? *differently* is a biased term though as it suggests some violation of least surprise, but actually as a user myself and as I think suggested by various other users as well, while the ORM rules are clear this missing inheritance in Search seems to have been a surprise to many. I suspect people understand the two things are quite different and we should pick a consistent rule (like decide to reject HSEARCH-383 ?) Thanks a lot for any feedback, Sanne https://hibernate.atlassian.net/browse/HSEARCH-1656 https://hibernate.atlassian.net/browse/HSEARCH-249 https://hibernate.atlassian.net/browse/HSEARCH-1231 https://hibernate.atlassian.net/browse/HSEARCH-383 From emmanuel at hibernate.org Thu Aug 21 10:26:40 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 16:26:40 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: <20140821142640.GH93689@hibernate.org> Awesome write up. I will for sure steal a lot of it :) A few random comments: - once we are sufficiently happy, we probably should move this to the website - you mention backward compatibility and leave aside source vs binary backward compatibility. Do we want to dive on this subject? The later is of course much harder even though relatively well defined for Java. Emmanuel On Sat 2014-08-09 9:55, Steve Ebersole wrote: > There was a discussion in regards to our view on backwards compatibility in > reference to HHH-9316. I realized that we talk about this amongst > ourselves, but that I have never written these down. So I did that: > > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > > This is a first draft. Let me know what you think. > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From emmanuel at hibernate.org Thu Aug 21 10:42:13 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 16:42:13 +0200 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: Message-ID: <20140821144213.GA97704@hibernate.org> The biggies that I think should be in 5.0 are: - free form entity: it opens up a lot of interesting doors closed to us at the moment - bridges providing metadata feedback for better optimizations (like which field they store stuff to) Both have a risk of API breakage hence the idea of working on them before 5.0. Multi backend support is probably in that same category but there is no way we can deliver this one in a realistic timeframe. Not without a pair of extra hands. Emmanuel On Wed 2014-08-20 10:38, Sanne Grinovero wrote: > Hi Marc, > > we've been slower than expected, apologies from my part as I've been > distracted in fixing stuff in a project building on Hibernate Search; > in a way that has been good for the project as we nailed some issues > in Search, gives us valuable input on performance and validation under > high load. > Considering holidays & similar, we should be fully focused on Search > again next week and first goal is of course to challenge the roadmap > and see what can be cut to speedup a 5.0.0.Final release.. However > many users are already using the current previews and I am expecting > the same from you as you would give us precious feedback as usual ;-) > > We discussed the release timeframe yesterday during our fortnight IRC > meeting; Emmanuel sent the logs to this same list in case you want to > see the details > (And feel free to join when you can). No date was mentioned, we need > to spend a couple of days first to investigate what can be sensibly > dropped. > > We're all agreeing that we should rather move some issues out from the > plan and release early; having said that, which features of Lucene 4 > would you love to see exposed on the API? > I also expected many big changes but it turned out we could provide > most of it as "under the hood" internal changes; unless I'm missing > something the issues still open on JIRA are not expected to make a > significant dent on our public API (that is, excluding some changes in > defaults and meaning of annotations as discussed previously, but > that's not Lucene4 specific). > > Please open issues about features we should expose, and feel free to > suggest a priority. I'll probably defer anything which shouldn't block > the 5.0, but it would be very helpful. > > Cheers, > Sanne > > > > > On 19 August 2014 13:07, Marc Schipperheyn wrote: > > Hi, > > > > Is there any tentative idea on Hibernate Search 5.0 will come out? It just > > feels like progress is extremely slow and when I look at JIRA I keep seeing > > issues being added and fixed that seem extremely contextual (WildFly, > > improve errorHandler, etc) and nothing to do with the ambition to deliver > > the cool new features of Lucene 4 to the masses. I mean, I'm extremely > > anxious to work with Lucene 4 like forever, because it brings so much to > > the table and it will be great to have that power at your fingertips, but > > of course, it would be even greater if that power is brought to the > > Hibernate Search API. > > > > Cheers, > > Marc > > _______________________________________________ > > 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 Thu Aug 21 10:46:56 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 15:46:56 +0100 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: <20140821144213.GA97704@hibernate.org> References: <20140821144213.GA97704@hibernate.org> Message-ID: Agreed, but on free-form as soon as we're advanced enough to know the API is solid it should not delay further. Not saying we're there yet though, so we can decide on such matters when we agree on its stability and risks. Sanne On 21 August 2014 15:42, Emmanuel Bernard wrote: > The biggies that I think should be in 5.0 are: > > - free form entity: it opens up a lot of interesting doors closed to us > at the moment > - bridges providing metadata feedback for better optimizations (like > which field they store stuff to) > > Both have a risk of API breakage hence the idea of working on them > before 5.0. > > Multi backend support is probably in that same category but there is no > way we can deliver this one in a realistic timeframe. Not without a pair > of extra hands. > > Emmanuel > > On Wed 2014-08-20 10:38, Sanne Grinovero wrote: >> Hi Marc, >> >> we've been slower than expected, apologies from my part as I've been >> distracted in fixing stuff in a project building on Hibernate Search; >> in a way that has been good for the project as we nailed some issues >> in Search, gives us valuable input on performance and validation under >> high load. >> Considering holidays & similar, we should be fully focused on Search >> again next week and first goal is of course to challenge the roadmap >> and see what can be cut to speedup a 5.0.0.Final release.. However >> many users are already using the current previews and I am expecting >> the same from you as you would give us precious feedback as usual ;-) >> >> We discussed the release timeframe yesterday during our fortnight IRC >> meeting; Emmanuel sent the logs to this same list in case you want to >> see the details >> (And feel free to join when you can). No date was mentioned, we need >> to spend a couple of days first to investigate what can be sensibly >> dropped. >> >> We're all agreeing that we should rather move some issues out from the >> plan and release early; having said that, which features of Lucene 4 >> would you love to see exposed on the API? >> I also expected many big changes but it turned out we could provide >> most of it as "under the hood" internal changes; unless I'm missing >> something the issues still open on JIRA are not expected to make a >> significant dent on our public API (that is, excluding some changes in >> defaults and meaning of annotations as discussed previously, but >> that's not Lucene4 specific). >> >> Please open issues about features we should expose, and feel free to >> suggest a priority. I'll probably defer anything which shouldn't block >> the 5.0, but it would be very helpful. >> >> Cheers, >> Sanne >> >> >> >> >> On 19 August 2014 13:07, Marc Schipperheyn wrote: >> > Hi, >> > >> > Is there any tentative idea on Hibernate Search 5.0 will come out? It just >> > feels like progress is extremely slow and when I look at JIRA I keep seeing >> > issues being added and fixed that seem extremely contextual (WildFly, >> > improve errorHandler, etc) and nothing to do with the ambition to deliver >> > the cool new features of Lucene 4 to the masses. I mean, I'm extremely >> > anxious to work with Lucene 4 like forever, because it brings so much to >> > the table and it will be great to have that power at your fingertips, but >> > of course, it would be even greater if that power is brought to the >> > Hibernate Search API. >> > >> > Cheers, >> > Marc >> > _______________________________________________ >> > 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 guillaume.smet at gmail.com Thu Aug 21 10:55:50 2014 From: guillaume.smet at gmail.com (Guillaume Smet) Date: Thu, 21 Aug 2014 16:55:50 +0200 Subject: [hibernate-dev] Search - HSEARCH-1580 - Dependency graph In-Reply-To: References: <68C8A0F4-69D1-4C07-B8B7-147813F3EC51@hibernate.org> Message-ID: On Thu, Aug 21, 2014 at 1:04 PM, Sanne Grinovero wrote: > your patch is merged, I'll look forward for more feedback from your team now :) Thanks. Too bad I missed the alpha6 train... We'll try to move our apps to the next alpha (or beta) and see how it goes (not a big fan of having snapshots in our dependencies). -- Guillaume From emmanuel at hibernate.org Thu Aug 21 11:03:29 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 17:03:29 +0200 Subject: [hibernate-dev] [Search] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: References: Message-ID: <20140821150329.GB97704@hibernate.org> I am really really not in favor of handling annotations from interfaces. As you hints, it creates a *massively complex* set of rules on overridability and inconsistent usages. We might be able to solve them but how many months of work for what reward? I'd rather implement free-form entity and leave it open for someone to try that super duper max inheritance rule set of death. BTW ORM does not inherit annotations from interfaces. If you expect all subclasses to be provided to you by the system bootstrapping Hibernate Search we can offer subclass indexing. As you say, it will be working in ORM. I don't think it would in Infinispan as we don't know how to add to the same hierarchy but that's another story. We could do best effort (even though it's more unpredictable). Your idea of reusing Jandex won't quite fully work when people put their classes in different jars. And funnily enough, I don't think Hibernate ORM let's you save a subclass of an @Entity that is not itself annotated with @Entity (or itself have a subclass annotated @Entity). In short, not to annotations on interfaces. Neutral on indexing subclasses with the understanding that we are doing it as best effort but that will remain flaky. The ability to index the @IndexedEmbedded actual type instead of the static type seems to have more merit to me. Emmanuel On Thu 2014-08-21 14:50, Sanne Grinovero wrote: > First some context, we have issues open such as : > = HSEARCH-1656 - Recognize annotations from implemented interfaces > = HSEARCH-249 - Inheritance of annotations > = HSEARCH-1231 - Discuss if @Indexed annotation should not be > inherited by default > > I've always felt it odd that we would ignore subtypes for @Indexed > entities, but when mentioned I got excellent counter-arguments. > Nowadays though I've mostly forgotten why we don't, and I'm wondering > if those arguments still stand, especially as our position to issues > like: > > HSEARCH-383 - Hibernate Search does not respect the @AccessType > annotation in respect to @Id fields. > > is that we don't necessarily follow the same rules as Hibernate ORM. > Also we're currently aiming at more flexible models, not least as > needed by protobuf encoded models like in Infinispan Query, but we > want of course to be consistent for users of Hibernate ORM. > > So questions: > > #1 Why don't we assume subclasses of an @Indexed entity is indexed as well? > > A comment in HSEARCH-1231 points out that this would need classpath > scanning, but > a) If it makes sense we should JFDI, or explore Jandex superpowers to help. > b) I'm not sure anymore that we need that: in the ORM use case users > won't be allowed to run CRUD operations on unknown entities anyway, so > I think it's safe to assume that any entity passed to Search has been > known by ORM (and passed to us at bootstrap). Am I wrong? > > The question stands for non-ORM use cases, but for example Infinispan > Query needs to apply on-the-fly registration of new types as needed > already: not a new problem there. > > #2 Is HSEARCH-1656 a good idea? > > I find the idea fascinating, but we'd need to apply strict validations > against the usual problems of multiple inheritance. Many of our > class-level annotations do not allow repetitions and we'd need to > evaluate each of them to see if they would be valid if you "inherit" > multiple of them. > For example, multiple @ClassBridge annotations could result in a > composition, but things like @DocumentId shall not be repeated, and I > wonder if we should allow conflicting fieldname writes. > > Other annotations are supposed to represent a function (having a > unique answer), like @AnalyzerDiscriminator: currently we mandate to > have only one of them, which keeps things simple and understandable; > if I have multiple discriminators defined (one on each interface), > would you expect the function to be applied independently on the > @Field(s) defined by that interface? > As someone defining different (independent) interfaces I would expect > that, as I might not know about someone putting both (more) interfaces > on a single concrete implementation, and probably the other > annotations of each interface are expecting that specific > AnalyzerDiscriminator to be applied to them. > > #3 Are #1 and #2 unrelated? > > I suspect they are not, IMHO if we do inheritance of annotations, > inheriting them from interfaces is the next natural and consistent > step. Or not? > So it would be important to evaluate their link before committing on > either, as it seems both have consequences. > > #4 Any example of inconsistent experience for ORM users to handle our > inheritance "differently"? > > *differently* is a biased term though as it suggests some violation of > least surprise, but actually as a user myself and as I think suggested > by various other users as well, while the ORM rules are clear this > missing inheritance in Search seems to have been a surprise to many. I > suspect people understand the two things are quite different and we > should pick a consistent rule (like decide to reject HSEARCH-383 ?) > > > Thanks a lot for any feedback, > Sanne > > > https://hibernate.atlassian.net/browse/HSEARCH-1656 > https://hibernate.atlassian.net/browse/HSEARCH-249 > https://hibernate.atlassian.net/browse/HSEARCH-1231 > https://hibernate.atlassian.net/browse/HSEARCH-383 > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From emmanuel at hibernate.org Thu Aug 21 11:04:45 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 17:04:45 +0200 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: <20140821144213.GA97704@hibernate.org> Message-ID: <20140821150445.GC97704@hibernate.org> On Thu 2014-08-21 15:46, Sanne Grinovero wrote: > Agreed, but on free-form as soon as we're advanced enough to know the > API is solid it should not delay further. /me rolling on the floor I want it NOOOOOW From sanne at hibernate.org Thu Aug 21 11:08:04 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 16:08:04 +0100 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: Message-ID: Hi Marc, the QueryTimeJoin is indeed very interesting but since the user needs to mark the "join point" somehow I hope we'll be able to build it as a new feature (probably with its own new annotation) in some 5.next ? At this point you seem you have more experience with it, so please correct me if I'm wrong :-) On performance, that's actually one of the reasons why I'm so interested in these other tests I've been spending time one: seems Lucene 4 is not always more efficient than Lucene 3, so I need to understand if we're missing something significant. Sanne On 20 August 2014 15:13, Marc Schipperheyn wrote: > Hi Sanne, > > Thanks for that extensive reply. >> >> Considering holidays & similar, we should be fully focused on Search >> again next week and first goal is of course to challenge the roadmap >> and see what can be cut to speedup a 5.0.0.Final release.. However >> many users are already using the current previews and I am expecting >> the same from you as you would give us precious feedback as usual ;-) > > > Yeah, I'd love that. However, I've been having some delays of my own and I > will need to upgrade a bunch of related dependencies in order to move to 5.0 > which is a project in itself. It's high on my list but the marketing people > are also breathing down my neck for end user features. You know how it is. > >> We're all agreeing that we should rather move some issues out from the >> plan and release early; having said that, which features of Lucene 4 >> would you love to see exposed on the API? > > > I personally really like the Grouping and QueryTimeJoin functionalities and > am using them to great effect through the Lucene API. Also, I'm looking > forward to implementing some of the new suggest / autocomplete analyzers, > but that would prob not need any API changes. I think on the analyzer front, > things look really interesting with 4.x. > > Other than that, just very interested in general to experience the numerous > performance improvements that have been made. > > Cheers, > Marc > From sanne at hibernate.org Thu Aug 21 11:26:42 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 16:26:42 +0100 Subject: [hibernate-dev] [Search] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: <20140821150329.GB97704@hibernate.org> References: <20140821150329.GB97704@hibernate.org> Message-ID: On 21 August 2014 16:03, Emmanuel Bernard wrote: > I am really really not in favor of handling annotations from interfaces. > As you hints, it creates a *massively complex* set of rules on > overridability and inconsistent usages. > We might be able to solve them but how many months of work for what > reward? I'd rather implement free-form entity and leave it open for > someone to try that super duper max inheritance rule set of death. > BTW ORM does not inherit annotations from interfaces. Ok, but I never implied this as higher priority than free-form. I had it optimistically marked for 5.1 but to follow your advice I've now removed any version. > If you expect all subclasses to be provided to you by the system > bootstrapping Hibernate Search we can offer subclass indexing. > As you say, it will be working in ORM. > I don't think it would in Infinispan as we don't know how to add to the > same hierarchy but that's another story. We could do best effort (even > though it's more unpredictable). Problem is, this is how Infinispan Query works today: annotated types pop-up at any time dynamically and we need to deal with it. But I agree - as discussed during free-form design - that this madness should be stopped :-) Still, with the current design in Query I am clueless at how Infinispan should then provide these types upfront, I've rised the subject many times on the Infinispan mailing list and it always died without a solid solution. An idea could be to restrict its usage from not using inheritance at all, and no "entity" will share an index with another entity: after all that project is not targeting complex domain models but a key/value store, but it's not clear to me if this is an acceptable limitation. > Your idea of reusing Jandex won't quite fully work when people put their > classes in different jars. > And funnily enough, I don't think Hibernate ORM let's you save a > subclass of an @Entity that is not itself annotated with @Entity (or > itself have a subclass annotated @Entity). I understand that, but it doesn't limit our options? > In short, not to annotations on interfaces. > Neutral on indexing subclasses with the understanding that we are doing > it as best effort but that will remain flaky. The ability to index the > @IndexedEmbedded actual type instead of the static type seems to have > more merit to me. Right but that's where I'm coming from. If we index the actual type and not the one statically linked to from @IndexedEmbedded, wouldn't you expect the same behaviour on subclasses respect to @Indexed? I'm not pushing for either solution, just trying to reason about what should be considered a consistent behaviour: Hibernate Search 3.x and 4.x are *consistent* on this, so what I'm wondering now is if we should be consistent again with the choices made in this regard, or is the relation between the two far fetched? -- Sanne > > Emmanuel > > On Thu 2014-08-21 14:50, Sanne Grinovero wrote: >> First some context, we have issues open such as : >> = HSEARCH-1656 - Recognize annotations from implemented interfaces >> = HSEARCH-249 - Inheritance of annotations >> = HSEARCH-1231 - Discuss if @Indexed annotation should not be >> inherited by default >> >> I've always felt it odd that we would ignore subtypes for @Indexed >> entities, but when mentioned I got excellent counter-arguments. >> Nowadays though I've mostly forgotten why we don't, and I'm wondering >> if those arguments still stand, especially as our position to issues >> like: >> >> HSEARCH-383 - Hibernate Search does not respect the @AccessType >> annotation in respect to @Id fields. >> >> is that we don't necessarily follow the same rules as Hibernate ORM. >> Also we're currently aiming at more flexible models, not least as >> needed by protobuf encoded models like in Infinispan Query, but we >> want of course to be consistent for users of Hibernate ORM. >> >> So questions: >> >> #1 Why don't we assume subclasses of an @Indexed entity is indexed as well? >> >> A comment in HSEARCH-1231 points out that this would need classpath >> scanning, but >> a) If it makes sense we should JFDI, or explore Jandex superpowers to help. >> b) I'm not sure anymore that we need that: in the ORM use case users >> won't be allowed to run CRUD operations on unknown entities anyway, so >> I think it's safe to assume that any entity passed to Search has been >> known by ORM (and passed to us at bootstrap). Am I wrong? >> >> The question stands for non-ORM use cases, but for example Infinispan >> Query needs to apply on-the-fly registration of new types as needed >> already: not a new problem there. >> >> #2 Is HSEARCH-1656 a good idea? >> >> I find the idea fascinating, but we'd need to apply strict validations >> against the usual problems of multiple inheritance. Many of our >> class-level annotations do not allow repetitions and we'd need to >> evaluate each of them to see if they would be valid if you "inherit" >> multiple of them. >> For example, multiple @ClassBridge annotations could result in a >> composition, but things like @DocumentId shall not be repeated, and I >> wonder if we should allow conflicting fieldname writes. >> >> Other annotations are supposed to represent a function (having a >> unique answer), like @AnalyzerDiscriminator: currently we mandate to >> have only one of them, which keeps things simple and understandable; >> if I have multiple discriminators defined (one on each interface), >> would you expect the function to be applied independently on the >> @Field(s) defined by that interface? >> As someone defining different (independent) interfaces I would expect >> that, as I might not know about someone putting both (more) interfaces >> on a single concrete implementation, and probably the other >> annotations of each interface are expecting that specific >> AnalyzerDiscriminator to be applied to them. >> >> #3 Are #1 and #2 unrelated? >> >> I suspect they are not, IMHO if we do inheritance of annotations, >> inheriting them from interfaces is the next natural and consistent >> step. Or not? >> So it would be important to evaluate their link before committing on >> either, as it seems both have consequences. >> >> #4 Any example of inconsistent experience for ORM users to handle our >> inheritance "differently"? >> >> *differently* is a biased term though as it suggests some violation of >> least surprise, but actually as a user myself and as I think suggested >> by various other users as well, while the ORM rules are clear this >> missing inheritance in Search seems to have been a surprise to many. I >> suspect people understand the two things are quite different and we >> should pick a consistent rule (like decide to reject HSEARCH-383 ?) >> >> >> Thanks a lot for any feedback, >> Sanne >> >> >> https://hibernate.atlassian.net/browse/HSEARCH-1656 >> https://hibernate.atlassian.net/browse/HSEARCH-249 >> https://hibernate.atlassian.net/browse/HSEARCH-1231 >> https://hibernate.atlassian.net/browse/HSEARCH-383 >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev From sanne at hibernate.org Thu Aug 21 11:32:28 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 21 Aug 2014 16:32:28 +0100 Subject: [hibernate-dev] Search - HSEARCH-1580 - Dependency graph In-Reply-To: References: <68C8A0F4-69D1-4C07-B8B7-147813F3EC51@hibernate.org> Message-ID: On 21 August 2014 15:55, Guillaume Smet wrote: > On Thu, Aug 21, 2014 at 1:04 PM, Sanne Grinovero wrote: >> your patch is merged, I'll look forward for more feedback from your team now :) > > Thanks. Too bad I missed the alpha6 train... > > We'll try to move our apps to the next alpha (or beta) and see how it > goes (not a big fan of having snapshots in our dependencies). I understand. If this is a good time for your team to do such experiments, I'm willing to switch to weekly tags, or even bi-weekly if there's need, as two other teams seem to be in the same good mood :-) (but I'll keep cutting on the blogs in that case, hopefully making space for more interesting blog posts). Cheers, Sanne From m.schipperheyn at gmail.com Thu Aug 21 12:26:56 2014 From: m.schipperheyn at gmail.com (Marc Schipperheyn) Date: Thu, 21 Aug 2014 13:26:56 -0300 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: Message-ID: On Aug 21, 2014 12:08 PM, "Sanne Grinovero" wrote: > Hi Marc, > the QueryTimeJoin is indeed very interesting but since the user needs > to mark the "join point" somehow I hope we'll be able to build it as a > new feature (probably with its own new annotation) in some 5.next ? > QueryTimeJoin doesn't require index time specifications, so yes, you could specify a join with an annotation, perhaps this is conceptually more in-line with Hibernate ORM, but it could just as easily be done though an extension of the QueryBuilder. So basically, the idea of the QueryTimeJoin is filter the root class with results from a query that hits a different index, much like the SQL where someId in (select id from X) style queries. I could imagine something like this: QueryBuilder postQueryBuilder = fts.getSearchFactory().buildQueryBuilder().forEntity(Post.class).get(); QueryBuilder commentQueryBuilder = fts.getSearchFactory().buildQueryBuilder().forEntity(Comment.class).get(); postQueryBuilder.join().onField("id").referencing("post.id ").onEntity(Comment.class).withQuery( commentQueryBuilder.keyword().onField("type" ).matching("A").createQuery() ).createQuery(); At this point you seem you have more experience with it, so please > correct me if I'm wrong :-) > > On performance, that's actually one of the reasons why I'm so > interested in these other tests I've been spending time one: seems > Lucene 4 is not always more efficient than Lucene 3, so I need to > understand if we're missing something significant. > Interesting. With all I've read and the maturity of this version you would think.... Another thing I forgot to mention is that I'm hoping that I will be able to dump Bobo Browse in favor of Hibernate Search faceting. Currently, HSearch is too limited still in this respect and I hope this will change with the new features of Lucene in this area. Cheers, Marc From emmanuel at hibernate.org Thu Aug 21 12:31:46 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Thu, 21 Aug 2014 18:31:46 +0200 Subject: [hibernate-dev] [Search] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: References: <20140821150329.GB97704@hibernate.org> Message-ID: <45F31920-2147-473F-B2E0-747E394C6264@hibernate.org> On 21 Aug 2014, at 17:26, Sanne Grinovero wrote: >> In short, not to annotations on interfaces. >> Neutral on indexing subclasses with the understanding that we are doing >> it as best effort but that will remain flaky. The ability to index the >> @IndexedEmbedded actual type instead of the static type seems to have >> more merit to me. > > Right but that's where I'm coming from. If we index the actual type > and not the one statically linked to from @IndexedEmbedded, wouldn't > you expect the same behaviour on subclasses respect to @Indexed? > I'm not pushing for either solution, just trying to reason about what > should be considered a consistent behaviour: Hibernate Search 3.x and > 4.x are *consistent* on this, so what I'm wondering now is if we > should be consistent again with the choices made in this regard, or is > the relation between the two far fetched? Rethinking this, I don?t think you need to know the subclasses ahead of time (at least if they are not hosting properties that need to be indexed. When reaching an unknown class, you can simply look up the hierarchy to find the most specific superclass marked @Indexed and use that document builder to index the specific subclass. That would solve the problem you are trying to address I think. From thomas.kuhlmann at thk-systems.de Thu Aug 21 13:43:00 2014 From: thomas.kuhlmann at thk-systems.de (Thomas Kuhlmann) Date: Thu, 21 Aug 2014 19:43:00 +0200 Subject: [hibernate-dev] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: <53F62F62.3030508@thomas-kuhlmann.de> References: <53F62F62.3030508@thomas-kuhlmann.de> Message-ID: <53F62FA4.20209@thk-systems.de> Please apologize me to reply to this discussion although I am not a hibernate-developer. I created issue "HSEARCH-1656", because I have some entities at different points in my entity hierarchy (thus with different super-classes), but all those entities (and only those) should be indexed by hibernate-search. The have all the same fields to be indexed (including embedded index) and the (not so small) index-configuration is always the same. Of course, I can solve this, be adding the necessary annotations to each of those entities, but I do not like redundancy, so I had the idea of using an interface there. I really do not have any idea how much effort it is to implement such feature. I just can say, it would be useful to me (and maybe to others ...). If you send me some entry point to the code (e.g. a class or method) for that topic I will take a look on the code for myself ... . Thomas > I am really really not in favor of handling annotations from interfaces. > As you hints, it creates a *massively complex* set of rules on > overridability and inconsistent usages. > We might be able to solve them but how many months of work for what > reward? I'd rather implement free-form entity and leave it open for > someone to try that super duper max inheritance rule set of death. > BTW ORM does not inherit annotations from interfaces. > > If you expect all subclasses to be provided to you by the system > bootstrapping Hibernate Search we can offer subclass indexing. > As you say, it will be working in ORM. > I don't think it would in Infinispan as we don't know how to add to the > same hierarchy but that's another story. We could do best effort (even > though it's more unpredictable). > Your idea of reusing Jandex won't quite fully work when people put their > classes in different jars. > And funnily enough, I don't think Hibernate ORM let's you save a > subclass of an @Entity that is not itself annotated with @Entity (or > itself have a subclass annotated @Entity). > > In short, not to annotations on interfaces. > Neutral on indexing subclasses with the understanding that we are doing > it as best effort but that will remain flaky. The ability to index the > @IndexedEmbedded actual type instead of the static type seems to have > more merit to me. > > Emmanuel > > On Thu 2014-08-21 14:50, Sanne Grinovero wrote: >> First some context, we have issues open such as : >> = HSEARCH-1656 - Recognize annotations from implemented interfaces >> = HSEARCH-249 - Inheritance of annotations >> = HSEARCH-1231 - Discuss if @Indexed annotation should not be >> inherited by default >> >> I've always felt it odd that we would ignore subtypes for @Indexed >> entities, but when mentioned I got excellent counter-arguments. >> Nowadays though I've mostly forgotten why we don't, and I'm wondering >> if those arguments still stand, especially as our position to issues >> like: >> >> HSEARCH-383 - Hibernate Search does not respect the @AccessType >> annotation in respect to @Id fields. >> >> is that we don't necessarily follow the same rules as Hibernate ORM. >> Also we're currently aiming at more flexible models, not least as >> needed by protobuf encoded models like in Infinispan Query, but we >> want of course to be consistent for users of Hibernate ORM. >> >> So questions: >> >> #1 Why don't we assume subclasses of an @Indexed entity is indexed as well? >> >> A comment in HSEARCH-1231 points out that this would need classpath >> scanning, but >> a) If it makes sense we should JFDI, or explore Jandex superpowers to help. >> b) I'm not sure anymore that we need that: in the ORM use case users >> won't be allowed to run CRUD operations on unknown entities anyway, so >> I think it's safe to assume that any entity passed to Search has been >> known by ORM (and passed to us at bootstrap). Am I wrong? >> >> The question stands for non-ORM use cases, but for example Infinispan >> Query needs to apply on-the-fly registration of new types as needed >> already: not a new problem there. >> >> #2 Is HSEARCH-1656 a good idea? >> >> I find the idea fascinating, but we'd need to apply strict validations >> against the usual problems of multiple inheritance. Many of our >> class-level annotations do not allow repetitions and we'd need to >> evaluate each of them to see if they would be valid if you "inherit" >> multiple of them. >> For example, multiple @ClassBridge annotations could result in a >> composition, but things like @DocumentId shall not be repeated, and I >> wonder if we should allow conflicting fieldname writes. >> >> Other annotations are supposed to represent a function (having a >> unique answer), like @AnalyzerDiscriminator: currently we mandate to >> have only one of them, which keeps things simple and understandable; >> if I have multiple discriminators defined (one on each interface), >> would you expect the function to be applied independently on the >> @Field(s) defined by that interface? >> As someone defining different (independent) interfaces I would expect >> that, as I might not know about someone putting both (more) interfaces >> on a single concrete implementation, and probably the other >> annotations of each interface are expecting that specific >> AnalyzerDiscriminator to be applied to them. >> >> #3 Are #1 and #2 unrelated? >> >> I suspect they are not, IMHO if we do inheritance of annotations, >> inheriting them from interfaces is the next natural and consistent >> step. Or not? >> So it would be important to evaluate their link before committing on >> either, as it seems both have consequences. >> >> #4 Any example of inconsistent experience for ORM users to handle our >> inheritance "differently"? >> >> *differently* is a biased term though as it suggests some violation of >> least surprise, but actually as a user myself and as I think suggested >> by various other users as well, while the ORM rules are clear this >> missing inheritance in Search seems to have been a surprise to many. I >> suspect people understand the two things are quite different and we >> should pick a consistent rule (like decide to reject HSEARCH-383 ?) >> >> >> Thanks a lot for any feedback, >> Sanne >> >> >> https://hibernate.atlassian.net/browse/HSEARCH-1656 >> https://hibernate.atlassian.net/browse/HSEARCH-249 >> https://hibernate.atlassian.net/browse/HSEARCH-1231 >> https://hibernate.atlassian.net/browse/HSEARCH-383 >> _______________________________________________ >> hibernate-dev mailing list >> hibernate-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/hibernate-dev From guillaume.smet at gmail.com Thu Aug 21 15:26:52 2014 From: guillaume.smet at gmail.com (Guillaume Smet) Date: Thu, 21 Aug 2014 21:26:52 +0200 Subject: [hibernate-dev] [Search] Internship next year Message-ID: Hi, Just a heads up: I'm going to propose an internship this year (scholar year more precisely) on Hibernate Search contribution. I'm not sure I'll find the good intern for this but that's the plan. The internship season usually starts in Feb/March in France so it's for early next year. The internship is located in Lyon, France and if you happen to meet a good student interested in it, I'll be glad to meet him. I usually am interested in final year student of French "Grandes Ecoles" as we name it here but brilliant persons in general are welcome :). I have a couple of subjects in mind (like finishing the work I started on plain text search) but I'm sure we'll be able to find good ideas to keep a person busy during several months! -- Guillaume From jholusa at redhat.com Fri Aug 22 04:34:55 2014 From: jholusa at redhat.com (Jiri Holusa) Date: Fri, 22 Aug 2014 04:34:55 -0400 (EDT) Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: References: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> Message-ID: <1781699732.27148367.1408696495243.JavaMail.zimbra@redhat.com> Hi Gunnar, thanks for your reply, see the comments inline. ----- Original Message ----- > From: "Gunnar Morling" > To: "Jiri Holusa" > Cc: hibernate-dev at lists.jboss.org > Sent: Thursday, August 21, 2014 8:55:49 AM > Subject: Re: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal > Hi Jirka, > Welcome and many thanks for your interest in contributing to our projects! > 2014-08-20 16:28 GMT+02:00 Jiri Holusa : >> Hi everybody, >> >> I'm Jirka Holusa and I work JDG QA (Infinispan) team, just for you to >> know, this email has nothing to do with JDG :) >> >> Currently, I looking for a nice topic for a diploma thesis and I came >> across one. I worked with Elasticsearch in my bachelor thesis and I thought >> it would be nice to integrate it with Hibernate. > > >> So I found Hibernate OGM and thought thaht I would like to develop the >> Elasticsearch module for Hibernate OGM. I talked to Emmanuel and Sanne and >> they pretty liked the idea, so they suggested to move the discussion here >> on dev list. >> > > +1 > > So for implementing support for a new datastore in OGM, you'd have to > implement the GridDialect contract basically. This is a very generic > contract which is responsible for persisting (and reading) tuples > (representing entities) as well as associations. In addition, there are > some "facets" which a grid dialect can implement optionally, namely support > for batching (processing several operations in one atomic datastore > invocation) and query support. > > To get started with CRUD, I'd recommend to take a look at the CouchDB (and > MongoDB) dialect as I expect ES to be rather similar. For Couch we use > JAX-RS/Jackson to interact with the store and convert tuples to/from JSON > documents. I guess some parts of the CouchDB dialect could be extracted and > shared by both backends. I see. Ok, I will take a look into the CouchDB and MongoDB implementations and probably take some inspiration :) > >> I would love to read all your suggestions/proposals/tip etc. The rough plan >> is to first implement the JPA API (therefor CRUD operations) and once this >> is finished, implement search capabilities via Hibernate Search API. >> > > Ironically, search will be the more challenging part. As you know, HSearch > only supports direct Lucene access at this point. Ideally, that issue would > be resolved first (a very interesting topic for a diploma thesis on its own > right ;). Then we could simply plug-in HSearch for full-text queries > executed via ES. Note that in this case the complete entity can be obtained > from the search backend, I'm not sure whether that possibility is already > foreseen in HSearch? > > An alternative which may be a bit simpler and give quicker success for > simplistic queries would be to implement an ES backend of our pluggable > HQL/JP-QL parser. We already have implementations of this which take HQL > queries and translate them into corresponding MongoDB/Neo4j queries, so the > same should be doable for ES. But this wouldn't really carry semantics of > full-text queries (fuzzy search etc.) as one could get it via HSearch and > might expect for a backend such as ES. Hmm, first approach seems to me a better way to do it, but as you said, HSearch has to be "undependent" on Lucene first. So I will start with CRUD and see where I can get. Maybe after that, something around HSearch and Lucene will be resolved, so than I could decide whick approarch to use. > > >> I looking forward to your replies. >> > > Regarding the diploma thesis, how would this exactly work? Are there e.g. > any restrictions in the ways the code you write as part of this can be > used, or are we meant to "supervise" parts of the thesis in any way? It'd > be interesting to learn more about the formal/administrative aspects of > this. I'm glad that you're interested :) Well, this idea of making the module to Elasticsearch comes from my desire to contribute to Hibernate project somehow, so I decided that I would try to do this. Than I realized I could make a diploma thesis out of it, two birds with a one stone :) I am currently starting the master studies, so I have 2 years before my final exams and defence of diploma thesis. So I thought that I would start coding it and if it goes well, next year I start writing the thesis about it. But basically, it works like this. I have to create a thesis intructions that consists of point I have to check. Than I have to find a "formal" supervisor in university that will usually help me with the thesis text. Besides him I can find some advisors that will help me with technical things. That's because the "formal" supervisor doesn't always have to understand the topic as much. Last part is that after finishing thesis I have to find an oponent that will write his opinion on the thesis. Maybe somebody from hibernate-dev could become him, but that a distant future :) To summarize, you could "supervise" my work in a way as a contribution. If you help me to make the code great and it will become integrated and you're satisfied with it, it would be excellent. Usually the profesors are quite impressed if something is accepted by community and integrated into the project, so that should do the trick :) Thanks once again for the feedback, Jirka > > Hope this provides some food for thought. Just ping us here on the list or > #hibernate-dev on FreeNode to discuss any details. > > >> Cheers, >> Jirka > >> --Gunnar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From hardy at hibernate.org Fri Aug 22 04:51:16 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 10:51:16 +0200 Subject: [hibernate-dev] Test sending email to list Message-ID: $subject From emmanuel at hibernate.org Fri Aug 22 05:08:48 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Fri, 22 Aug 2014 11:08:48 +0200 Subject: [hibernate-dev] [Search] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: <15CB2183-3B8F-40A3-AC05-D88C59B19574@hibernate.org> References: <20140821150329.GB97704@hibernate.org> <15CB2183-3B8F-40A3-AC05-D88C59B19574@hibernate.org> Message-ID: <20140822090848.GA657@hibernate.org> On Thu 2014-08-21 19:48, Hardy Ferentschik wrote: > > On 21 Jan 2014, at 17:03, Emmanuel Bernard wrote: > > > Your idea of reusing Jandex won't quite fully work when people put their > > classes in different jars. > > Well, the assumption of course is that we can handed a aggregated/composite index > over all jars. > > There is a caveat though, we keep talking that we get the index from a container or > from ORM, but we need to take care of building our own index as well in case we don?t > get a Jandex index passed. In this case we need to scan classes. The hard part (and I did it in Hibernate EM) is 1. to find all jars involved: the discovery mechanism is pretty much working by accident and classloader hacking 2. to scan the jar: it's easy for zip or directory based JARs, not so easy for JARS made of different URL prototols and opaque URLs > > On the other side, ORM does the Jandex building thing as well on the metamodel branch. > So I guess that once we depend on ORM 5 we can get in all cases a Jandex index. > Question is when that will be? Remember, Hibernate Search is not ORM only. So the discovery mechanism cannot fully depend on an ORM feature not as a hard dep at least. From hardy at hibernate.org Fri Aug 22 05:17:39 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 11:17:39 +0200 Subject: [hibernate-dev] Try sending signed test email Message-ID: see $subject -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140822/2c6369fb/attachment.bin From hardy at hibernate.org Fri Aug 22 05:36:50 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 11:36:50 +0200 Subject: [hibernate-dev] Radio silence Message-ID: <5A6E9487-03AA-43A0-90C2-DB890CCB333B@hibernate.org> Hi there, A couple of months ago I started GPG signing my emails. As it turns out the hibernate-dev mailing list silently ignored/discarded all my emails since then. As per configuration all emails with any type of attachment were ignored. Hence the two months radio silence of mine. Some of you got also direct replies to the emails I replied to, so not all is lost. I still will resend some of my latest emails, since they are responses to general discussions. Sorry about that :-( ?Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140822/335acafc/attachment.bin From hardy at hibernate.org Fri Aug 22 05:38:22 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 11:38:22 +0200 Subject: [hibernate-dev] [Search] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: References: Message-ID: <01CF9C55-1DE5-4F28-8BBB-D90B0E60189E@hibernate.org> On 21 Jan 2014, at 15:50, Sanne Grinovero wrote: > HSEARCH-383 - Hibernate Search does not respect the @AccessType > annotation in respect to @Id fields. > > is that we don't necessarily follow the same rules as Hibernate ORM. > Also we're currently aiming at more flexible models, not least as > needed by protobuf encoded models like in Infinispan Query, but we > want of course to be consistent for users of Hibernate ORM. I would like to stay away from trying to understand access type rules in Search. It is not the job of Search to understand JPA behaviour. IMO the fact that we use @Id in case there is not specific @DocumentId is just a nice little feature. If you start using @Id mixed with @AccesType and things do not work as expected anymore, then you should just switch to a explicit @DocumentId > So questions: > > #1 Why don't we assume subclasses of an @Indexed entity is indexed as well? > > A comment in HSEARCH-1231 points out that this would need classpath > scanning, but > a) If it makes sense we should JFDI, or explore Jandex superpowers to help. I think we can/should consider sub classes as well. However, I would indeed first switch to Jandex. I don?t see this issue as a high priority and working things out in the current code will take time which will be wasted once we switch to Jandex. There the processing would work a bit differently and in fact easier. > #2 Is HSEARCH-1656 a good idea? Again, I would probably hold of on this for now. ?Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140822/a5922998/attachment.bin From hardy at hibernate.org Fri Aug 22 05:38:59 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 11:38:59 +0200 Subject: [hibernate-dev] Redefining inheritance mapping, and why to follow same rules as ORM In-Reply-To: <53F62FA4.20209@thk-systems.de> References: <53F62F62.3030508@thomas-kuhlmann.de> <53F62FA4.20209@thk-systems.de> Message-ID: <972AB0C9-5928-4DF1-A16B-56367CFA46B3@hibernate.org> On 21 Jan 2014, at 15:50, Sanne Grinovero wrote: > HSEARCH-383 - Hibernate Search does not respect the @AccessType > annotation in respect to @Id fields. > > is that we don't necessarily follow the same rules as Hibernate ORM. > Also we're currently aiming at more flexible models, not least as > needed by protobuf encoded models like in Infinispan Query, but we > want of course to be consistent for users of Hibernate ORM. I would like to stay away from trying to understand access type rules in Search. It is not the job of Search to understand JPA behaviour. IMO the fact that we use @Id in case there is not specific @DocumentId is just a nice little feature. If you start using @Id mixed with @AccesType and things do not work as expected anymore, then you should just switch to a explicit @DocumentId > So questions: > > #1 Why don't we assume subclasses of an @Indexed entity is indexed as well? > > A comment in HSEARCH-1231 points out that this would need classpath > scanning, but > a) If it makes sense we should JFDI, or explore Jandex superpowers to help. I think we can/should consider sub classes as well. However, I would indeed first switch to Jandex. I don?t see this issue as a high priority and working things out in the current code will take time which will be wasted once we switch to Jandex. There the processing would work a bit differently and in fact easier. > #2 Is HSEARCH-1656 a good idea? Again, I would probably hold of on this for now. ?Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140822/debf069f/attachment.bin From hardy at hibernate.org Fri Aug 22 05:40:23 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 11:40:23 +0200 Subject: [hibernate-dev] HSearch 5.0 In-Reply-To: References: Message-ID: <47591C45-6867-4D5E-8A07-0C42F35E5DB0@hibernate.org> > Another thing I forgot to mention is that I'm hoping that I will be able to > dump Bobo Browse in favor of Hibernate Search faceting. Currently, HSearch > is too limited still in this respect and I hope this will change with the > new features of Lucene in this area. +1, I am hoping to spend some time on this in the near future. There are several thing we can do. For example we could make use of the dynamic faceting approach available in Lucene now. This we can do with no API changes (we might need some new annotation) and it is significantly faster than the field cache approach. The other thing we need to explore is to make use of the taxonomy index. That would require some changes in the API though. The question then becomes what we expose to the user. Obviously we could just switch to a taxonomy index and keep the user facing faceting API unchanged, but if I know you are after more. I think you created HSEARCH-1550 with some faceting requirements. We for sure take these on board. ?Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140822/76ffbb6d/attachment.bin From hardy at hibernate.org Fri Aug 22 05:44:46 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Fri, 22 Aug 2014 11:44:46 +0200 Subject: [hibernate-dev] Using raw vs. wildcard types In-Reply-To: <20140821133020.GF93689@hibernate.org> References: <20140821133020.GF93689@hibernate.org> Message-ID: On 21 Jan 2014, at 15:30, Emmanuel Bernard wrote: > I do like you do. I often do as well, but less than I used to do. > But I can see why some fall back to the raw type as > it's less "annoying" when developing. Exactly. IMO there was a phase where wildcard types where used everywhere, with little or no use. In the contrary, in some cases they imo obfuscate the code. Take ValidatorImpl for example. By now we reached some sort of balance, but there was a time where we used wildcards left right and centre. It made the code harder to read and often we needed a cast somewhere anyways. ?Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140822/68dc90b8/attachment.bin From emmanuel at hibernate.org Fri Aug 22 08:01:55 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Fri, 22 Aug 2014 14:01:55 +0200 Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: <1781699732.27148367.1408696495243.JavaMail.zimbra@redhat.com> References: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> <1781699732.27148367.1408696495243.JavaMail.zimbra@redhat.com> Message-ID: On 22 Aug 2014, at 10:34, Jiri Holusa wrote: >> An alternative which may be a bit simpler and give quicker success for >> simplistic queries would be to implement an ES backend of our pluggable >> HQL/JP-QL parser. We already have implementations of this which take HQL >> queries and translate them into corresponding MongoDB/Neo4j queries, so the >> same should be doable for ES. But this wouldn't really carry semantics of >> full-text queries (fuzzy search etc.) as one could get it via HSearch and >> might expect for a backend such as ES. > > Hmm, first approach seems to me a better way to do it, but as you said, HSearch has to be > "undependent" on Lucene first. So I will start with CRUD and see where I can get. Maybe > after that, something around HSearch and Lucene will be resolved, so than I could decide > whick approarch to use. Gunnar, the direct HQL->ES-QL work is not as trivial as it seems. I don?t think ElasticSearch can search on fields that are not explicitly indexed. (Jiri correct me if I?m wrong). So we would need to guess or anticipate which field wants to be indexed and how ?transparently?. Not the best of settings. From emmanuel at hibernate.org Fri Aug 22 08:05:00 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Fri, 22 Aug 2014 14:05:00 +0200 Subject: [hibernate-dev] Radio silence In-Reply-To: <5A6E9487-03AA-43A0-90C2-DB890CCB333B@hibernate.org> References: <5A6E9487-03AA-43A0-90C2-DB890CCB333B@hibernate.org> Message-ID: <20140822120500.GB8223@hibernate.org> For the record, this is not all attachments. There is a white list of MIME accepted and a blacklist of extensions like the good old .exe. Anyways, for those like Hardy that do not want to keep their plausible deniability options and want to sign their emails, the list now accepts the gpg-signature and signed MIMEs. Emmanuel On Fri 2014-08-22 11:36, Hardy Ferentschik wrote: > Hi there, > > A couple of months ago I started GPG signing my emails. As it turns out the hibernate-dev mailing list silently ignored/discarded all my emails since then. > As per configuration all emails with any type of attachment were ignored. Hence the two months radio silence of mine. > > Some of you got also direct replies to the emails I replied to, so not all is lost. I still will resend some of my latest emails, since they are > responses to general discussions. > > Sorry about that :-( > > ?Hardy > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From gunnar at hibernate.org Fri Aug 22 08:19:16 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Fri, 22 Aug 2014 14:19:16 +0200 Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: References: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> <1781699732.27148367.1408696495243.JavaMail.zimbra@redhat.com> Message-ID: 2014-08-22 14:01 GMT+02:00 Emmanuel Bernard : > > On 22 Aug 2014, at 10:34, Jiri Holusa wrote: > > An alternative which may be a bit simpler and give quicker success for > simplistic queries would be to implement an ES backend of our pluggable > HQL/JP-QL parser. We already have implementations of this which take HQL > queries and translate them into corresponding MongoDB/Neo4j queries, so the > same should be doable for ES. But this wouldn't really carry semantics of > full-text queries (fuzzy search etc.) as one could get it via HSearch and > might expect for a backend such as ES. > > > Hmm, first approach seems to me a better way to do it, but as you said, > HSearch has to be > "undependent" on Lucene first. So I will start with CRUD and see where I > can get. Maybe > after that, something around HSearch and Lucene will be resolved, so than > I could decide > whick approarch to use. > > > Gunnar, the direct HQL->ES-QL work is not as trivial as it seems. I don?t > think ElasticSearch can search on fields that are not explicitly indexed. > (Jiri correct me if I?m wrong). So we would need to guess or anticipate > which field wants to be indexed and how ?transparently?. Not the best of > settings. > Interesting, I really need to take a closer look at ES and its APIs. How does it react when searching on an un-indexed field? If we can detect the situation and raise a meaningful exception indicating that an index is missing so a given query can't be run (could even be done during start-up for named queries), then I'd say that's good enough, at least for a first iteration? In particular if we add support for @Index so a user can react. As said that solution would only be a work-around until we can delegate that task to HSearch (which then would have the same challenge probably). Btw. it's the same with Cassandra apparently, you also need to index up-front the columns targeted in queries. --Gunnar From gustavonalle at gmail.com Fri Aug 22 09:03:55 2014 From: gustavonalle at gmail.com (Gustavo Fernandes) Date: Fri, 22 Aug 2014 14:03:55 +0100 Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: References: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> <1781699732.27148367.1408696495243.JavaMail.zimbra@redhat.com> Message-ID: <95158E27-F8D7-4D26-87A3-20B4A1337878@gmail.com> > Interesting, I really need to take a closer look at ES and its APIs. > > How does it react when searching on an un-indexed field? If we can detect > the situation and raise a meaningful exception indicating that an index is > missing so a given query can't be run (could even be done during start-up > for named queries), then I'd say that's good enough, at least for a first > iteration? In particular if we add support for @Index so a user can react. > As said that solution would only be a work-around until we can delegate > that task to HSearch (which then would have the same challenge probably). Hi all, I think the idea of decoupling HSearch backend from Lucene so that it could be used together with Elasticsearch and Solr is pretty interesting. I've discussed this with Sanne a while go, it's nice to see it is gaining traction :) With relation to Elasticsearch, it will index everything by default. From the input Json document, it will "guess" the type based on the Json type, and apart from that it'll save the whole document in a stored Lucene field called _source (and also in the transaction log, for recovery and replication purposes). It is possible to override the indexing behaviour of course, by providing a custom mapping for the indexed 'type', being a 'type' the equivalent of an 'entity'. Since every single operations can be done via Rest API, it is straightforward to drive configuration form other sources. Gustavo From emmanuel at hibernate.org Fri Aug 22 12:25:44 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Fri, 22 Aug 2014 18:25:44 +0200 Subject: [hibernate-dev] Contributing to OGM / Cassandra In-Reply-To: References: <6B5FA68A-59CD-4CAD-81EB-3AC2CCBBE55C@hibernate.org> Message-ID: <20140822162544.GM8223@hibernate.org> On Thu 2014-08-07 9:10, John Worrell wrote: > Hi Emmanuel et al., > > My apologies for the log radio silence. I've taken a look at the code-base > on Jon Halliday's repo, and have set up a nick on freenode - #jlesinge. No worries I was on holidays. And you email was the few lucky ones that I had to delay as it required thinking ;) > > On the time-series question I was wondering how you envisaged the data > stored: I tend to think of a single row under an primary key with an > object-instance per column. Now what we have typically done (generally the > data has been immutable) is to store the data serialized as a blob (JSON or > XML), but I understand you do not favour this approach. With this sort of > model I imagine the collection is then all the objects stored in the row, > and the challenge is to page through the objects in the row. Actually it is one of the valid strategies. If I understand you well, you want to create: - one row per time series generating object (say a thermometer) - the column names of that row would be a timestamp of time at bay - the value would be a JSON structure containing the data at bay for that specific time. That is one of the valid approach. But I think we need to support several: - simple column if the data is literally a single element (temperature) - JSON structure for more complex data per time event - key pointing to the detailed data somewhere else in the cluster The latest would be done in two phases, you load all the keys you are interested in matching your time range and then do a multiget of sort to load the data. It seems datastax tends to recommend 1 or 2 (denormalization FTW). I don't know but there is also the notion of super column which is a grouping of columns that might also address our composite problem assuming they can be used for dynamic column families. http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra http://planetcassandra.org/blog/post/getting-started-with-time-series-data-modeling/ http://www.datastax.com/docs/1.0/ddl/column_family > > An approach we have often taken is to create multiple copies of data in > different (obviously works well only for immutable objects) or better to Yes, that is a feature that I would like OGM to automate for the user. It declaratively defines the denormalization approaches he wants and the engine does the persistence. Next the query engine uses that knowledge to find the best path (or only possible path in the case of Cassandra :) ) > create a table of keys to a main table where in either approach the > row-keys are effectively a foreign-key and there is column per object > associated through the foreign-key. Another approach though might be to use > a column with type list (or set, or map) to contain keys to the associated > objects - this would be a little like the extensions Oracle have for > mapping 1-* associations, though with the caveat that a column of > collection type may only contain 64k elements. I wondered if some though > had been given to this strategy (which I must admit I have not yet used > myself). I am not aware of that approach. > > It seems very likely that different mapping strategies should be > specifiable, but then I have still to understand how these might fit with > treiid. Forget Teiid for now. We will likely start with the HQL->Walker and do our own proto query engine before layering Teiid. > > Can I ask about assumptions: is it fair to assume that for Cassandra, OGM > will target only CQL 3 (which means Cassandra 2 or maybe 1.2)? This would > certainly make life simpler. Yes that's fine. > > An issue I don't see addressed is the choice of consistency-level (read or > write) and I wondered if there was a plan for this? Assumptions can be made > on a per table basis, but, certainly for ad hoc queries, it is important > think to have the flexibility to specify on a per-query basis. That's planned. We have an option system that allow for entity / property overriding of a global setting. While not implemented, we will also have the ability to override setting per session / query. That was the plan all along. > > Those are my thoughts so far... I'll see about doing a POC of some of what > I have described above Thanks :) > > Cheers, > > John > > > On Mon, Jul 21, 2014 at 4:48 PM, John Worrell wrote: > > > Hi Emmanuel, > > > > I'll take a look at what is there, and I'll get up and running on IRC. > > > > I'll particularly look at the time-series issue - non-trivial I think. > > > > Cheers, > > > > John > > > > > > On Mon, Jul 21, 2014 at 1:06 PM, Emmanuel Bernard > > wrote: > > > >> Hi John, > >> > >> I thought I had replied to you on Friday but apparently the email never > >> went through :/ > >> > >> That is good news :) > >> Jonathan worked on a Cassandra prototype but had to drop due to other > >> duties. He pushed everything at > >> https://github.com/jhalliday/hibernate-ogm/tree/jonathan_cassandra > >> > >> Have a look at what he has done and come ask any question to Gunnar, > >> Davide or me. There are a bunch of moving pieces. We are mostly on > >> freenode?s #hibernate-dev ( you need a freenode login > >> http://freenode.net/faq.shtml#nicksetup ). If you are allergic to IRC, > >> let me know and we will find alternatives. > >> > >> The most interesting challenge will be to see how we can map time series > >> into a collection and make sure we let the user decide how much he wants to > >> load. > >> > >> Emmanuel > >> > >> On 16 Jul 2014, at 13:17, John Worrell wrote: > >> > >> > Hi, > >> > > >> > I'm interested in contributing to the Cassandra module of Hibernate-OGM > >> - > >> > what would be the baest way to go about this? > >> > > >> > Thanks, > >> > > >> > John > >> > _______________________________________________ > >> > hibernate-dev mailing list > >> > hibernate-dev at lists.jboss.org > >> > https://lists.jboss.org/mailman/listinfo/hibernate-dev > >> > >> > > From smarlow at redhat.com Fri Aug 22 13:43:56 2014 From: smarlow at redhat.com (Scott Marlow) Date: Fri, 22 Aug 2014 13:43:56 -0400 Subject: [hibernate-dev] what does ""DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (EJB default - 6) Skipping JTA sync registration due to auto join checking" mean? In-Reply-To: References: <53ECD45F.4080900@redhat.com> <53ECE3B9.6040208@redhat.com> Message-ID: <53F7815C.8020605@redhat.com> On 08/14/2014 12:32 PM, Steve Ebersole wrote: > Or you could just ask them ;) I might not getting enough detail from the answer. Best to have trace output. Speaking of which, https://gist.github.com/scottmarlow/b7fe320f5a2ea7969170 shows a transaction scoped persistence context is created within a JTA transaction. I don't understand why we see the "Skipping JTA sync registration..." message and we then see that ORM registered a Sync via TransactionSynchronizationRegistry.registerInterposedSynchronization(), which is followed by TransactionCoordinatorImpl logging "successfully registered Synchronization". Also (unrelated to the above question), after some IRC discussion about [3] and why Hibernate registers a Synchronization callback per session (at the JTA transaction level). I'm wondering if we should consider having a Hibernate classloader level (TransactionLocal) collection of hibernate session sync callbacks, so that we only have one Hibernate Synchronization registered and we could close the database connection (within the TXN) after running all of the per session syncs. This could be two passes: For each Session: session.beforeCompletion(); For each Session: session.closeDBConnections(); Thoughts? Scott [3] https://community.jboss.org/message/901701 > > > On Thu, Aug 14, 2014 at 11:28 AM, Scott Marlow > wrote: > > > On 08/14/2014 11:59 AM, Steve Ebersole wrote: > > Well it *should* mean that the EM in question was created > outside the > scope of a transaction. The JPA spec says that in cases of an > application-managed PC where the EM is created outside the scope > of the > JTA txn, the provider should not automatically join the EM to > any JTA > txn later implicitly. Instead the expectation is for the > application to > explicitly join the EM to the transaction via the > EM.joinTransaction method: > > > When a JTA application-managed entity manager is used, if the entity > manager is created outside the > scope of the current JTA transaction, it is the responsibility > of the > application to join the entity manager > to the transaction (if desired) by calling > EntityManager.joinTransaction. If the entity man- > ager is created outside the scope of a JTA transaction, it is > not joined > to the transaction unless Entity- > Manager.joinTransaction is called. > > > Note this behavior was made somewhat controllable in JPA 2.1 > with the > introduction of SynchronizationType. > > I'd have to refresh my memory on the expectation here wrt > container-managed PCs. So that would be my first question to > you of the > situation... Is this a app or container managed PC? > > It is odd that they see a "local database transaction" instead > though. > You sure this isn't a series of auto-commit transactions? > > > I won't be sure until they enable TRACE logging for org.jboss.as.jpa > and give us more logs. I'm waiting for that. > > > > > > On Thu, Aug 14, 2014 at 10:23 AM, Scott Marlow > > >> wrote: > > I'm trying to help a user [1] that is complaining that a > local database > transaction is used, instead of the JTA transaction as they > expect. I > asked them to enable TRACE logging for { org.jboss.jca, > org.hibernate, > org.jboss.as.jpa + com.arjuna} and see the "Skipping JTA sync > registration due to auto join checking" log message. > > What does the "skipping JTA sync registration due to auto > join checking" > mean exactly? [2] shows a small example of the log output > with an > active JTA transaction in use. > > Scott > > > [1] https://issues.jboss.org/__browse/WFLY-3619 > XA END / un-enlist for > database connection called to early > > [2] http://fpaste.org/125603/__80296401/ > > _________________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > > > > https://lists.jboss.org/__mailman/listinfo/hibernate-dev > > > > > From guillaume.smet at gmail.com Fri Aug 22 17:25:53 2014 From: guillaume.smet at gmail.com (Guillaume Smet) Date: Fri, 22 Aug 2014 23:25:53 +0200 Subject: [hibernate-dev] Search - HSEARCH-1580 - Dependency graph In-Reply-To: References: <68C8A0F4-69D1-4C07-B8B7-147813F3EC51@hibernate.org> Message-ID: On Thu, Aug 21, 2014 at 5:32 PM, Sanne Grinovero wrote: > I understand. If this is a good time for your team to do such > experiments, I'm willing to switch to weekly tags, or even bi-weekly > if there's need, as two other teams seem to be in the same good mood We'll have the bandwidth starting from september 15th so if we have a release then, we'll start playing with 5. So no need to hurry for us. -- Guillaume From jholusa at redhat.com Mon Aug 25 04:57:50 2014 From: jholusa at redhat.com (Jiri Holusa) Date: Mon, 25 Aug 2014 04:57:50 -0400 (EDT) Subject: [hibernate-dev] Support for Elasticsearch in Hibernate OGM proposal In-Reply-To: References: <1000099339.25886531.1408544527552.JavaMail.zimbra@redhat.com> <361589516.25892334.1408544885036.JavaMail.zimbra@redhat.com> <1781699732.27148367.1408696495243.JavaMail.zimbra@redhat.com> Message-ID: <1909264.27936633.1408957070003.JavaMail.zimbra@redhat.com> > >> Gunnar, the direct HQL->ES-QL work is not as trivial as it seems. I don?t >> think ElasticSearch can search on fields that are not explicitly indexed. >> (Jiri correct me if I?m wrong). So we would need to guess or anticipate >> which field wants to be indexed and how ?transparently?. Not the best of >> settings. > This is correct, you cannot search on fields that are not indexed. You can of course store them, but cannot perform queries on them. > > Interesting, I really need to take a closer look at ES and its APIs. > > How does it react when searching on an un-indexed field? If we can detect > the situation and raise a meaningful exception indicating that an index is > missing so a given query can't be run (could even be done during start-up > for named queries), then I'd say that's good enough, at least for a first > iteration? In particular if we add support for @Index so a user can react. > As said that solution would only be a work-around until we can delegate > that task to HSearch (which then would have the same challenge probably). > When search on an un-indexed field, Elasticsearch will not raise any notice, warning, error, nothing. It will just not match and therefore returns empty result. However, you can find out if the field is indexed by reading it from mapping [1]. Therefore, you are able to detect this situation. Jirka [1] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html#indices-get-mapping From emmanuel at hibernate.org Mon Aug 25 11:42:33 2014 From: emmanuel at hibernate.org (Emmanuel Bernard) Date: Mon, 25 Aug 2014 17:42:33 +0200 Subject: [hibernate-dev] [OGM] AssociationPersister.collectionPersister() Message-ID: >From what I could look at, AssociationPersister.collectionPersister() + inverse() is only called in OgmCollectionPersister.updateInverseSideOfAssociationNavigation() and the owning side CollectionPersister is provided. So to answer your question > is the collection persister passed to AssociationPersister#collectionPersister() supposed to always be the one from the main side? or the one from the currently processed side of the association? The OgmCollectionPersister only do things if it is on the main side (ie not an inverse collection). So only the persister from the main side is provided. From steve at hibernate.org Mon Aug 25 12:33:32 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 25 Aug 2014 11:33:32 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: On Mon, Aug 18, 2014 at 2:14 AM, Gunnar Morling wrote: > Hi Steve, > > Thanks for writing up these rules. That's very valuable information for > users and us as well. > > Only two remarks on the following: > > > The use of package names for this is unfortunately not granular enough > oftentimes. > > Ultimately I would envision a better solution (annotations?) > > In which cases is it not granular enough? Can such case not always be > circumvented by refactoring code into separate classes within separate > packages? > > I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. > internal parts on a finer level than the package, as that's what OSGi but > also JBoss Modules rely on. We cannot fully leverage the ability of these > module systems to "hide" internal parts of a module in that case. > > Also I think annotations are easier to "miss" than package names when > importing classes into an application, thus I'm concerned about accidental > referencing internal classes. > To be honest I don't remember the situations I have run into that brought me to that conclusion. > > > SPI contracts should be considered stable within a release family, not > necessarily across different release families. > > A specific example, similar to the API section, would be nice, e.g.: "If > you implement an application against an integration point from Hibernate > ORM 4.3.0, the expectation is that it works without changes when updating > to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x in > the very most cases, but that's not guaranteed." > Actually the 4.3 -> 4.4 bit here is not really accurate, and illustrates the main difference between an API and an SPI. Most of the time, yes, using an SPI method from 4.3 and upgrading to 4.4 will work flawlessly. But that is in no way by design; it just means that it worked by happenstance. Which is fine for SPI use from applications, but I think explains why we often run into problems with upgrades to ORM in regards to other Hibernate projects, since the Hibernate projects tend to use a high number of these SPIs. This would also be good to discuss. From steve at hibernate.org Mon Aug 25 12:37:34 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 25 Aug 2014 11:37:34 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: This is all certainly true. I think specifically of things like persisters, which by "package break down" are currently considered API. Also, as far as OSGi, I would suggest not worrying about that so much (Gunnar). Keep in mind that even today this OSGi manifest info is generated by build logic. Changing that build logic to look at annotations rather that parsing .class file path is not that big of a deal imo. Devil's-in-the-details of course, but in theory it should not be a big deal. On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero wrote: > I won't speak for Steve's reasons, but I agree with the granularity > problem. > > For example you might not want to refactor the code to promote an SPI > to API (or simply fix a mistake), or viceversa demote an API to SPI, > as you moving the packages around would break backwards compatibility. > Essentially this means you can only fix the packages in that short > time in which you're in Alpha/Beta phase for a new major release, > which is a short period in which usually the team has other > priorities. > > The best example is ORM itself in it's current shape: we all know that > some classes should be moved into SPI or Impl, but we can't touch > them. > If your goal is to publish a nice set of javadocs for users which has > API only, annotations would allow to do this. > > Sanne > > > On 18 August 2014 08:14, Gunnar Morling wrote: > > Hi Steve, > > > > Thanks for writing up these rules. That's very valuable information for > > users and us as well. > > > > Only two remarks on the following: > > > >> The use of package names for this is unfortunately not granular enough > > oftentimes. > >> Ultimately I would envision a better solution (annotations?) > > > > In which cases is it not granular enough? Can such case not always be > > circumvented by refactoring code into separate classes within separate > > packages? > > > > I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. > > internal parts on a finer level than the package, as that's what OSGi but > > also JBoss Modules rely on. We cannot fully leverage the ability of these > > module systems to "hide" internal parts of a module in that case. > > > > Also I think annotations are easier to "miss" than package names when > > importing classes into an application, thus I'm concerned about > accidental > > referencing internal classes. > > > >> SPI contracts should be considered stable within a release family, not > > necessarily across different release families. > > > > A specific example, similar to the API section, would be nice, e.g.: "If > > you implement an application against an integration point from Hibernate > > ORM 4.3.0, the expectation is that it works without changes when updating > > to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x > in > > the very most cases, but that's not guaranteed." > > > > --Gunnar > > > > > > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : > > > >> There was a discussion in regards to our view on backwards > compatibility in > >> reference to HHH-9316. I realized that we talk about this amongst > >> ourselves, but that I have never written these down. So I did that: > >> > >> > >> > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > >> > >> This is a first draft. Let me know what you think. > >> _______________________________________________ > >> 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 Mon Aug 25 12:41:01 2014 From: steve at hibernate.org (Steve Ebersole) Date: Mon, 25 Aug 2014 11:41:01 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: <20140821142640.GH93689@hibernate.org> References: <20140821142640.GH93689@hibernate.org> Message-ID: On Thu, Aug 21, 2014 at 9:26 AM, Emmanuel Bernard wrote: > Awesome write up. I will for sure steal a lot of it :) > > A few random comments: > > - once we are sufficiently happy, we probably should move this to the > website > That was the intent :) > - you mention backward compatibility and leave aside source vs binary > backward compatibility. Do we want to dive on this subject? The later > is of course much harder even though relatively well defined for Java. > True. We probably should. I think too this breaks down along the same lines delineated already. Meaning that I personally see the guidelines differently here for API versus SPI across releases. I guess we should come up with a formal declaration of what we want here. > > Emmanuel > > On Sat 2014-08-09 9:55, Steve Ebersole wrote: > > There was a discussion in regards to our view on backwards compatibility > in > > reference to HHH-9316. I realized that we talk about this amongst > > ourselves, but that I have never written these down. So I did that: > > > > > https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations > > > > This is a first draft. Let me know what you think. > > _______________________________________________ > > hibernate-dev mailing list > > hibernate-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From hardy at hibernate.org Mon Aug 25 17:55:24 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Mon, 25 Aug 2014 23:55:24 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: <1632252A-B052-4A1D-BD49-0DBC799D8C99@hibernate.org> On 25 Jan 2014, at 18:37, Steve Ebersole wrote: > This is all certainly true. I think specifically of things like > persisters, which by "package break down" are currently considered API. > > Also, as far as OSGi, I would suggest not worrying about that so much > (Gunnar). Keep in mind that even today this OSGi manifest info is > generated by build logic. Changing that build logic to look at annotations > rather that parsing .class file path is not that big of a deal imo. > Devil's-in-the-details of course, but in theory it should not be a big > deal. I agree that the generation of the OSGi metadata via annotation would not be such a big problem, however, OSGi does afaik not allow to configure modules on a class level. The fines granularity on what is exported is on package level. Just saying. ?Hardy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20140825/ba645189/attachment.bin From gunnar at hibernate.org Tue Aug 26 02:22:20 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Tue, 26 Aug 2014 08:22:20 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: 2014-08-25 18:33 GMT+02:00 Steve Ebersole : > On Mon, Aug 18, 2014 at 2:14 AM, Gunnar Morling > wrote: > >> Hi Steve, >> >> Thanks for writing up these rules. That's very valuable information for >> users and us as well. >> >> Only two remarks on the following: >> >> > The use of package names for this is unfortunately not granular enough >> oftentimes. >> > Ultimately I would envision a better solution (annotations?) >> >> In which cases is it not granular enough? Can such case not always be >> circumvented by refactoring code into separate classes within separate >> packages? >> >> I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. >> internal parts on a finer level than the package, as that's what OSGi but >> also JBoss Modules rely on. We cannot fully leverage the ability of these >> module systems to "hide" internal parts of a module in that case. >> >> Also I think annotations are easier to "miss" than package names when >> importing classes into an application, thus I'm concerned about accidental >> referencing internal classes. >> > > To be honest I don't remember the situations I have run into that brought > me to that conclusion. > Hard to argue against that :) I think what troubles me that the information about public/private is "one step farther away". E.g. when examining a client program which imports stuff from a package with "internal" in its name, this flaw is easily detectable just by looking at the program. Whereas with an annotation-based approach, you need to look at the imported types themselves to learn about any un-wanted imports in the client program. > SPI contracts should be considered stable within a release family, not >> necessarily across different release families. >> >> A specific example, similar to the API section, would be nice, e.g.: "If >> you implement an application against an integration point from Hibernate >> ORM 4.3.0, the expectation is that it works without changes when updating >> to ORM 4.3.1. It should also continue to work when updating to ORM 4.4.x in >> the very most cases, but that's not guaranteed." >> > > Actually the 4.3 -> 4.4 bit here is not really accurate, and illustrates > the main difference between an API and an SPI. Most of the time, yes, > using an SPI method from 4.3 and upgrading to 4.4 will work flawlessly. > But that is in no way by design; it just means that it worked by > happenstance. > Really, it's not by design? I'd expect that we work hard to also keep SPIs backwards-compatible, that we don't break them easily but only if it's there is no reasonable way around it. > Which is fine for SPI use from applications, but I think explains why we > often run into problems with upgrades to ORM in regards to other Hibernate > projects, since the Hibernate projects tend to use a high number of these > SPIs. This would also be good to discuss. > > > From gunnar at hibernate.org Tue Aug 26 02:25:26 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Tue, 26 Aug 2014 08:25:26 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: <1632252A-B052-4A1D-BD49-0DBC799D8C99@hibernate.org> References: <1632252A-B052-4A1D-BD49-0DBC799D8C99@hibernate.org> Message-ID: 2014-08-25 23:55 GMT+02:00 Hardy Ferentschik : > > On 25 Jan 2014, at 18:37, Steve Ebersole wrote: > > > This is all certainly true. I think specifically of things like > > persisters, which by "package break down" are currently considered API. > > > > Also, as far as OSGi, I would suggest not worrying about that so much > > (Gunnar). Keep in mind that even today this OSGi manifest info is > > generated by build logic. Changing that build logic to look at > annotations > > rather that parsing .class file path is not that big of a deal imo. > > Devil's-in-the-details of course, but in theory it should not be a big > > deal. > > I agree that the generation of the OSGi metadata via annotation would not > be such a big > problem, however, OSGi does afaik not allow to configure modules on a > class level. The > fines granularity on what is exported is on package level. Just saying. > Right, AFAICS the granularity in OSGi (what concerns exporting/importing APIs but also versioning) is the package. I don't think exporting single types within a package while not exporting others is possible. > ?Hardy > > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev > From gunnar at hibernate.org Tue Aug 26 02:34:51 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Tue, 26 Aug 2014 08:34:51 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: 2014-08-25 18:37 GMT+02:00 Steve Ebersole : > This is all certainly true. I think specifically of things like > persisters, which by "package break down" are currently considered API. > That's a good example. You say based on their package they are considered API, but is that what you actually want for these types? Or, if these types actually should not be considered an API, why can't they be moved? If it's about not wanting to break existing users, I'd say then either a) these types actually *are* an API (why otherwise would we care about backwards compatibility with clients) or b) I wouldn't care about the breakage (in a major release such as 5) because clients should not have used those actually internal parts to begin with. Maybe the fact that those parts are internal was not communicated clearly enough, but a major release seems like the right occasion to fix this then. Also, as far as OSGi, I would suggest not worrying about that so much > (Gunnar). Keep in mind that even today this OSGi manifest info is > generated by build logic. Changing that build logic to look at annotations > rather that parsing .class file path is not that big of a deal imo. > Devil's-in-the-details of course, but in theory it should not be a big > deal. > > > On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero > wrote: > >> I won't speak for Steve's reasons, but I agree with the granularity >> problem. >> >> For example you might not want to refactor the code to promote an SPI >> to API (or simply fix a mistake), or viceversa demote an API to SPI, >> as you moving the packages around would break backwards compatibility. >> Essentially this means you can only fix the packages in that short >> time in which you're in Alpha/Beta phase for a new major release, >> which is a short period in which usually the team has other >> priorities. >> >> The best example is ORM itself in it's current shape: we all know that >> some classes should be moved into SPI or Impl, but we can't touch >> them. >> If your goal is to publish a nice set of javadocs for users which has >> API only, annotations would allow to do this. >> >> Sanne >> >> >> On 18 August 2014 08:14, Gunnar Morling wrote: >> > Hi Steve, >> > >> > Thanks for writing up these rules. That's very valuable information for >> > users and us as well. >> > >> > Only two remarks on the following: >> > >> >> The use of package names for this is unfortunately not granular enough >> > oftentimes. >> >> Ultimately I would envision a better solution (annotations?) >> > >> > In which cases is it not granular enough? Can such case not always be >> > circumvented by refactoring code into separate classes within separate >> > packages? >> > >> > I'm fearing issues with e.g. distinguishing between public (API/SPI) vs. >> > internal parts on a finer level than the package, as that's what OSGi >> but >> > also JBoss Modules rely on. We cannot fully leverage the ability of >> these >> > module systems to "hide" internal parts of a module in that case. >> > >> > Also I think annotations are easier to "miss" than package names when >> > importing classes into an application, thus I'm concerned about >> accidental >> > referencing internal classes. >> > >> >> SPI contracts should be considered stable within a release family, not >> > necessarily across different release families. >> > >> > A specific example, similar to the API section, would be nice, e.g.: "If >> > you implement an application against an integration point from Hibernate >> > ORM 4.3.0, the expectation is that it works without changes when >> updating >> > to ORM 4.3.1. It should also continue to work when updating to ORM >> 4.4.x in >> > the very most cases, but that's not guaranteed." >> > >> > --Gunnar >> > >> > >> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >> > >> >> There was a discussion in regards to our view on backwards >> compatibility in >> >> reference to HHH-9316. I realized that we talk about this amongst >> >> ourselves, but that I have never written these down. So I did that: >> >> >> >> >> >> >> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >> >> >> >> This is a first draft. Let me know what you think. >> >> _______________________________________________ >> >> 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 gunnar at hibernate.org Tue Aug 26 04:35:07 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Tue, 26 Aug 2014 10:35:07 +0200 Subject: [hibernate-dev] [OGM] AssociationPersister.collectionPersister() In-Reply-To: References: Message-ID: 2014-08-25 17:42 GMT+02:00 Emmanuel Bernard : > From what I could look at, AssociationPersister.collectionPersister() + > inverse() is only called in > OgmCollectionPersister.updateInverseSideOfAssociationNavigation() and the > owning side CollectionPersister is provided. > > So to answer your question > > > is the collection persister passed to > AssociationPersister#collectionPersister() supposed to always be the one > from the main side? or the one from the currently processed side of the > association? > > The OgmCollectionPersister only do things if it is on the main side (ie > not an inverse collection). So only the persister from the main side is > provided. Thanks for taking a look! I found one case where actually an inverse collection persister may be passed: OgmLoader#getResultSet(). This works atm. as the inverse() flag is not set in this context, also if this actually is the inverse side of a bi-di association. If I set inverse() (as it would make sense and which I'd like to do as I need that info for another purpose), the unexpected persister from the inverse side cause things to fail. I have a workaround atm. but I think we should change it to pass the main side persister here as it's expected by the code in AssociationPersister. WDYT? --Gunnar From steve at hibernate.org Wed Aug 27 01:15:07 2014 From: steve at hibernate.org (Steve Ebersole) Date: Wed, 27 Aug 2014 00:15:07 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: They are an SPI. I'd break many Hibernate projects and third-party integrations if I just moved them... On Tue, Aug 26, 2014 at 1:34 AM, Gunnar Morling wrote: > 2014-08-25 18:37 GMT+02:00 Steve Ebersole : > > This is all certainly true. I think specifically of things like >> persisters, which by "package break down" are currently considered API. >> > > That's a good example. You say based on their package they are considered > API, but is that what you actually want for these types? Or, if these types > actually should not be considered an API, why can't they be moved? > > If it's about not wanting to break existing users, I'd say then either a) > these types actually *are* an API (why otherwise would we care about > backwards compatibility with clients) or b) I wouldn't care about the > breakage (in a major release such as 5) because clients should not have > used those actually internal parts to begin with. Maybe the fact that those > parts are internal was not communicated clearly enough, but a major release > seems like the right occasion to fix this then. > > Also, as far as OSGi, I would suggest not worrying about that so much >> (Gunnar). Keep in mind that even today this OSGi manifest info is >> generated by build logic. Changing that build logic to look at annotations >> rather that parsing .class file path is not that big of a deal imo. >> Devil's-in-the-details of course, but in theory it should not be a big >> deal. >> >> >> On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero >> wrote: >> >>> I won't speak for Steve's reasons, but I agree with the granularity >>> problem. >>> >>> For example you might not want to refactor the code to promote an SPI >>> to API (or simply fix a mistake), or viceversa demote an API to SPI, >>> as you moving the packages around would break backwards compatibility. >>> Essentially this means you can only fix the packages in that short >>> time in which you're in Alpha/Beta phase for a new major release, >>> which is a short period in which usually the team has other >>> priorities. >>> >>> The best example is ORM itself in it's current shape: we all know that >>> some classes should be moved into SPI or Impl, but we can't touch >>> them. >>> If your goal is to publish a nice set of javadocs for users which has >>> API only, annotations would allow to do this. >>> >>> Sanne >>> >>> >>> On 18 August 2014 08:14, Gunnar Morling wrote: >>> > Hi Steve, >>> > >>> > Thanks for writing up these rules. That's very valuable information for >>> > users and us as well. >>> > >>> > Only two remarks on the following: >>> > >>> >> The use of package names for this is unfortunately not granular enough >>> > oftentimes. >>> >> Ultimately I would envision a better solution (annotations?) >>> > >>> > In which cases is it not granular enough? Can such case not always be >>> > circumvented by refactoring code into separate classes within separate >>> > packages? >>> > >>> > I'm fearing issues with e.g. distinguishing between public (API/SPI) >>> vs. >>> > internal parts on a finer level than the package, as that's what OSGi >>> but >>> > also JBoss Modules rely on. We cannot fully leverage the ability of >>> these >>> > module systems to "hide" internal parts of a module in that case. >>> > >>> > Also I think annotations are easier to "miss" than package names when >>> > importing classes into an application, thus I'm concerned about >>> accidental >>> > referencing internal classes. >>> > >>> >> SPI contracts should be considered stable within a release family, not >>> > necessarily across different release families. >>> > >>> > A specific example, similar to the API section, would be nice, e.g.: >>> "If >>> > you implement an application against an integration point from >>> Hibernate >>> > ORM 4.3.0, the expectation is that it works without changes when >>> updating >>> > to ORM 4.3.1. It should also continue to work when updating to ORM >>> 4.4.x in >>> > the very most cases, but that's not guaranteed." >>> > >>> > --Gunnar >>> > >>> > >>> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >>> > >>> >> There was a discussion in regards to our view on backwards >>> compatibility in >>> >> reference to HHH-9316. I realized that we talk about this amongst >>> >> ourselves, but that I have never written these down. So I did that: >>> >> >>> >> >>> >> >>> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >>> >> >>> >> This is a first draft. Let me know what you think. >>> >> _______________________________________________ >>> >> 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 gunnar at hibernate.org Wed Aug 27 02:20:38 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Wed, 27 Aug 2014 08:20:38 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: 2014-08-27 7:15 GMT+02:00 Steve Ebersole : > They are an SPI. I'd break many Hibernate projects and third-party > integrations if I just moved them... > Yes, it would break client code using these SPIs, but isn't such breakage covered by the rules you laid out before? You even allowed for breaking SPI changes between minor release families (from 4.3 to 4.4), so such a re-organization should be acceptable for a major release such as 5? Or are you saying that there is a category of changes which is "too big" and thus never can be done? As a library user I personally can say that I'd be ok with this sort of changes in a major upgrade, in particular if its as easy to adapt to as just importing (otherwise un-altered) types from other packages. Btw. what are the rules/expectations for API changes in a major version (5), are breaking changes allowed there? The document only seems to describe changes within a release family ("API contracts should be considered stable across all releases within a major version (3.x or 4.x, etc)"). > > On Tue, Aug 26, 2014 at 1:34 AM, Gunnar Morling > wrote: > >> 2014-08-25 18:37 GMT+02:00 Steve Ebersole : >> >> This is all certainly true. I think specifically of things like >>> persisters, which by "package break down" are currently considered API. >>> >> >> That's a good example. You say based on their package they are considered >> API, but is that what you actually want for these types? Or, if these types >> actually should not be considered an API, why can't they be moved? >> >> If it's about not wanting to break existing users, I'd say then either a) >> these types actually *are* an API (why otherwise would we care about >> backwards compatibility with clients) or b) I wouldn't care about the >> breakage (in a major release such as 5) because clients should not have >> used those actually internal parts to begin with. Maybe the fact that those >> parts are internal was not communicated clearly enough, but a major release >> seems like the right occasion to fix this then. >> >> Also, as far as OSGi, I would suggest not worrying about that so much >>> (Gunnar). Keep in mind that even today this OSGi manifest info is >>> generated by build logic. Changing that build logic to look at annotations >>> rather that parsing .class file path is not that big of a deal imo. >>> Devil's-in-the-details of course, but in theory it should not be a big >>> deal. >>> >>> >>> On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero >>> wrote: >>> >>>> I won't speak for Steve's reasons, but I agree with the granularity >>>> problem. >>>> >>>> For example you might not want to refactor the code to promote an SPI >>>> to API (or simply fix a mistake), or viceversa demote an API to SPI, >>>> as you moving the packages around would break backwards compatibility. >>>> Essentially this means you can only fix the packages in that short >>>> time in which you're in Alpha/Beta phase for a new major release, >>>> which is a short period in which usually the team has other >>>> priorities. >>>> >>>> The best example is ORM itself in it's current shape: we all know that >>>> some classes should be moved into SPI or Impl, but we can't touch >>>> them. >>>> If your goal is to publish a nice set of javadocs for users which has >>>> API only, annotations would allow to do this. >>>> >>>> Sanne >>>> >>>> >>>> On 18 August 2014 08:14, Gunnar Morling wrote: >>>> > Hi Steve, >>>> > >>>> > Thanks for writing up these rules. That's very valuable information >>>> for >>>> > users and us as well. >>>> > >>>> > Only two remarks on the following: >>>> > >>>> >> The use of package names for this is unfortunately not granular >>>> enough >>>> > oftentimes. >>>> >> Ultimately I would envision a better solution (annotations?) >>>> > >>>> > In which cases is it not granular enough? Can such case not always be >>>> > circumvented by refactoring code into separate classes within separate >>>> > packages? >>>> > >>>> > I'm fearing issues with e.g. distinguishing between public (API/SPI) >>>> vs. >>>> > internal parts on a finer level than the package, as that's what OSGi >>>> but >>>> > also JBoss Modules rely on. We cannot fully leverage the ability of >>>> these >>>> > module systems to "hide" internal parts of a module in that case. >>>> > >>>> > Also I think annotations are easier to "miss" than package names when >>>> > importing classes into an application, thus I'm concerned about >>>> accidental >>>> > referencing internal classes. >>>> > >>>> >> SPI contracts should be considered stable within a release family, >>>> not >>>> > necessarily across different release families. >>>> > >>>> > A specific example, similar to the API section, would be nice, e.g.: >>>> "If >>>> > you implement an application against an integration point from >>>> Hibernate >>>> > ORM 4.3.0, the expectation is that it works without changes when >>>> updating >>>> > to ORM 4.3.1. It should also continue to work when updating to ORM >>>> 4.4.x in >>>> > the very most cases, but that's not guaranteed." >>>> > >>>> > --Gunnar >>>> > >>>> > >>>> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >>>> > >>>> >> There was a discussion in regards to our view on backwards >>>> compatibility in >>>> >> reference to HHH-9316. I realized that we talk about this amongst >>>> >> ourselves, but that I have never written these down. So I did that: >>>> >> >>>> >> >>>> >> >>>> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >>>> >> >>>> >> This is a first draft. Let me know what you think. >>>> >> _______________________________________________ >>>> >> 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 gunnar at hibernate.org Wed Aug 27 16:40:17 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Wed, 27 Aug 2014 22:40:17 +0200 Subject: [hibernate-dev] [OGM] Removing row keys from associations Message-ID: Hi Emmanuel, Is there any legitimate case where Association#remove(RowKey) is invoked for a key which is not present in that specific association instance? Or would this indicate some programming error? Thanks, --Gunnar From sanne at hibernate.org Wed Aug 27 18:30:19 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Wed, 27 Aug 2014 23:30:19 +0100 Subject: [hibernate-dev] [OGM] Removing row keys from associations In-Reply-To: References: Message-ID: On 27 August 2014 21:40, Gunnar Morling wrote: > Hi Emmanuel, > > Is there any legitimate case where Association#remove(RowKey) is invoked > for a key which is not present in that specific association instance? Or > would this indicate some programming error? If the datastore supports eventual consistency you might need to perform the operation anyway, to remove an association-to-be. > > Thanks, > > --Gunnar > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev From steve at hibernate.org Wed Aug 27 18:52:08 2014 From: steve at hibernate.org (Steve Ebersole) Date: Wed, 27 Aug 2014 17:52:08 -0500 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: You have to admit that moving everything (again in this singular example) from org.hibernate.persister to a whole package would be extremely disruptive to OGM, et al. Yes? So yes, making these changes is allowable under the rules laid out. But that does not mean we run out ad try to screw over integrations :) We still strive to maintain compatibility for SPIs as well as APIs. I think the relative question here is whether breaking these into api/spi/internal package structure (for OSGi, intention documentation purposes) alone warrants completely breaking compatibility with all integrations. I'd tend to vote no. On Wed, Aug 27, 2014 at 1:20 AM, Gunnar Morling wrote: > 2014-08-27 7:15 GMT+02:00 Steve Ebersole : > > They are an SPI. I'd break many Hibernate projects and third-party >> integrations if I just moved them... >> > > Yes, it would break client code using these SPIs, but isn't such breakage > covered by the rules you laid out before? You even allowed for breaking SPI > changes between minor release families (from 4.3 to 4.4), so such a > re-organization should be acceptable for a major release such as 5? > > Or are you saying that there is a category of changes which is "too big" > and thus never can be done? As a library user I personally can say that I'd > be ok with this sort of changes in a major upgrade, in particular if its as > easy to adapt to as just importing (otherwise un-altered) types from other > packages. > > Btw. what are the rules/expectations for API changes in a major version > (5), are breaking changes allowed there? The document only seems to > describe changes within a release family ("API contracts should be > considered stable across all releases within a major version (3.x or 4.x, > etc)"). > >> >> On Tue, Aug 26, 2014 at 1:34 AM, Gunnar Morling >> wrote: >> >>> 2014-08-25 18:37 GMT+02:00 Steve Ebersole : >>> >>> This is all certainly true. I think specifically of things like >>>> persisters, which by "package break down" are currently considered API. >>>> >>> >>> That's a good example. You say based on their package they are >>> considered API, but is that what you actually want for these types? Or, if >>> these types actually should not be considered an API, why can't they be >>> moved? >>> >>> If it's about not wanting to break existing users, I'd say then either >>> a) these types actually *are* an API (why otherwise would we care about >>> backwards compatibility with clients) or b) I wouldn't care about the >>> breakage (in a major release such as 5) because clients should not have >>> used those actually internal parts to begin with. Maybe the fact that those >>> parts are internal was not communicated clearly enough, but a major release >>> seems like the right occasion to fix this then. >>> >>> Also, as far as OSGi, I would suggest not worrying about that so much >>>> (Gunnar). Keep in mind that even today this OSGi manifest info is >>>> generated by build logic. Changing that build logic to look at annotations >>>> rather that parsing .class file path is not that big of a deal imo. >>>> Devil's-in-the-details of course, but in theory it should not be a big >>>> deal. >>>> >>>> >>>> On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero >>>> wrote: >>>> >>>>> I won't speak for Steve's reasons, but I agree with the granularity >>>>> problem. >>>>> >>>>> For example you might not want to refactor the code to promote an SPI >>>>> to API (or simply fix a mistake), or viceversa demote an API to SPI, >>>>> as you moving the packages around would break backwards compatibility. >>>>> Essentially this means you can only fix the packages in that short >>>>> time in which you're in Alpha/Beta phase for a new major release, >>>>> which is a short period in which usually the team has other >>>>> priorities. >>>>> >>>>> The best example is ORM itself in it's current shape: we all know that >>>>> some classes should be moved into SPI or Impl, but we can't touch >>>>> them. >>>>> If your goal is to publish a nice set of javadocs for users which has >>>>> API only, annotations would allow to do this. >>>>> >>>>> Sanne >>>>> >>>>> >>>>> On 18 August 2014 08:14, Gunnar Morling wrote: >>>>> > Hi Steve, >>>>> > >>>>> > Thanks for writing up these rules. That's very valuable information >>>>> for >>>>> > users and us as well. >>>>> > >>>>> > Only two remarks on the following: >>>>> > >>>>> >> The use of package names for this is unfortunately not granular >>>>> enough >>>>> > oftentimes. >>>>> >> Ultimately I would envision a better solution (annotations?) >>>>> > >>>>> > In which cases is it not granular enough? Can such case not always be >>>>> > circumvented by refactoring code into separate classes within >>>>> separate >>>>> > packages? >>>>> > >>>>> > I'm fearing issues with e.g. distinguishing between public (API/SPI) >>>>> vs. >>>>> > internal parts on a finer level than the package, as that's what >>>>> OSGi but >>>>> > also JBoss Modules rely on. We cannot fully leverage the ability of >>>>> these >>>>> > module systems to "hide" internal parts of a module in that case. >>>>> > >>>>> > Also I think annotations are easier to "miss" than package names when >>>>> > importing classes into an application, thus I'm concerned about >>>>> accidental >>>>> > referencing internal classes. >>>>> > >>>>> >> SPI contracts should be considered stable within a release family, >>>>> not >>>>> > necessarily across different release families. >>>>> > >>>>> > A specific example, similar to the API section, would be nice, e.g.: >>>>> "If >>>>> > you implement an application against an integration point from >>>>> Hibernate >>>>> > ORM 4.3.0, the expectation is that it works without changes when >>>>> updating >>>>> > to ORM 4.3.1. It should also continue to work when updating to ORM >>>>> 4.4.x in >>>>> > the very most cases, but that's not guaranteed." >>>>> > >>>>> > --Gunnar >>>>> > >>>>> > >>>>> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >>>>> > >>>>> >> There was a discussion in regards to our view on backwards >>>>> compatibility in >>>>> >> reference to HHH-9316. I realized that we talk about this amongst >>>>> >> ourselves, but that I have never written these down. So I did that: >>>>> >> >>>>> >> >>>>> >> >>>>> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >>>>> >> >>>>> >> This is a first draft. Let me know what you think. >>>>> >> _______________________________________________ >>>>> >> 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 gunnar at hibernate.org Thu Aug 28 02:30:18 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Thu, 28 Aug 2014 08:30:18 +0200 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: 2014-08-28 0:52 GMT+02:00 Steve Ebersole : > You have to admit that moving everything (again in this singular example) > from org.hibernate.persister to a whole package would be extremely > disruptive to OGM, et al. Yes? > Yes, it would be disruptive. As said though, I personally would not not be that annoyed about a package re-organization as it something I can quite easily adapt to. Changed semantics of an API/SPI which require me to actually re-program large parts of my application/integration would be more scary. Generally I think users (or integrators) are understanding about incompatible changes in a major release, if there is a significant value to these changes and they are not done for the fun of it. So it really boils down to your question below whether we deem an api/spi/internal structure worth it or not. > So yes, making these changes is allowable under the rules laid out. But > that does not mean we run out ad try to screw over integrations :) We > still strive to maintain compatibility for SPIs as well as APIs. > Ok, that's good. The "But that is in no way by design; it just means that it worked by happenstance" from before had me scared a bit :) > I think the relative question here is whether breaking these into > api/spi/internal package structure (for OSGi, intention documentation > purposes) alone warrants completely breaking compatibility with all > integrations. I'd tend to vote no. > I understand and I'd tend to agree for SPIs. My point was more about parts considered internal where I don't see why they couldn't be moved, because backwards-compatibility shouldn't be relevant there. To sum it up, I'd be concerned about using annotations (rather than packages) for marking parts as internal due to the reasons outlined before, whereas using annotations for marking parts as SPI may be a good middle-ground. On Wed, Aug 27, 2014 at 1:20 AM, Gunnar Morling > wrote: > >> 2014-08-27 7:15 GMT+02:00 Steve Ebersole : >> >> They are an SPI. I'd break many Hibernate projects and third-party >>> integrations if I just moved them... >>> >> >> Yes, it would break client code using these SPIs, but isn't such breakage >> covered by the rules you laid out before? You even allowed for breaking SPI >> changes between minor release families (from 4.3 to 4.4), so such a >> re-organization should be acceptable for a major release such as 5? >> >> Or are you saying that there is a category of changes which is "too big" >> and thus never can be done? As a library user I personally can say that I'd >> be ok with this sort of changes in a major upgrade, in particular if its as >> easy to adapt to as just importing (otherwise un-altered) types from other >> packages. >> >> Btw. what are the rules/expectations for API changes in a major version >> (5), are breaking changes allowed there? The document only seems to >> describe changes within a release family ("API contracts should be >> considered stable across all releases within a major version (3.x or 4.x, >> etc)"). >> >>> >>> On Tue, Aug 26, 2014 at 1:34 AM, Gunnar Morling >>> wrote: >>> >>>> 2014-08-25 18:37 GMT+02:00 Steve Ebersole : >>>> >>>> This is all certainly true. I think specifically of things like >>>>> persisters, which by "package break down" are currently considered API. >>>>> >>>> >>>> That's a good example. You say based on their package they are >>>> considered API, but is that what you actually want for these types? Or, if >>>> these types actually should not be considered an API, why can't they be >>>> moved? >>>> >>>> If it's about not wanting to break existing users, I'd say then either >>>> a) these types actually *are* an API (why otherwise would we care about >>>> backwards compatibility with clients) or b) I wouldn't care about the >>>> breakage (in a major release such as 5) because clients should not have >>>> used those actually internal parts to begin with. Maybe the fact that those >>>> parts are internal was not communicated clearly enough, but a major release >>>> seems like the right occasion to fix this then. >>>> >>>> Also, as far as OSGi, I would suggest not worrying about that so much >>>>> (Gunnar). Keep in mind that even today this OSGi manifest info is >>>>> generated by build logic. Changing that build logic to look at annotations >>>>> rather that parsing .class file path is not that big of a deal imo. >>>>> Devil's-in-the-details of course, but in theory it should not be a big >>>>> deal. >>>>> >>>>> >>>>> On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero >>>>> wrote: >>>>> >>>>>> I won't speak for Steve's reasons, but I agree with the granularity >>>>>> problem. >>>>>> >>>>>> For example you might not want to refactor the code to promote an SPI >>>>>> to API (or simply fix a mistake), or viceversa demote an API to SPI, >>>>>> as you moving the packages around would break backwards compatibility. >>>>>> Essentially this means you can only fix the packages in that short >>>>>> time in which you're in Alpha/Beta phase for a new major release, >>>>>> which is a short period in which usually the team has other >>>>>> priorities. >>>>>> >>>>>> The best example is ORM itself in it's current shape: we all know that >>>>>> some classes should be moved into SPI or Impl, but we can't touch >>>>>> them. >>>>>> If your goal is to publish a nice set of javadocs for users which has >>>>>> API only, annotations would allow to do this. >>>>>> >>>>>> Sanne >>>>>> >>>>>> >>>>>> On 18 August 2014 08:14, Gunnar Morling wrote: >>>>>> > Hi Steve, >>>>>> > >>>>>> > Thanks for writing up these rules. That's very valuable information >>>>>> for >>>>>> > users and us as well. >>>>>> > >>>>>> > Only two remarks on the following: >>>>>> > >>>>>> >> The use of package names for this is unfortunately not granular >>>>>> enough >>>>>> > oftentimes. >>>>>> >> Ultimately I would envision a better solution (annotations?) >>>>>> > >>>>>> > In which cases is it not granular enough? Can such case not always >>>>>> be >>>>>> > circumvented by refactoring code into separate classes within >>>>>> separate >>>>>> > packages? >>>>>> > >>>>>> > I'm fearing issues with e.g. distinguishing between public >>>>>> (API/SPI) vs. >>>>>> > internal parts on a finer level than the package, as that's what >>>>>> OSGi but >>>>>> > also JBoss Modules rely on. We cannot fully leverage the ability of >>>>>> these >>>>>> > module systems to "hide" internal parts of a module in that case. >>>>>> > >>>>>> > Also I think annotations are easier to "miss" than package names >>>>>> when >>>>>> > importing classes into an application, thus I'm concerned about >>>>>> accidental >>>>>> > referencing internal classes. >>>>>> > >>>>>> >> SPI contracts should be considered stable within a release family, >>>>>> not >>>>>> > necessarily across different release families. >>>>>> > >>>>>> > A specific example, similar to the API section, would be nice, >>>>>> e.g.: "If >>>>>> > you implement an application against an integration point from >>>>>> Hibernate >>>>>> > ORM 4.3.0, the expectation is that it works without changes when >>>>>> updating >>>>>> > to ORM 4.3.1. It should also continue to work when updating to ORM >>>>>> 4.4.x in >>>>>> > the very most cases, but that's not guaranteed." >>>>>> > >>>>>> > --Gunnar >>>>>> > >>>>>> > >>>>>> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >>>>>> > >>>>>> >> There was a discussion in regards to our view on backwards >>>>>> compatibility in >>>>>> >> reference to HHH-9316. I realized that we talk about this amongst >>>>>> >> ourselves, but that I have never written these down. So I did >>>>>> that: >>>>>> >> >>>>>> >> >>>>>> >> >>>>>> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >>>>>> >> >>>>>> >> This is a first draft. Let me know what you think. >>>>>> >> _______________________________________________ >>>>>> >> 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 sanne at hibernate.org Thu Aug 28 06:23:57 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 28 Aug 2014 11:23:57 +0100 Subject: [hibernate-dev] Compatibility Considerations wiki In-Reply-To: References: Message-ID: Hi Gunnar, I think we all agree that sometimes we can/should re-organize the packages in a better structure - but as you suggest in major releases. The problem is that deciding that "today I'm going to move all classes to their right place" is unfortunately wishful thinking as you'll never get it all done perfectly in the short time preceding a major tag. Also new features might get added during the major and not be "perfectly placed". Annotations can decouple the moment of clarification/documentation of what is *supposed* to be API/SPI in our minds from what is a de facto stable API: I think having this option to decouple the two moments in the development process is an invaluable flexibility. Alternatively we'd be moving packages around in minor versions, and while you might be patiently following up in OGM, it will ultimately bite users as our different components will be compatible with very narrow ranges of each other, this frequently results in practice by things getting very hard to use, or even impossible to do upgrades. -- Sanne On 28 August 2014 07:30, Gunnar Morling wrote: > 2014-08-28 0:52 GMT+02:00 Steve Ebersole : > >> You have to admit that moving everything (again in this singular example) >> from org.hibernate.persister to a whole package would be extremely >> disruptive to OGM, et al. Yes? > > > Yes, it would be disruptive. As said though, I personally would not not be > that annoyed about a package re-organization as it something I can quite > easily adapt to. Changed semantics of an API/SPI which require me to > actually re-program large parts of my application/integration would be more > scary. > > Generally I think users (or integrators) are understanding about > incompatible changes in a major release, if there is a significant value to > these changes and they are not done for the fun of it. So it really boils > down to your question below whether we deem an api/spi/internal structure > worth it or not. > >> >> So yes, making these changes is allowable under the rules laid out. But >> that does not mean we run out ad try to screw over integrations :) We still >> strive to maintain compatibility for SPIs as well as APIs. > > > Ok, that's good. The "But that is in no way by design; it just means that it > worked by happenstance" from before had me scared a bit :) > >> >> I think the relative question here is whether breaking these into >> api/spi/internal package structure (for OSGi, intention documentation >> purposes) alone warrants completely breaking compatibility with all >> integrations. I'd tend to vote no. > > > I understand and I'd tend to agree for SPIs. > > My point was more about parts considered internal where I don't see why they > couldn't be moved, because backwards-compatibility shouldn't be relevant > there. To sum it up, I'd be concerned about using annotations (rather than > packages) for marking parts as internal due to the reasons outlined before, > whereas using annotations for marking parts as SPI may be a good > middle-ground. > >> On Wed, Aug 27, 2014 at 1:20 AM, Gunnar Morling >> wrote: >>> >>> 2014-08-27 7:15 GMT+02:00 Steve Ebersole : >>> >>>> They are an SPI. I'd break many Hibernate projects and third-party >>>> integrations if I just moved them... >>> >>> >>> Yes, it would break client code using these SPIs, but isn't such breakage >>> covered by the rules you laid out before? You even allowed for breaking SPI >>> changes between minor release families (from 4.3 to 4.4), so such a >>> re-organization should be acceptable for a major release such as 5? >>> >>> Or are you saying that there is a category of changes which is "too big" >>> and thus never can be done? As a library user I personally can say that I'd >>> be ok with this sort of changes in a major upgrade, in particular if its as >>> easy to adapt to as just importing (otherwise un-altered) types from other >>> packages. >>> >>> Btw. what are the rules/expectations for API changes in a major version >>> (5), are breaking changes allowed there? The document only seems to describe >>> changes within a release family ("API contracts should be considered stable >>> across all releases within a major version (3.x or 4.x, etc)"). >>> >>>> >>>> On Tue, Aug 26, 2014 at 1:34 AM, Gunnar Morling >>>> wrote: >>>>> >>>>> 2014-08-25 18:37 GMT+02:00 Steve Ebersole : >>>>> >>>>>> This is all certainly true. I think specifically of things like >>>>>> persisters, which by "package break down" are currently considered API. >>>>> >>>>> >>>>> That's a good example. You say based on their package they are >>>>> considered API, but is that what you actually want for these types? Or, if >>>>> these types actually should not be considered an API, why can't they be >>>>> moved? >>>>> >>>>> If it's about not wanting to break existing users, I'd say then either >>>>> a) these types actually *are* an API (why otherwise would we care about >>>>> backwards compatibility with clients) or b) I wouldn't care about the >>>>> breakage (in a major release such as 5) because clients should not have used >>>>> those actually internal parts to begin with. Maybe the fact that those parts >>>>> are internal was not communicated clearly enough, but a major release seems >>>>> like the right occasion to fix this then. >>>>> >>>>>> Also, as far as OSGi, I would suggest not worrying about that so much >>>>>> (Gunnar). Keep in mind that even today this OSGi manifest info is generated >>>>>> by build logic. Changing that build logic to look at annotations rather >>>>>> that parsing .class file path is not that big of a deal imo. >>>>>> Devil's-in-the-details of course, but in theory it should not be a big deal. >>>>>> >>>>>> >>>>>> On Mon, Aug 18, 2014 at 6:12 AM, Sanne Grinovero >>>>>> wrote: >>>>>>> >>>>>>> I won't speak for Steve's reasons, but I agree with the granularity >>>>>>> problem. >>>>>>> >>>>>>> For example you might not want to refactor the code to promote an SPI >>>>>>> to API (or simply fix a mistake), or viceversa demote an API to SPI, >>>>>>> as you moving the packages around would break backwards >>>>>>> compatibility. >>>>>>> Essentially this means you can only fix the packages in that short >>>>>>> time in which you're in Alpha/Beta phase for a new major release, >>>>>>> which is a short period in which usually the team has other >>>>>>> priorities. >>>>>>> >>>>>>> The best example is ORM itself in it's current shape: we all know >>>>>>> that >>>>>>> some classes should be moved into SPI or Impl, but we can't touch >>>>>>> them. >>>>>>> If your goal is to publish a nice set of javadocs for users which has >>>>>>> API only, annotations would allow to do this. >>>>>>> >>>>>>> Sanne >>>>>>> >>>>>>> >>>>>>> On 18 August 2014 08:14, Gunnar Morling wrote: >>>>>>> > Hi Steve, >>>>>>> > >>>>>>> > Thanks for writing up these rules. That's very valuable information >>>>>>> > for >>>>>>> > users and us as well. >>>>>>> > >>>>>>> > Only two remarks on the following: >>>>>>> > >>>>>>> >> The use of package names for this is unfortunately not granular >>>>>>> >> enough >>>>>>> > oftentimes. >>>>>>> >> Ultimately I would envision a better solution (annotations?) >>>>>>> > >>>>>>> > In which cases is it not granular enough? Can such case not always >>>>>>> > be >>>>>>> > circumvented by refactoring code into separate classes within >>>>>>> > separate >>>>>>> > packages? >>>>>>> > >>>>>>> > I'm fearing issues with e.g. distinguishing between public >>>>>>> > (API/SPI) vs. >>>>>>> > internal parts on a finer level than the package, as that's what >>>>>>> > OSGi but >>>>>>> > also JBoss Modules rely on. We cannot fully leverage the ability of >>>>>>> > these >>>>>>> > module systems to "hide" internal parts of a module in that case. >>>>>>> > >>>>>>> > Also I think annotations are easier to "miss" than package names >>>>>>> > when >>>>>>> > importing classes into an application, thus I'm concerned about >>>>>>> > accidental >>>>>>> > referencing internal classes. >>>>>>> > >>>>>>> >> SPI contracts should be considered stable within a release family, >>>>>>> >> not >>>>>>> > necessarily across different release families. >>>>>>> > >>>>>>> > A specific example, similar to the API section, would be nice, >>>>>>> > e.g.: "If >>>>>>> > you implement an application against an integration point from >>>>>>> > Hibernate >>>>>>> > ORM 4.3.0, the expectation is that it works without changes when >>>>>>> > updating >>>>>>> > to ORM 4.3.1. It should also continue to work when updating to ORM >>>>>>> > 4.4.x in >>>>>>> > the very most cases, but that's not guaranteed." >>>>>>> > >>>>>>> > --Gunnar >>>>>>> > >>>>>>> > >>>>>>> > 2014-08-09 16:55 GMT+02:00 Steve Ebersole : >>>>>>> > >>>>>>> >> There was a discussion in regards to our view on backwards >>>>>>> >> compatibility in >>>>>>> >> reference to HHH-9316. I realized that we talk about this amongst >>>>>>> >> ourselves, but that I have never written these down. So I did >>>>>>> >> that: >>>>>>> >> >>>>>>> >> >>>>>>> >> >>>>>>> >> https://github.com/hibernate/hibernate-orm/wiki/Compatibility-Considerations >>>>>>> >> >>>>>>> >> This is a first draft. Let me know what you think. >>>>>>> >> _______________________________________________ >>>>>>> >> 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 sanne at hibernate.org Thu Aug 28 10:54:36 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 28 Aug 2014 15:54:36 +0100 Subject: [hibernate-dev] Anybody knows what this artifact is? Message-ID: Looks useful to update our integration tests, but I'm confused by the versioning scheme: http://maven.repository.redhat.com/earlyaccess/all/org/jboss/as/jboss-as-dist/7.4.0.Final-redhat-4/ TiA, Sanne From hardy at hibernate.org Thu Aug 28 11:29:06 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Thu, 28 Aug 2014 17:29:06 +0200 Subject: [hibernate-dev] Anybody knows what this artifact is? In-Reply-To: References: Message-ID: <20140828152906.GA3625@Sarmakand-2.local> On Thu, Aug 28, 2014 at 03:54:36PM +0100, Sanne Grinovero wrote: > Looks useful to update our integration tests, but I'm confused by the > versioning scheme: > > http://maven.repository.redhat.com/earlyaccess/all/org/jboss/as/jboss-as-dist/7.4.0.Final-redhat-4/ I guess the artifact is jboss-as-dist, but you will also need to add 'zip' (I think) ;-) --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/20140828/bb04ef18/attachment.bin From sanne at hibernate.org Thu Aug 28 18:29:07 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 28 Aug 2014 23:29:07 +0100 Subject: [hibernate-dev] Released Hibernate Search 4.4.4.Final Message-ID: And again many thanks to Yoann Gendre for nailing a very subtle bug. http://in.relation.to/Bloggers/YetAnotherJPA20CompatibleReleaseOfHibernateSearch Regards, Sanne From sanne at hibernate.org Thu Aug 28 18:35:48 2014 From: sanne at hibernate.org (Sanne Grinovero) Date: Thu, 28 Aug 2014 23:35:48 +0100 Subject: [hibernate-dev] Anybody knows what this artifact is? In-Reply-To: <20140828152906.GA3625@Sarmakand-2.local> References: <20140828152906.GA3625@Sarmakand-2.local> Message-ID: All, especially OGM team, I guess Hardy already figured it out when reviewing my last pull request: that artifact contains the latest JBoss EAP 6.3 version, very convenient for integration tests. Apparently the Maven artifact names still use the JBossAS naming and version scheme, that's why it's oddly named version 7.4. Upgrading tests was smooth: - https://github.com/hibernate/hibernate-search/pull/657/files You still need to enable the special repository though (as we did for older EAP versions too). -- Sanne On 28 August 2014 16:29, Hardy Ferentschik wrote: > On Thu, Aug 28, 2014 at 03:54:36PM +0100, Sanne Grinovero wrote: >> Looks useful to update our integration tests, but I'm confused by the >> versioning scheme: >> >> http://maven.repository.redhat.com/earlyaccess/all/org/jboss/as/jboss-as-dist/7.4.0.Final-redhat-4/ > > I guess the artifact is jboss-as-dist, but you will also need to add 'zip' (I think) ;-) > > --Hardy > > _______________________________________________ > hibernate-dev mailing list > hibernate-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/hibernate-dev