You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
(157) |
Mar
(111) |
Apr
(61) |
May
(68) |
Jun
(45) |
Jul
(101) |
Aug
(132) |
Sep
(148) |
Oct
(227) |
Nov
(141) |
Dec
(285) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(518) |
Feb
(462) |
Mar
(390) |
Apr
(488) |
May
(321) |
Jun
(336) |
Jul
(268) |
Aug
(374) |
Sep
(211) |
Oct
(246) |
Nov
(239) |
Dec
(173) |
2004 |
Jan
(110) |
Feb
(131) |
Mar
(85) |
Apr
(120) |
May
(82) |
Jun
(101) |
Jul
(54) |
Aug
(65) |
Sep
(94) |
Oct
(51) |
Nov
(56) |
Dec
(168) |
2005 |
Jan
(146) |
Feb
(98) |
Mar
(75) |
Apr
(118) |
May
(85) |
Jun
(75) |
Jul
(44) |
Aug
(94) |
Sep
(70) |
Oct
(84) |
Nov
(115) |
Dec
(52) |
2006 |
Jan
(113) |
Feb
(83) |
Mar
(217) |
Apr
(158) |
May
(219) |
Jun
(218) |
Jul
(189) |
Aug
(39) |
Sep
(3) |
Oct
(7) |
Nov
(4) |
Dec
(2) |
2007 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(3) |
Jun
(8) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(7) |
Dec
|
2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(10) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brad C. <bra...@wo...> - 2002-08-07 10:17:06
|
we r also using hibernate in a production environment. this change makes sense and is not a big deal for us, so go for it. brad ----- Original Message ----- From: "Jon Lipsky" <jon...@xe...> To: "Christian Bauer" <chr...@bl...>; <Gavin_King/Cirrus%CI...@ci...> Cc: <hib...@so...> Sent: Wednesday, August 07, 2002 4:06 PM Subject: Re: [Hibernate-devel] what to do about select distinct..... > Hi... > > I thought I would chime in since I am one of the few people who has a > project using Hibernate in a production environment. > > I took a look at my code and I don't think this change would break anything, > however you never know. :-) I'm sure other people could do what I do and > bundle a specific version of Hibernate with a specific version of their > application. In my case, I have bundled the 1.0 release of Hibernate with > the 1.0 release of my project since I know everything is working correctly > together. > > As to making the change. I support it. That was one thing I always > wondered why it wasn't in the query language. > > Jon... > > ----- Original Message ----- > From: <Gavin_King/Cirrus%CI...@ci...> > To: "Christian Bauer" <chr...@bl...> > Cc: <hib...@so...> > Sent: Wednesday, August 07, 2002 3:42 AM > Subject: Re: [Hibernate-devel] what to do about select distinct..... > > > > > > >Well, my concerns to this change are not technical. I appreciate the > > >decision and think it's better to break things now in an early stage. > > > > yeah, I do think that if something like this looks inevitable then 'tis > > best it be done quickly. > > > > But I *do* want to make it clear that I don't plan to make a habit of > > things like this..... > > > > >But I think not a lot of people will be using Hibernate in a production > > >environment. > > > > No not *many* people, but there are a few and I'm sensitive to their > > concerns because they have been supporting the project from an early > > stage. Of course, some of those projects can probably continue to use > > whatever older version they are currenty using (or at least upgrade > > as far as 1.0.1b which is quite reliable. > > > > I will probably maintain 1.0.x as a seperate branch if any major bug shows > > up in 1.0.1. > > > > For projects in development, it probably isn't such a huge wrenching > > change to add "distinct" in a couple of query strings. (Most queries > > return distinct result sets with or without the distinct keyword > > *anyway*) > > > > P.S. Christian, I added the FAQ page to version 1.1 beta 2 but I had a > > question for you: are we continuing to use AFT for the website? Or should > I > > be doing new stuff like this in docbook? > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Hibernate-devel mailing list > > Hib...@li... > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-07 06:34:15
|
>Here's one I always forget (I may have some of the details wrong, check me): > >* I think I've configured everything correctly, but I keep getting class >not found 'COM.ibm.db2.jdbc.app.DB2Driver' errors! > >Hibernate searches for a configuration file ><hibernate-root>/classes/hibernate.properties and uses it to configure >database connections and other properties. If you are specifying Hibernate >properties in some other way, you must delete or move this file. Now that you put it like *that*, perhaps the functionality is wrong! Should system properties specified with java -D override hibernate.properties, rather than the other way round? That makes more sense, I suppose. (Properties specified in hibernate.cfg.xml already override hibernate.properties. Properties specified by passing a java.util.Properties *completely* ignore hibernate.properties + system properties.) |
From: Jon L. <jon...@xe...> - 2002-08-07 06:07:20
|
Hi... I thought I would chime in since I am one of the few people who has a project using Hibernate in a production environment. I took a look at my code and I don't think this change would break anything, however you never know. :-) I'm sure other people could do what I do and bundle a specific version of Hibernate with a specific version of their application. In my case, I have bundled the 1.0 release of Hibernate with the 1.0 release of my project since I know everything is working correctly together. As to making the change. I support it. That was one thing I always wondered why it wasn't in the query language. Jon... ----- Original Message ----- From: <Gavin_King/Cirrus%CI...@ci...> To: "Christian Bauer" <chr...@bl...> Cc: <hib...@so...> Sent: Wednesday, August 07, 2002 3:42 AM Subject: Re: [Hibernate-devel] what to do about select distinct..... > > >Well, my concerns to this change are not technical. I appreciate the > >decision and think it's better to break things now in an early stage. > > yeah, I do think that if something like this looks inevitable then 'tis > best it be done quickly. > > But I *do* want to make it clear that I don't plan to make a habit of > things like this..... > > >But I think not a lot of people will be using Hibernate in a production > >environment. > > No not *many* people, but there are a few and I'm sensitive to their > concerns because they have been supporting the project from an early > stage. Of course, some of those projects can probably continue to use > whatever older version they are currenty using (or at least upgrade > as far as 1.0.1b which is quite reliable. > > I will probably maintain 1.0.x as a seperate branch if any major bug shows > up in 1.0.1. > > For projects in development, it probably isn't such a huge wrenching > change to add "distinct" in a couple of query strings. (Most queries > return distinct result sets with or without the distinct keyword > *anyway*) > > P.S. Christian, I added the FAQ page to version 1.1 beta 2 but I had a > question for you: are we continuing to use AFT for the website? Or should I > be doing new stuff like this in docbook? > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-07 05:26:59
|
>2. Related to 1, it would also be nice if the sort-order of a >collection could be specified at runtime in some way. So if I've >already queried for a customer and call getOrders on it I would like >to be able to choose how the orders are sorted when fetched. This at >runtime too because I might want them sorted differently on different >occations. Hmmmm. My main problem with this is trying to imagine what kind of API would be used to access such functionality. I suppose if the collection was lazily initialized, you could do something like: ( (HibernateCollection) orders ).sortBy("Order.total, Order.orderDate"); Then when the collection is loaded, the elements would be returned ordered by the given properties. I'm not so keen on this because of the necessity to cast the collection wrapper to a Hibernate API. This conflicts with the project ideology.... I guess you could do something like: session.presort(orders, "Order.total, Order.orderDate"); but this is still creating a dependency of application code upon the supposedly transparent lazy-initialization procedure. Someone else has requested that we be able to specify a collection sort order in the _mapping_ file (this is easily doable). But I have another reason for doubting the whole concept: You would have to have a *very* large collection for there to be any great performance issue in letting Java sort the collection! Hibernate already supports SortedMaps and SortedSets. If you needed to specify a Comparator at runtime (rather than in the mapping file), you could just grab the elements and put them in a new collection. Gavin |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-07 04:02:03
|
>Please use AFT for the website until I have more time (should be in one >week) to work further on the documentation and eventually the website. cool :) I'm starting to think about some tutorial-style introductory documentation but I'm just not sure that I'm the best person to write it... >I'm on the Resin server mailinglist and also read/write in some Java >centric newsgroups and a lot of people have problems deciding for an O/R >mapper or even get a grip on the technology itself. I received three >mails last week from developers asking me what to do, as I have evaluated >most options (and mentioned that on the lists and groups). Well, I guess >Hibernate will get more downloads in the near future. :) Ace. (aaaah I keep forgetting thats Australian slang ... like "heaps") |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-07 03:43:54
|
> Anyone have any ideas why this is happening and/or how to fix it? Its possibly a problem with the commons-logging stuff (i've seen some funny things happen before with serialization). Could you try commenting out all the references to commons logging in cirrus.hibernate.impl.LazyInitializer? If that helps, I will try for a similar fix in the next version..... |
From: Christian B. <chr...@bl...> - 2002-08-07 02:14:42
|
On 07 Aug (11:42), Gavin_King/Cirrus%CI...@ci... wrote: > P.S. Christian, I added the FAQ page to version 1.1 beta 2 but I had a > question for you: are we continuing to use AFT for the website? Or should I > be doing new stuff like this in docbook? Please use AFT for the website until I have more time (should be in one week) to work further on the documentation and eventually the website. Everone's on vacation right now, pretty busy... I'm on the Resin server mailinglist and also read/write in some Java centric newsgroups and a lot of people have problems deciding for an O/R mapper or even get a grip on the technology itself. I received three mails last week from developers asking me what to do, as I have evaluated most options (and mentioned that on the lists and groups). Well, I guess Hibernate will get more downloads in the near future. :) -- Christian Bauer tu...@in... |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-07 01:58:42
|
>Well, my concerns to this change are not technical. I appreciate the >decision and think it's better to break things now in an early stage. yeah, I do think that if something like this looks inevitable then 'tis best it be done quickly. But I *do* want to make it clear that I don't plan to make a habit of things like this..... >But I think not a lot of people will be using Hibernate in a production >environment. No not *many* people, but there are a few and I'm sensitive to their concerns because they have been supporting the project from an early stage. Of course, some of those projects can probably continue to use whatever older version they are currenty using (or at least upgrade as far as 1.0.1b which is quite reliable. I will probably maintain 1.0.x as a seperate branch if any major bug shows up in 1.0.1. For projects in development, it probably isn't such a huge wrenching change to add "distinct" in a couple of query strings. (Most queries return distinct result sets with or without the distinct keyword *anyway*) P.S. Christian, I added the FAQ page to version 1.1 beta 2 but I had a question for you: are we continuing to use AFT for the website? Or should I be doing new stuff like this in docbook? |
From: Christian B. <chr...@bl...> - 2002-08-07 01:40:23
|
On 07 Aug (11:11), Gavin_King/Cirrus%CI...@ci... wrote: > What I would really like to do is push responsibility for this into the > application by allowing the DISTINCT keyword in the Hiberante query and > remove the select="distinct|all" mapping attribute. > > Unfortunately, this change would break existing code that assumes a > distinct result set from a query without an explicit "DISTINCT". Well, my concerns to this change are not technical. I appreciate the decision and think it's better to break things now in an early stage. But I think not a lot of people will be using Hibernate in a production environment. I have a small test application (an AddressBook) that I use to stress and feature test O/R mappers and all kind of things. It's really basic, the most complex thing is bidirectional one-to-many relationships (no M:N). Hibernate managed this application at 1.0.1, which was only two or three weeks ago. I know from my experience that it will take a lot more to make a useful application. I doubt anyone is currently using Hibernate for that purpose (no offence meant, I really believe it will be in the near future). -- Christian Bauer tu...@in... |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-07 01:27:04
|
I think I need to break something :( Very early on in the project, when Hibernate queries just returned a single-column result sets containing entities, I made a decision to have Hibernate always return distinct result sets. It sort of made sense at the time but now that Hibernate queries can return all sorts of stuff, it no longer makes much sense.... This was not a very well-thought out decision, actually. What I would really like to do is push responsibility for this into the application by allowing the DISTINCT keyword in the Hiberante query and remove the select="distinct|all" mapping attribute. Unfortunately, this change would break existing code that assumes a distinct result set from a query without an explicit "DISTINCT". On the other hand, it would allow more flexibility for the user, be more predictable (clearer semantics) and simplify the implementation. No more hidden magic to trim a non-distinct SQL resultset to a distinct Hibernate result set. what does everyone think about this change? |
From: Urberg, J. <ju...@ve...> - 2002-08-06 19:34:51
|
I've got an applet connecting to a session bean in JBoss. The session bean method returns an object mapped in Hibernate which happens to have a Proxy. When I run the code outside a browser, everything works ok. When I call it from the browser, I get the stack included below. I've tried putting hibernate.jar, commons-logging.jar, log4j.jar and log4j.properties on the applet's class path to no avail. If I take the proxy off the class, everything works a.o.k. Anyone have any ideas why this is happening and/or how to fix it? Thanks, John java.lang.ExceptionInInitializerError at java.io.ObjectStreamClass.hasStaticInitializer(Native Method) at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1487) at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:45) at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:169) at java.security.AccessController.doPrivileged(Native Method) at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:166) at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:450) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322) at java.rmi.MarshalledObject.get(MarshalledObject.java:135) at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericPr oxy.java:357) at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(Stateless SessionProxy.java:123) at $Proxy1.buildReplyToMessage(Unknown Source) at com.idexx.cstone.messagecenter.ui.MessageCenterPresenter.onReply(MessageCent erPresenter.java:208) at com.idexx.cstone.messagecenter.ui.MessageCenterPanel.onReply(MessageCenterPa nel.java:292) at com.idexx.cstone.messagecenter.ui.MessageCenterPanel.access$4(MessageCenterP anel.java:290) at com.idexx.cstone.messagecenter.ui.MessageCenterPanel$5.actionPerformed(Messa geCenterPanel.java:274) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto n.java:1820) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4 19) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener .java:258) at java.awt.Component.processMouseEvent(Component.java:5021) at java.awt.Component.processEvent(Component.java:4818) at java.awt.Container.processEvent(Container.java:1525) at java.awt.Component.dispatchEventImpl(Component.java:3526) at java.awt.Container.dispatchEventImpl(Container.java:1582) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3074) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004) at java.awt.Container.dispatchEventImpl(Container.java:1568) at java.awt.Component.dispatchEvent(Component.java:3367) at java.awt.EventQueue.dispatchEvent(EventQueue.java:445) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja va:191) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java :144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130) at java.awt.EventDispatchThread.run(EventDispatchThread.java:98) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja va:494) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja va:285) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja va:255) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) at cirrus.hibernate.impl.LazyInitializer.<clinit>(LazyInitializer.java:21) ... 50 more Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI mpl.java:404) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja va:487) ... 54 more Caused by: java.lang.NullPointerException at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:105) at java.lang.ClassLoader.loadClass(ClassLoader.java:262) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI mpl.java:398) ... 55 more |
From: Christoph S. <cs...@mc...> - 2002-08-06 14:43:23
|
Hi All! Atm its possible to declare a property twice in a mapping file. Everything works as expected, but update statements generate illegal sql. (inserts probably too). Maybe we should check properties for uniqueness when the mapping is read. Regards chris |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-06 12:49:36
|
> Great! Let me know when it's ready, I'm looking forward to trying it out. do a cvs upd now..... |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-06 12:32:40
|
Hibernate FAQ ------------- * Hibernate expects my JDBC driver to support JDBC2 but it doesn't! Set hibernate.use_jdbc2=false or upgrade your driver to the latest version. Hibernate chooses a sensible default value for hibernate.use_jdbc2, based upon your SQL dialect. * I saved/deleted/updated an object/collection but I can't see the changes in the database! You must either call Transaction.commit() (If using the transaction API) or Session.flush() at the end of a session to flush your changes to the database. * I saved a parent object and its associated objects weren't saved to the database Associated objects must be saved explicitly (by calling Session.save()) or the association must be mapped with cascade="all". * How can I count the number of query results without actually returning them? ( (Integer) session.iterate("select count(*) from ....").next() ).intValue() * How do I specify the length of a column for the SchemExport tool? A unique column? A not-null column? Column lengths and constraints may be specified in the mapping document. If you browse http://hibernate.sourceforge.net/hibernate-mapping.dtd you will find it quite well documented. * How can I use quoted SQL identifiers? You can't. Sorry. We will fix this at some stage.... * I'm seeing ClassCastExceptions when I try to call Hibernate from inside JUnit Fix 1 (Gareth Cronin) Anyone using log4j/commons etc and JUnit should change the junit/runner/excluded.properties file inside junit.jar to look like this (it will get rid of all annoying Jakarta issues): # # The list of excluded package paths for the TestCaseClassLoader # excluded.0=sun.* excluded.1=com.sun.* excluded.2=org.omg.* excluded.3=javax.* excluded.4=sunw.* excluded.5=java.* excluded.6=org.xml.sax.* excluded.7=org.w3c.dom.* excluded.8=org.apache.log4j.* excluded.9=org.apache.commons.* Fix 2 (Eric Everman) Another fix for this is to turn off class reloading [in JUnit]. * How I configure logging? Hibernate uses the Apache commons-logging abstraction layer to support whichever logging framework you hapen to be using. See http://jakarta.apache.org/commons/logging.html To configure log4j you need to do 2 things: 1. put log4j.jar in your classpath 2. put log4j.properties in your classpath There is an example log4j.properties in the hibernate-x.x directory. Just change "INFO" to "DEBUG" to see more messages (and move it into the classpath). To use JDK1.4 logging, do three things: 1. remove log4j.jar from the classpath 2. run under JDK1.4 ;) 3. configure logging via the properties file specified by the 'java.util.logging.config.file' system property (this property defaults to $JAVA_HOME/jre/lib/logging.properties) * How do I configure the cache? Hibernate uses JCS for its factory-level caching. JCS is configured by placing a properties file named cache.ccf in the classpath. See http://jakarta.apache.org/turbine/jcs/ * Where can I get more help? http://sourceforge.net/forum/forum.php?forum_id=128638 |
From: Urberg, J. <ju...@ve...> - 2002-08-06 12:10:32
|
>> Anyway, I had spent so much time talking + thinking about all this that I knew exactly what to do to implement this (the collection cache) and so I just went ahead and did it last night. It only took me a couple of hours but would have taken someone else much longer. I've just got the configuration side left to worry about....<< Great! Let me know when it's ready, I'm looking forward to trying it out. Thanks, John |
From: Viktor S. <phr...@im...> - 2002-08-06 03:37:18
|
Gavin_King/Cirrus%CI...@ci... wrote: >Well, I've often wondered if the interface(s) to > > cirrus.hibernate.impl.ClassPersister > cirrus.hibernate.impl.CollectionPersister > >used by SessionImpl could be abstracted, making Hibernate much more modular >internally. I hadn't done this because > >(a) nobody had asked for such a feature + I am following an XPish approach > i think if hibernate could automatically generate those stored procs we could call it XP compliant :-) basically if hibernate can pre-generate certain queries (specific to a sql dialect ofcoz) which the developer marks as such in the mapping file somehow, all you need to do, is execute the sql script in the DB, and hibernate can take advantage of SPs. as far as performance goes, it can be a significant improvement on most DB servers... and would also be quite a unique feature for hibernate. best regards, viktor |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-06 02:55:00
|
If i've understood correctly, this could be done using a Hibernate custom type that writes numerical values using setString() instead or setLong(). It would be cool if you could try out that approach and tell me how it goes. (Custom types are cool. Do *use* them.) I'm surprised the JDBC driver would not do this automatically if its such a needed thing..... Gavin |
From: Christian M. <vc...@cl...> - 2002-08-06 02:09:17
|
Hi all, i was wondering if hibernate knows how to deal with the issue regarding = int2/int8 in Postgresql ? Example: create table message(id int8 not null primary key,name text); in my example i got 25 000 records in this table, if i issue the = following query: explain analyse select * from message where num=3D10; NOTICE: QUERY PLAN: Seq Scan on message (cost=3D0.00..1493.72 rows=3D1 width=3D117) (actual = time=3D521.00..521.00 rows=3D0 loops=3D1) Total runtime: 521.00 msec As you can see, Postgres did not use the index on id, there are 2 = possibles workarounds, either cast the parameter as an int8 as follow: explain analyse select * from message where num=3D10::int8; Or simpler just quote the paramater, postgres will cast it = automatically: explain analyse select * from message where num=3D'10'; And now the results: NOTICE: QUERY PLAN: Index Scan using message_pkey on message (cost=3D0.00..5.01 rows=3D1 = width=3D117) (actual time=3D0.00..0.00 rows=3D0 loops=3D1) Total runtime: 10.00 msec FIX: the best approach should be to quote any number paramater. Chris |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-06 01:59:13
|
>I would expect the following to happen: <snip> yep, thats right. The problem is that Hibernate models a collection as a seperate object from the entities contained in the collection. Thats why we (inefficiently) require two selects to materialize an association 1. To load the collection with ids + indices 2. To select all the referenced entities At some stage we need to rework this because of the inefficiency involved. But remember that not all Hibernate collections contain entities so this is a bit more work than it sounds (collections of values are retrieved in exactly one select). So essentially the collection cache (on CollectionPersister) caches the results of part 1. The entity cache (on ClassPersister) caches the results of part 2. (Just in case its been non-obvious from previous discussions, each entity class has its own ClassPersister + hence its own cache. Likewise each collection role has its own CollectionPersister + cache.) Anyway, I had spent so much time talking + thinking about all this that I knew exactly what to do to implement this (the collection cache) and so I just went ahead and did it last night. It only took me a couple of hours but would have taken someone else much longer. I've just got the configuration side left to worry about.... Gavin. |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-06 01:38:30
|
Yeah, we could add this code. The good thing about this is you can deployt the mappings with the classes (as I suggest) but then load them all in one shot. Except I would use: if( z.getName().endsWith(".hbm.xml") ) If you want to check in this code yourself, tell me your sourceforge username + I will add you to the project. Otherwise, I can add it tonight. Thanks |
From: Christian M. <vc...@cl...> - 2002-08-05 15:17:06
|
Hi all, I was thinking about a new method to load xml files in the datastore. I do not like the hardcoded filename approach nor the class one( it will = end with xml files all around java classes) My idea is to be able to load a .jar containing all the xml files ( = created wih ant for example at deployment time) public void StoreJarFile(string fileName) { JarFile jarFile =3D new = JarFile((Thread.currentThread().getContextClassLoader().getResource("file= Name")).getFile()); if(jarFile!=3Dnull) { Enumeration enum =3D jarFile.entries(); while(enum.hasMoreElements()) { ZipEntry z =3D (ZipEntry)enum.nextElement(); if(z.getName().endsWith(".xml")) this.storeInputStream(jarFile.getInputStream(z)); = =20 } } else log.error("Could not find "+fileName+"in the classpath"); } Such jar file could be in WEB-INF/classes in a web app. Let me know what do you think about it. Chris |
From: Urberg, J. <ju...@ve...> - 2002-08-05 13:42:11
|
I always forget to copy these to the list... I guess I don't understand the whole caching thing then. Let's use the following example: I have a loan with a collection of borrowers. I issue a query to get all the borrowers for a loan. Then I issue a query (or a load) to get a loan. I would expect the following to happen: 1) the query against Borrower loads the cache in the ClassPersister for the Borrower 2) the query against Loan causes the borrower collection on the Loan to get evaluated 3) Hibernate looks in the Borrower's cache to see if there are any Borrower records that match the Loan. 3a) If there are matching Borrowers, Hibernate builds a real Collection class filled with matching Borrower's 3b) If there are no matches, Hibernate puts issues a query to get matching Borrowers (or adds a proxy if it's a lazy collection) That would also mean I could issue one query that joined loan and borrower and returned both in the result set (which loads both caches), ignore the result set, then do a load on the Loan (which builds the loan from the loan cache and then does steps 2 & 3. Thoughts? Regards, John -----Original Message----- From: Gavin_King/Cirrus%CI...@ci... [mailto:Gavin_King/Cirrus%CI...@ci...] Sent: Friday, August 02, 2002 8:15 PM To: hib...@li... Subject: RE: [Hibernate-devel] Getting Collections to pull data from the cache >At the point a collection is loaded from the database, Hibernate should >disassemble each object in the collection and store that either with the >collection's owner's cached value or in a cache in the collection's >CollectionPersistor. > >Is that correct? yes. essentially correct. After the collection is initialized, the CollectionPersister should disassemble the collection (ie. turn it into an array of elements or array of elements and indices). Then any contained objects should also be disassembled ie. entities -> an id components -> property array subcollections -> an id mutable types -> a clone currently this logic is already implemented for you, but in the wrong place (on ClassPersister): ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ private Object disassemble(Object object, Type type, SessionImplementor session) throws HibernateException, SQLException { if ( object==null ) { return null; } else if( type.isPersistentObjectType() ) { return session.getID(object); } else if( type.isComponentType() ) { AbstractComponentType ctype = (AbstractComponentType) type; Type[] types = ctype.getSubtypes(); Object[] values = ctype.getValues(object); for ( int i=0; i<types.length; i++ ) { values[i] = disassemble( values[i], types[i], session ); } return values; } else if ( type.isPersistentCollectionType() ) { PersistentCollection pc; if ( object instanceof PersistentCollection ) { pc = (PersistentCollection) object; } else { pc = session.getArrayHolder(object); } return session.getLoadedID(pc); } else { // a leaf return type.deepCopy(object, session); } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ We should probably move the assemble() / disassemble() methods to the Type interface. This would be much more object oriented and flexible than the above (a really perfect example of the worst kind of non-use of polymorphism - but I had my reasons at the time....) After disassembly, we would need to keep the disassembled state in either the owning object's cache entry (but this conflicts a bit with lazy collection initialization) or a cache owned by the CollectionPersister. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Hibernate-devel mailing list Hib...@li... https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-05 13:38:40
|
>Is this kind of setup what you created the hibernate.cfg.xml for? Should we >also allow using that file instead of passing in all the information in the >JMX config? exactly. >> Anyway, I think we should support JMX because that seems >> to be the standards-oriented way of doing things like this. >Sounds good. I'll test it out this week. Thanks. Feel free to make whatever improvements.... |
From: Urberg, J. <ju...@ve...> - 2002-08-05 13:30:47
|
>> I've switched to the one mapping per class strategy >> (that seems to be the prefered way to use Hibernate) >> and the whole JMX bean thing doesn't make as much >> sense with that approach. I now just build a static >> SessionFactory in my data access object for only the >> classes which that DAO uses and don't bother with a >> SessionFactory bound in JNDI. > > I think it still makes sense. Depends upon what kind > of design you're using. My preferred approach is to > have a single SessionFactory + talk to that directly > from session beans. That way I have access to all classes > at once, which is good if theres complex associations in > the object model. If I would be using entity beans, the > approach you describe would make more sense. Is this kind of setup what you created the hibernate.cfg.xml for? Should we also allow using that file instead of passing in all the information in the JMX config? > (I am not a fan of entity beans, actually.) Me neither. I'm creating DAO objects for each session bean to wrap all the interaction with hibernate. > Anyway, I think we should support JMX because that seems > to be the standards-oriented way of doing things like this. Sounds good. I'll test it out this week. Thanks, John |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-05 13:18:19
|
>I've switched >to the one mapping per class strategy (that seems to be the prefered way to >use Hibernate) and the whole JMX bean thing doesn't make as much sense with >that approach. I now just build a static SessionFactory in my data access >object for only the classes which that DAO uses and don't bother with a >SessionFactory bound in JNDI. I think it still makes sense. Depends upon what kind of design you're using. My preferred approach is to have a single SessionFactory + talk to that directly from session beans. That way I have access to all classes at once, which is good if theres complex associations in the object model. If I would be using entity beans, the approach you describe would make more sense. (I am not a fan of entity beans, actually.) The preference for a single mapping document per class is (for me) more to do with keeping the codebase manageable in a team environment. Anyway, I think we should support JMX because that seems to be the standards-oriented way of doing things like this. Gavin |