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: Donnie H. <do...@ha...> - 2002-04-16 01:19:54
|
I'm pretty handy w/ Ant these days. If I can get the current environment (maybe directly from CVS), I can look and see where things stand. No promises, as I'm really swamped; plus this is mid-soccer season for my boys. ;) Donnie > -----Original Message----- > From: hib...@li... > [mailto:hib...@li...]On Behalf Of > Gavin_King/Cirrus%CI...@ci... > Sent: Sunday, April 14, 2002 9:58 PM > To: Brad Clow > Cc: hib...@li... > Subject: RE: [Hibernate-devel] SQL Server 2000 questions > > > > > > gavin, if hibernate is sticking with the one distribution (classes and > > source together) then i think the user should be able change the code > > and rebuild the distribution easily. to achieve this the ant script > > should be included and possibly the libs. if u wanted to tidy this > > aspect of the project up using ant as the one build tool, i can > > certainly give u a hand. also, the java source is currently included in > > the jar. > > building distributions is a hassle for me at the moment. Any help would be > very appreciated. And your suggestions are quite correct, of course. > > > i agree that writing bean-style property methods is tedious, but it is a > > task than can be fairly easily automated. > > Im using eclipse so its trivial. I really like the whole idea of > decoupling > the persistent representation from the internal implementation. > But I guess > its a matter of preference, so since theres no difficulty implemention > instance variable access, why not allow it? > > > _______________________________________________ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Anton v. S. <an...@ap...> - 2002-04-15 04:00:27
|
> But yeah, support for instance variable access never went in so > far, simply because it seemed like it would support a "worse" > coding style. Now I'm sounding real indecisive, huh? :) When in doubt, procrastinate? :) To add a decision factor: if it could be added as a feature without any cost, maybe some people would find that useful (although not me). But even if it only takes an hour of your time to implement, there are other costs: documenting it, explaining why it shouldn't really be used, adding choices which the user needs to understand and take into consideration. Choice is good if it provides important flexibility, but in this case it seems like it would fall more on the side of gratuitous bloat. BTW, I realize my argument may seem overly impassioned for an arguably minor issue, and if you add the feature anyway, I won't really mind. But when I said "don't give up your principles so easily", I was thinking of one of the features which attracted me to Hibernate in the first place: it seems to have almost everything I need, and very little I don't, and it works the way I expect it to. I don't get the same feeling when I use EJB frameworks, for example - which is why I avoid them when I can. Limiting user choice can be a good thing... Anton |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-15 03:29:32
|
> I'm saying that the requirement raised by Donnie - which I think I > share - doesn't seem to really be solved by adding instance variable > support. Sorry, I may have given the impression I was missing the main point, which is that people want to be able to do "bottom-up" style development as well as "top-down" style. I fully understand the importance of this. But the comment about generating properties being tedious got me thinking tangentially about people using vi or emacs or something..... But yeah, support for instance variable access never went in so far, simply because it seemed like it would support a "worse" coding style. Now I'm sounding real indecisive, huh? :) |
From: Anton v. S. <an...@ap...> - 2002-04-15 02:36:49
|
> > i agree that writing bean-style property methods is tedious, but it is a > > task than can be fairly easily automated. > > Im using eclipse so its trivial. I'm using Eclipse too, but it doesn't automate the creation of a large number of beans from an existing database schema - does it? > I really like the whole idea of decoupling > the persistent representation from the internal implementation. Me too. > But I guess its a matter of preference Don't give up your principles so easily! ;) > so since theres no difficulty implemention > instance variable access, why not allow it? My question would be: why allow it? The issue for me isn't Hibernate's reliance on setters/getters - it's really a more general concern, which is that if schema and mapping information is stored in three different places, then synchronizing them could become tedious, and error prone. I'm speaking theoretically because I haven't used Hibernate enough to know how important this might be in practice. I realize that if you rely on the beans as the central source for schema info, and can rely on MappingByReflection to get the mapping you want, then the problem I'm thinking of wouldn't exist. However, with an existing database, it looks to me as though it may not be that easy. So I'm looking at dealing with manual edits to the mapping XML, then synchronizing the beans with that, and synchronizing changes in the database too. Supporting instance variable access slightly reduces the number of places that are affected by schema changes, but as has been mentioned, property methods are easily automated, but the basic synchronization issue still exists. Besides, instance variable access would allow users to use non-bean classes, but that only seems to encourage the writing of bad code - what's the real advantage? So I'm saying that the requirement raised by Donnie - which I think I share - doesn't seem to really be solved by adding instance variable support. It seems to me that we haven't heard any really good arguments for doing that. (Course, I've only been subscribed to the list for 6 messages, so add salt to taste... ;) Anton |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-15 02:10:48
|
> gavin, if hibernate is sticking with the one distribution (classes and > source together) then i think the user should be able change the code > and rebuild the distribution easily. to achieve this the ant script > should be included and possibly the libs. if u wanted to tidy this > aspect of the project up using ant as the one build tool, i can > certainly give u a hand. also, the java source is currently included in > the jar. building distributions is a hassle for me at the moment. Any help would be very appreciated. And your suggestions are quite correct, of course. > i agree that writing bean-style property methods is tedious, but it is a > task than can be fairly easily automated. Im using eclipse so its trivial. I really like the whole idea of decoupling the persistent representation from the internal implementation. But I guess its a matter of preference, so since theres no difficulty implemention instance variable access, why not allow it? |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-15 01:58:06
|
> A full set round-trip tools that can propagate changes from the classes to > the mapping to the database (in arbitrary sequence :) would be great. The > easiest to implement is probably the one which goes from Hibernate's XML to > bean skeletons - that's pretty trivial. If such a tool doesn't already > exist and no-one gets to it before me, I'll probably implement that. I would love to have a toolset like that. Hopefully we can build it piece-by piece. |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-15 01:42:25
|
> I was able to figure out how to run FooBarTest. After setting the proper > "SelectMethod=cursor" parameter in the URL, I was able to run a large number > of the tests. Here are a couple of the issues I encountered: Sorry, I should have mentioned the SelectMethod=cursor bit. Its very important. > In testLoad there was a NPE, though the program kept running: Dont worry, the NPE is intended as a test. > In testQuery, there was this exception: > testQuery... > Exception in thread "main" java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [snip] >I couldn't quite figure out what was underlying this issue. You'll note from >the "... 6 more" line that this was under JDK 1.4. It was with the 0.9.8 >release. Urrghhh thats an unhelpful looking stacktrace. I might mess with TestCase to unwrap the wrapped exception. Been meaning to do that for a while. Alternatively I could switch to JUnit which everyone else seems to be in favor of..... I have looked at this problem in the past but I forget exactly what the root cause was. I did verify that it was something I couldn't easily fix.... It would be very nice if we can establish exactly which subset of hibernate's functionality is working using the MS driver. It might turn out to be a large enough subset for some people's requirements. > A couple of other comments, most of which you probably know: > 1) The sybase dialect really isn't appropriate for SQL Server 2000. SS2K has > data types that a lot more directly map to the java.sql.Types (e.g. bit to > BIT, bigint to BIGINT, etc.). Thankyou for letting me know this. Would you like to write an MSSQLDialect for us? You seem to know the platform much better than me. > 2) In trying to workaround one problem, I had to change some hibernate code > (nothing permanent). The lack of a build facility meant I had to cobble > together a batch file to do that. A nice Ant script would be great (maybe I > missed something in the download). Try checking out the latest CVS. (There are also some improvements/fixes in there that I really should have released weeks ago - been so busy) > 3) This is more of a philosophical thing. I agree quite fully about the > reflection-based approach to mapping. However, I tend to think that the DB > should be the authority when it comes to the schema, not the app or a .xml > file. This is primarily because the things that one can specify about the > schema in, for example, Enterprise Manager start getting fairly > database-specific (constraints, triggers, etc.); and they aren't necessarily > important to represent in the .xml file. So I tend to start in the database > and try to take as much advantage as possible of its capabilities to > declaratively define the schema and the rules for enforcing data integrity. Can you give me a better idea of exactly how you would divide responsibility here. It sort of seems to me that _schemas_ are easy things to keep in the database but _mappings_ not so easy.... One intended approach is to define all schemas on the DB and use the mapping file as a map _only_. You dont need to use the schema generation tool. I'm very open to new ideas on all this.... > Another point is that writing bean-style property methods on a class is > excruciatingly tedious. Aaahhhh ... being an IDE-user I probably underestimate the pain in this for some people. You know, it would be about an hours work to let hibernate use also instance variables directly. Would anyone like this? > What I'm getting at is that I'd like to see a > generator facility to go from the schema to the .xml and from the .xml to > the skeleton of the bean classes. It wouldn't need to be a required > capability to use Hibernate, more of an optional facility like the current > schema generator. That would be nice. If anyone wants to contribute something like that we should certainly include it. > Just one man's opinion... Which is very welcome :) peace Gavin > -----Original Message----- > From: Gavin_King/Cirrus%CI...@ci... > [mailto:Gavin_King/Cirrus%CI...@ci...] > Sent: Saturday, April 13, 2002 9:12 PM > To: Donnie Hale > Cc: hib...@li... > Subject: RE: [Hibernate-devel] SQL Server 2000 questions > > > > > Don't know if/when you'll get this, but thought I'd send it while I go > off > > and look into things. > > > Are there instructions, or can you point me in the right direction, to > run > > the test suite against a particular JDBC driver / database? I > want to run > it > > against SQL Server 2K w/ the MS JDBC driver just to see what I discover. > > The class cirrus.hibernate.test.FooBarTest is executable. Run it with > "mssql" as a command line argument. > > Hope thats enough to get you started. Any problems let me know. > > peace > > Gavin > > |
From: Brad C. <bra...@wo...> - 2002-04-15 00:40:45
|
hi donnie get the cvs version. it has an ant build script that enables u to compile, javadoc, test, etc. gavin, if hibernate is sticking with the one distribution (classes and source together) then i think the user should be able change the code and rebuild the distribution easily. to achieve this the ant script should be included and possibly the libs. if u wanted to tidy this aspect of the project up using ant as the one build tool, i can certainly give u a hand. also, the java source is currently included in the jar. on your philosophical topic (and each to his/her own here), i work the opposite way (even after being a dba somewhere in the dim, dark past). i find it much more intuitive and less time consuming to work at the object level, since that is what all my code that implements the application's logic is directly manipulating. how those objects are persisted is then not the most important thing. having said that, i do go and check/tweak the schema to ensure integrity and performance. just my thoughts, like i said, each to there own. i agree that writing bean-style property methods is tedious, but it is a task than can be fairly easily automated. brad > -----Original Message----- > From: Donnie Hale [mailto:do...@ha...] > Sent: Monday, 15 April 2002 5:13 AM > To: hib...@li... > Subject: RE: [Hibernate-devel] SQL Server 2000 questions >=20 >=20 > Gavin, >=20 > Thanks for responding. >=20 > I was able to figure out how to run FooBarTest. After setting=20 > the proper > "SelectMethod=3Dcursor" parameter in the URL, I was able to run=20 > a large number > of the tests. Here are a couple of the issues I encountered: >=20 > In testLoad there was a NPE, though the program kept running: >=20 > testLoad... > java.lang.NullPointerException > at > cirrus.hibernate.impl.RelationalDatabaseSession$Key.hashCode(R > elationalDatab > aseSession.java:183) > at java.util.HashMap.hash(HashMap.java:250) > at java.util.HashMap.get(HashMap.java:301) > at > cirrus.hibernate.impl.RelationalDatabaseSession.save(Relationa > lDatabaseSessi > on.java:464) > at > cirrus.hibernate.impl.RelationalDatabaseSession.insert(Relatio > nalDatabaseSes > sion.java:445) > at=20 > cirrus.hibernate.test.FooBarTest.testLoad(FooBarTest.java:178) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > orImpl.java:39 > ) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > odAccessorImpl > .java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at cirrus.hibernate.test.TestCase.run(TestCase.java:46) > at cirrus.hibernate.test.FooBarTest.main(FooBarTest.java:1217) >=20 > In testQuery, there was this exception: >=20 > testQuery... > Exception in thread "main" java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > orImpl.java:39 > ) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > odAccessorImpl > .java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at cirrus.hibernate.test.TestCase.run(TestCase.java:46) > at cirrus.hibernate.test.FooBarTest.main(FooBarTest.java:1217) > Caused by: java.lang.Exception: component query > at cirrus.hibernate.test.TestCase.assertTrue(TestCase.java:66) > at=20 > cirrus.hibernate.test.FooBarTest.testQuery(FooBarTest.java:323) > ... 6 more >=20 > I couldn't quite figure out what was underlying this issue.=20 > You'll note from > the "... 6 more" line that this was under JDK 1.4. It was=20 > with the 0.9.8 > release. >=20 > A couple of other comments, most of which you probably know: >=20 > 1) The sybase dialect really isn't appropriate for SQL Server=20 > 2000. SS2K has > data types that a lot more directly map to the java.sql.Types=20 > (e.g. bit to > BIT, bigint to BIGINT, etc.). >=20 > 2) In trying to workaround one problem, I had to change some=20 > hibernate code > (nothing permanent). The lack of a build facility meant I had=20 > to cobble > _______________________________ > brad clow > chief technical officer > workingmouse >=20 > email: bra...@wo... > web: http://www.workingmouse.com >=20 |
From: Anton v. S. <an...@ap...> - 2002-04-15 00:35:47
|
Donnie Hale wrote: > Another point is that writing bean-style property methods on a > class is excruciatingly tedious. What I'm getting at is that > I'd like to see a generator facility to go from the schema to > the .xml and from the .xml to the skeleton of the bean classes. > It wouldn't need to be a required capability to use Hibernate, > more of an optional facility like the current schema generator. I'll second that. I've just begun using Hibernate (I'm very impressed with it, BTW!) and this is one of the first requirements I ran into. In the first project I'm using it on, what I'm doing to deal with the above issue is a little perverse, but it's working for my purposes so far: I wrote some code to generate the bean skeletons from my database schema. This was pretty simple to do given that I was able to make assumptions about this particular system and database, and even naming conventions, in order to come up with a decent set of bean skeletons. I then used Hibernate's MappingByReflection class to generate a Hibernate XML mapping. This has worked pretty well for me as a starting point, but it's by no means general or complete. A full set round-trip tools that can propagate changes from the classes to the mapping to the database (in arbitrary sequence :) would be great. The easiest to implement is probably the one which goes from Hibernate's XML to bean skeletons - that's pretty trivial. If such a tool doesn't already exist and no-one gets to it before me, I'll probably implement that. > I tend to think that the DB should be the authority when it comes to the schema I'm guessing most Hibernate users are using their Java classes as the master source of schema information, otherwise the tools we're looking for would already exist... ;) Anton |
From: Donnie H. <do...@ha...> - 2002-04-14 19:01:42
|
Gavin, Thanks for responding. I was able to figure out how to run FooBarTest. After setting the proper "SelectMethod=cursor" parameter in the URL, I was able to run a large number of the tests. Here are a couple of the issues I encountered: In testLoad there was a NPE, though the program kept running: testLoad... java.lang.NullPointerException at cirrus.hibernate.impl.RelationalDatabaseSession$Key.hashCode(RelationalDatab aseSession.java:183) at java.util.HashMap.hash(HashMap.java:250) at java.util.HashMap.get(HashMap.java:301) at cirrus.hibernate.impl.RelationalDatabaseSession.save(RelationalDatabaseSessi on.java:464) at cirrus.hibernate.impl.RelationalDatabaseSession.insert(RelationalDatabaseSes sion.java:445) at cirrus.hibernate.test.FooBarTest.testLoad(FooBarTest.java:178) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at cirrus.hibernate.test.TestCase.run(TestCase.java:46) at cirrus.hibernate.test.FooBarTest.main(FooBarTest.java:1217) In testQuery, there was this exception: testQuery... Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at cirrus.hibernate.test.TestCase.run(TestCase.java:46) at cirrus.hibernate.test.FooBarTest.main(FooBarTest.java:1217) Caused by: java.lang.Exception: component query at cirrus.hibernate.test.TestCase.assertTrue(TestCase.java:66) at cirrus.hibernate.test.FooBarTest.testQuery(FooBarTest.java:323) ... 6 more I couldn't quite figure out what was underlying this issue. You'll note from the "... 6 more" line that this was under JDK 1.4. It was with the 0.9.8 release. A couple of other comments, most of which you probably know: 1) The sybase dialect really isn't appropriate for SQL Server 2000. SS2K has data types that a lot more directly map to the java.sql.Types (e.g. bit to BIT, bigint to BIGINT, etc.). 2) In trying to workaround one problem, I had to change some hibernate code (nothing permanent). The lack of a build facility meant I had to cobble together a batch file to do that. A nice Ant script would be great (maybe I missed something in the download). 3) This is more of a philosophical thing. I agree quite fully about the reflection-based approach to mapping. However, I tend to think that the DB should be the authority when it comes to the schema, not the app or a .xml file. This is primarily because the things that one can specify about the schema in, for example, Enterprise Manager start getting fairly database-specific (constraints, triggers, etc.); and they aren't necessarily important to represent in the .xml file. So I tend to start in the database and try to take as much advantage as possible of its capabilities to declaratively define the schema and the rules for enforcing data integrity. Another point is that writing bean-style property methods on a class is excruciatingly tedious. What I'm getting at is that I'd like to see a generator facility to go from the schema to the .xml and from the .xml to the skeleton of the bean classes. It wouldn't need to be a required capability to use Hibernate, more of an optional facility like the current schema generator. Just one man's opinion... Thanks again, Donnie > -----Original Message----- > From: Gavin_King/Cirrus%CI...@ci... > [mailto:Gavin_King/Cirrus%CI...@ci...] > Sent: Saturday, April 13, 2002 9:12 PM > To: Donnie Hale > Cc: hib...@li... > Subject: RE: [Hibernate-devel] SQL Server 2000 questions > > > > > Don't know if/when you'll get this, but thought I'd send it while I go > off > > and look into things. > > > Are there instructions, or can you point me in the right direction, to > run > > the test suite against a particular JDBC driver / database? I > want to run > it > > against SQL Server 2K w/ the MS JDBC driver just to see what I discover. > > The class cirrus.hibernate.test.FooBarTest is executable. Run it with > "mssql" as a command line argument. > > Hope thats enough to get you started. Any problems let me know. > > peace > > Gavin > > |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-14 01:25:27
|
> Don't know if/when you'll get this, but thought I'd send it while I go off > and look into things. > Are there instructions, or can you point me in the right direction, to run > the test suite against a particular JDBC driver / database? I want to run it > against SQL Server 2K w/ the MS JDBC driver just to see what I discover. The class cirrus.hibernate.test.FooBarTest is executable. Run it with "mssql" as a command line argument. Hope thats enough to get you started. Any problems let me know. peace Gavin |
From: Donnie H. <do...@ha...> - 2002-04-12 22:12:07
|
Don't know if/when you'll get this, but thought I'd send it while I go off and look into things. Are there instructions, or can you point me in the right direction, to run the test suite against a particular JDBC driver / database? I want to run it against SQL Server 2K w/ the MS JDBC driver just to see what I discover. Many thanks, Donnie Hale > -----Original Message----- > From: hib...@li... > [mailto:hib...@li...]On Behalf Of > Gavin_King/Cirrus%CI...@ci... > Sent: Saturday, March 16, 2002 8:30 PM > To: Donnie Hale > Cc: hib...@li... > Subject: Re: [Hibernate-devel] SQL Server 2000 questions > > > > The one I have been using is JSQL from: > > http://www.j-netdirect.com/ > > This particular driver seems to work beautifully. > > I have just verified that Weblogic jDriver also works (with one very minor > test failure). > > FreeTDS certainly does *not* work. I _think_ someone reported that > > http://www.inetsoftware.de/ > > also does *not* work. (Havn't tried this myself) > > The latest version of Microsoft's driver doesn't pass all tests, but it > does pass *some*. It might be almost possible to get it working, but I'm > not particularly optimistic. (If you want to try, you _must_ use the > SelectMethod=cursor JDBC connection parameter.) > > Good Luck > > Gavin > > > _______________________________________________ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Phillip B. <phi...@cl...> - 2002-04-04 09:02:00
|
Thanks for the speedy solution Gavin. Will give it go. PhillipB. Gavin_King/Cirrus%CI...@ci... wrote: > >The bug is now fixed in CVS. > >Enjoy ! > > |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-04 02:03:01
|
The bug is now fixed in CVS. Enjoy ! |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-04-02 12:41:58
|
Thanks for that Philip - I see the bug: nullifyTransientReferences() should check if the component is null before grabbing its properties. I will add a test and fix the bug in CVS ASAP (tomorrow). sorry for my slow ping-time I have been camping in Tasmania for last few days. peace Gavin |
From: Phillip B. <phi...@cl...> - 2002-04-01 09:50:28
|
Gidday all, I'm having endless problems trying to do what I thought would be a no-brainer exercise with a Component property. Basically my classes are like the Person -> Name compoent example in the tutorial doc. I have a Listing class which contains a PhoneNumber property. PhoneNumber simply has four String properties which are mapped to the Listing class's table. So my mapping looks like this... <class name="phonebook.model.Listing" table="Listing" select="distinct"> <id name="UID" type="long" column="UID"> <generator class="hilo.long"/> </id> <property name="name" column="name" type="string"/> <component name="businessNumber" class="phonebook.model.PhoneNumber"> <property name="countryCode" column="countryCode" type="string"/> <property name="areaCode" column="areaCode" type="string"/> <property name="phoneNumber" column="phoneNumber" type="string"/> <property name="extension" column="extension" type="string"/> </component> If I try to save a Listing the following exception is thrown... java.lang.NullPointerException at java.lang.reflect.Method.invoke(Native Method) at cirrus.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:152) at cirrus.hibernate.type.ComponentType.getValues(ComponentType.java:171) at cirrus.hibernate.impl.RelationalDatabaseSession.nullifyTransientReferences(RelationalDatabaseSession.java:527) at cirrus.hibernate.impl.RelationalDatabaseSession.nullifyTransientReferences(RelationalDatabaseSession.java:517) at cirrus.hibernate.impl.RelationalDatabaseSession.save(RelationalDatabaseSession.java:484) at cirrus.hibernate.impl.RelationalDatabaseSession.save(RelationalDatabaseSession.java:434) at phonebook.model.ListingFactory.save(ListingFactory.java:125) This exception is being caused because Listing.getBusinessNumber() is returning a null. Ok so I thought I'd work around the problem by initialising the property in the default constructor. That worked. Now the Listing could be saved. Tried deleting it next using session.delete("FROM listing IN CLASS phonebook.model.Listing") and got the following similar exception... java.lang.NullPointerException at java.lang.reflect.Method.invoke(Native Method) at cirrus.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:152) at cirrus.hibernate.type.ComponentType.getValues(ComponentType.java:171) at cirrus.hibernate.impl.RelationalDatabaseSession.nullifyTransientReferences(RelationalDatabaseSession.java:527) at cirrus.hibernate.impl.RelationalDatabaseSession.nullifyTransientReferences(RelationalDatabaseSession.java:517) at cirrus.hibernate.impl.RelationalDatabaseSession.delete(RelationalDatabaseSession.java:590) at cirrus.hibernate.impl.IdentifierIterator.remove(IdentifierIterator.java:116) at cirrus.hibernate.impl.RelationalDatabaseSession.delete(RelationalDatabaseSession.java:669) at cirrus.hibernate.impl.RelationalDatabaseSession.delete(RelationalDatabaseSession.java:651) at phonebook.model.ListingFactory.deleteAll(ListingFactory.java:67) Running up the debugger I could see the Iterator was returning the Listing that had been saved. As documented in the tutorial doc, because all the PhoneNumber properties were blank, the businessNumber property ended up being set to null when loaded. This then resulted in same exception as when saving. So after all that my question is - is this a bug? How should null Component properties be handled? thanks PhillipB |
From: Sven W. <s_...@in...> - 2002-03-31 14:44:06
|
> private Connection getConnection(); > private Session getHibernateSession() > { > Session s = null; > try > { > Datastore ds = > Hibernate.createDatastore(); > ds = > ds.storeFile("/home/son/mapping.xml"); > SessionFactory sessionFactory = > ds.buildSessionFactory(); > Connection conn = getConnection(); > s = sessionFactory.openSession(conn); > } > catch (Exception ex) > { > ex.printStackTrace(); > } > return s; > } > > ----end--- > The EJB container I'm using is JBoss2.4.4 and the > database is postgresql7.1 [...] > This happens when I connect to the bean 32 times. It > seems hibernate is not releasing the Connection even > though I did a session.close(). When I try to connect > to postgres directly using JDBC, I get > > Exception: java.sql.SQLException: Sorry, too many > clients already > It's not a but it's a feature ;-) Somewhere is the docs is written: If you supply a connection (you _are_ doing this with openSession (your_CONNECTION!)) _you_ have to be responsible for closing the connection. Hibernate will only close connections that where created directly by hibernate. BTW: - If you're using JBoss you can set the connection pooling to "blocking" if there are no free connections left. - If you're coding in a J2EE environment your beans should not access the filesystem in a direct way (it is possible to load the mapping file via class.getRessource (...)) HTH Sven -- Planung bedeutet den Zufall durch den Irrtum zu ersetzten. |
From: Son To <son...@ya...> - 2002-03-31 05:59:13
|
I'm testing out hibernate-0.9.8 and there seems to be a bug. Here is the code to the relevant code in stateless session bean: --start----- public List findAllProduct() { Session session = getHibernateSession(); List productList = null; try { productList = session.find("select product from product in class openbx.domain.Product"); session.close(); } catch (Exception ex) { ex.printStackTrace(); } return productList; } private Connection getConnection() { ServiceLocator sL = ServiceLocator.getInstance(); Connection conn = null; try { DataSource ds = (DataSource)sL.lookup(sL.JDBC_DATASOURCE); conn = ds.getConnection(); } catch (Exception ex) { ex.printStackTrace(); } return conn; } private Session getHibernateSession() { Session s = null; try { Datastore ds = Hibernate.createDatastore(); ds = ds.storeFile("/home/son/mapping.xml"); SessionFactory sessionFactory = ds.buildSessionFactory(); Connection conn = getConnection(); s = sessionFactory.openSession(conn); } catch (Exception ex) { ex.printStackTrace(); } return s; } ----end--- The EJB container I'm using is JBoss2.4.4 and the database is postgresql7.1 Here is Jboss error log: [ERROR,Default] java.lang.NullPointerException [ERROR,Default] at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source) ...skip ...skip ...skip [ERROR,Default] java.lang.NullPointerException [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSession.getPreparedStatement(RelationalDatabaseSession.java:1774) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSession.prepareQueryStatement(RelationalDatabaseSession.java:717) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSession.find(RelationalDatabaseSession.java:760) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSession.find(RelationalDatabaseSession.java:710) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSession.find(RelationalDatabaseSession.java:620) This happens when I connect to the bean 32 times. It seems hibernate is not releasing the Connection even though I did a session.close(). When I try to connect to postgres directly using JDBC, I get Exception: java.sql.SQLException: Sorry, too many clients already So next I attempted to investigate why hibernate is not releasing the Connection. I compiled the source code distributed in hibernate-0.9.8.tar.gz. Everything compiled fine, but when I redeployed my bean using the hibernate.jar compiled from source, I get a different problem. Here is JBoss error message: ---- [ERROR,Default] javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.NullPointerException [ERROR,Default] at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:946) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSessionFactory.<init>(RelationalDatabaseSessionFactory.java:102) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatabaseSessionFactory.<init>(RelationalDatabaseSessionFactory.java:135) [ERROR,Default] at cirrus.hibernate.impl.RelationalDatastore.buildSessionFactory(RelationalDatastore.java:50) at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:946) at cirrus.hibernate.impl.RelationalDatabaseSessionFactory.<init>(RelationalDatabaseSessionFactory.java:102) at cirrus.hibernate.impl.RelationalDatabaseSessionFactory.<init>(RelationalDatabaseSessionFactory.java:135) at cirrus.hibernate.impl.RelationalDatastore.buildSessionFactory(RelationalDatastore.java:50) --- I got the same result when compiling from code in CVS. So the question for Gavin is what is the source code for hibernate.jar that id distributed with hibernate0.9.8.tar.gz? thanks, Son __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-03-25 13:51:50
|
Thanks Brad, that looks fine..... |
From: Brad C. <bra...@wo...> - 2002-03-25 03:56:05
|
currently hibernate requires the setting of a jndi class and jndi url, when using a datasource. i would like to make these optional. to achieve this, i have modified (but not commited) DatasourceConnectionProvider.java to look like: // we want to be able to just use the defaults, if jndi environment properties are not supplied if (jndi_class != null) { hash.put(Context.INITIAL_CONTEXT_FACTORY, jndi_class); } if (jndi_url != null) { hash.put(Context.PROVIDER_URL, jndi_url); } try { ctx = new InitialContext(hash); .... this works fine in the web container i am currently using and fine in jboss. however i don't know a great deal about jndi, so comments r welcome. if i don't hear anything negative over the next day, i will commit this. thanx brad _______________________________ brad clow chief technical officer workingmouse email: bra...@wo... web: http://www.workingmouse.com |
From: Brad C. <bra...@wo...> - 2002-03-24 23:42:14
|
i just committed the changes to the hilogenerator for quoting the column name in all sql statements. i have used double quotes and the tests have passed both in sap db and oracle. if double quotes are illegal in one of the other supported rdbms' perhaps the quote used could be made dialect specific. to get around the double problem, i reduced the size of the value that the double is set to in Foo.java. i have set alter table support to false, to get around the syntax problems with the alter table statements generated in the schema export. this is a lower priority for me at the moment than some other things, so i won't get to look at this for perhaps a week or so. sequences are supported. i will add support for them to the dialect today/tommorrow. brad ----- Original Message ----- From: <Gavin_King/Cirrus%CI...@ci...> To: "Brad Clow" <bra...@wo...> Cc: <hib...@li...> Sent: Saturday, March 23, 2002 10:21 AM Subject: Re: [Hibernate-devel] SAP DB dialect > > > i have just commited the sap db dialect to cvs. > > Excellent! Thanks Brad. :) > > > gavin, r u still happy for me to change the default column name for the > > hilogenerator from next to next_hi (sap db gets upset when DBSchemaExport > > tries to create the hibernate_unique_key table with a column name of > next, > > as it is a reserved word)? > > When we discussed this earlier other people seemed to prefer that we try > using quoted "next". If we can get that working with all platforms its > probably preferable. Can you try it out with SAP, please? > > > the test suite fails on testCreateUpdate due to the size of the double in > > Foo.java. sap db seems to support to +1e-64, but Foo's double is set to > > 1.33e-69, so the exponent seems to large to me. however the jdbc driver > > appears to reduce it even more. i could only get to 1.33e-36 for the > test > > to be successful. i will send a message to the sapdb mailing list about > > this. > > Interbase also has a problem like this, i think. I got round it by > disabling > part of the test. Thats a bit of a crude approach, I guess. Anyways, either > change or disable the test if you like, whatever works.... > > Have you got the schema export working? Someone else reported that the > "alter table add constraint" syntax is not supported by SAP DB so do > we need to support alternative forms in Dialect? > > Does SAP support sequences or identity columns? > > > |
From: Christoph S. <ch...@sc...> - 2002-03-23 18:20:36
|
> > > >Basically, when I got round to implementing this, I >had a look around and discovered that the open source >solutions for databinding had improved a whole lot >and I didn't want to try and waste time doing what >other people are doing better > What open source stuff did you look at? Can you recommend something? |
From: Donnie H. <do...@ha...> - 2002-03-23 17:37:55
|
> > If I was redoing this from scratch I would take a close look > at using JAXB or something similar for parsing the mapping > file. > FWIW, the Jakarta Commons "Digester" project might be very appropriate for this kind of XML-file parsing. You create a digester, give it the rules it should follow when it encounters elements of various types, and then tell it to go. At the end, you have an object graph representing the XML. Tomcat and Struts use it to parse their config files. FWIW... Donnie |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-03-23 02:08:18
|
> Why was JDom chosen as the XML toolkit of choice? I > think using Dom4J or something else that supports > XPath would make life much easier in the mapping file. Actually to parse mapping files (DOCTYPE hibernate-mapping.dtd) I'm using vanilla JAXP. This was probably a mistake. JDOM is used to construct XML representation of persistent objects. Don't think XPATH would help us here. I've never used DOM4J. Is it better than JDOM in other ways? If I was redoing this from scratch I would take a close look at using JAXB or something similar for parsing the mapping file. > I am currently working on an XML mapping system where > I work (specific use) and am wondering what your plans > are for XML. Is it going to be the same interface as > your SQL databinding? I'm not sure if you realise, but XML generation is already implemented. It just isn't documented in the tutorial. Check the JavaDocs for a quick summary. Start out with SessionFactory.openDatabinder() Basically, when I got round to implementing this, I had a look around and discovered that the open source solutions for databinding had improved a whole lot and I didn't want to try and waste time doing what other people are doing better. I figured plenty of other projects are trying to let you arbitrarily map XML to objects and vice-versa. So I decided to do something real simple. 1. I didn't want to introduce yet another OO to XML mapping language. 2. I wanted XML generation for persistent classes to "just work". ie. you don't need to do any mapping at all most of the time. 3. I wanted it to be _possible_ to customize the generated XML either on a per-class or whole application basis. My solution was to use XSLT as the mapping language and provide a default stylesheet that does what you would probably want. You can customize the stylesheet to alter the mapping for individual classes, or for all classes at once. I kinda like this. So XML generation became a two-step process. 1. generate a "generic" XML representation that is amenable to manipulation by XSLT and includes as much information as you could possibly want. <object class="Foo" package="cirrus.hibernate.test"> <uid name="key" type ="string">52b16c9d:ecc0e74d:00ec:c0e7d476:0011</uid> <property name="foo" type="cirrus.hibernate.test.Foo" /> ..... </object> 2. use Xalan to process that XML with the (custom or default) stylesheet. <Foo id="N400005"> <key>52b16c9d:ecc0e74d:00ec:c0e7d476:0011</key> <foo/> ...... </Foo> There would be some extra problems in going backward from XML to Java but I didn't want to waste too much time on that problem if no-one was using hibernate for XML generation. (I guess I should start by documenting it, though.) |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-03-23 00:33:43
|
> i have just commited the sap db dialect to cvs. Excellent! Thanks Brad. :) > gavin, r u still happy for me to change the default column name for the > hilogenerator from next to next_hi (sap db gets upset when DBSchemaExport > tries to create the hibernate_unique_key table with a column name of next, > as it is a reserved word)? When we discussed this earlier other people seemed to prefer that we try using quoted "next". If we can get that working with all platforms its probably preferable. Can you try it out with SAP, please? > the test suite fails on testCreateUpdate due to the size of the double in > Foo.java. sap db seems to support to +1e-64, but Foo's double is set to > 1.33e-69, so the exponent seems to large to me. however the jdbc driver > appears to reduce it even more. i could only get to 1.33e-36 for the test > to be successful. i will send a message to the sapdb mailing list about > this. Interbase also has a problem like this, i think. I got round it by disabling part of the test. Thats a bit of a crude approach, I guess. Anyways, either change or disable the test if you like, whatever works.... Have you got the schema export working? Someone else reported that the "alter table add constraint" syntax is not supported by SAP DB so do we need to support alternative forms in Dialect? Does SAP support sequences or identity columns? |