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: Konstantin P. <kpr...@ya...> - 2003-01-03 10:14:43
|
> Really? I just downloaded the 1.2b2 jars and there > is an > xdoclet-module-hibernate-1.2b2.jar file. It appears > to be doing something > (but not functioning, still need to dig). Well, they were released too. I do not know much about maven, but from ant everything works fine.... regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
From: <de...@op...> - 2003-01-03 10:06:58
|
hi, - counter: I can now exclude general support for identity columns as in access autonumber can be only of its type "long integer", and hence cannot be prescribed by the user - while fighting with foobar test on access (on this I am still working), I tried it also on mysql, where it gives: on foobar, out of 59 test methods, 4 failures 1 error (TestFindLoad) (just te let you know) . - schema updater: I am trying to make it work also in version 1.2.1 : looking at sources, 1.2 uses: Map columnInfo = getColumnInfo(connection); this then is an internal method 1.2.1 uses: JdbcDatabaseInfo info = new JdbcDatabaseInfo(connection, dialect); and this uses the new updater package. In this release you must be asking a little more from the jdbc driver; do you know what, and whether it could be made compatible with 1.2 ? bye ------------------------------------------------------------------------------------------------------------------------------------------ work progress / avanzamento lavori: wo...@op... customer support / supporto clienti: su...@op... administrative questions / questioni amministrative: ad...@op... development questions / informazioni sviluppo software: de...@op... promotion & image campaigns / informazioni promozione e immagine: res...@op... for further support / per informazioni: in...@op... open lab s.r.l. via venezia 18b 50121 firenze italy phone +39 055 5522779 fax +39 055 5532702 Italy www.open-lab.com ------------------------------------------------------------------------------------------------------------------------------------------ |
From: Gavin K. <Gav...@ex...> - 2003-01-03 07:08:07
|
In that implementation the JNDI server maintains the reference to the singleton SessionFactory, and the ThreadLocal holds the reference to the "single-per-transaction" Session. There are, of course, other ways to accomplish this.... > -----Original Message----- > From: Matt Raible [mailto:ma...@ra...]=20 > Sent: Friday, 3 January 2003 5:03 PM > To: hib...@li... > Subject: RE: [Hibernate] Hibernate Thread Local Session and JUnit >=20 >=20 > I'm using the Thread Local Session as described at=20 > http://hibernate.bluemars.net/42.html. To my knowledge, this=20 > is a singleton - or do I need to get fancier, as this > (http://members.tripod.com/rwald/java/articles/Singleton_in_Java.html) > suggests? >=20 > Thanks, >=20 > Matt >=20 > > -----Original Message----- > > From: hib...@li... > > [mailto:hib...@li...] On=20 > > Behalf Of Gavin King > > Sent: Thursday, January 02, 2003 7:47 PM > > To: Matt Raible; hib...@li... > > Subject: RE: [Hibernate] Hibernate Thread Local Session and JUnit > >=20 > >=20 > >=20 > > > The old way I was doing it - now obviously kludgy - was=20 > to create a=20 > > > new session factory everytime I initialized a DAO. > >=20 > > That would have been your problem. You *must* make sure that > > ALL DAOs are using the same Session instance. (And=20 > > SessionFactory _should_ certainly be a singleton.) > >=20 > >=20 > > ********** CAUTION - Disclaimer ********** > > This message may contain privileged and confidential > > information. If you are not the intended recipient of this=20 > > message (or responsible for delivery of the message to such=20 > > person) you are hereby notified that any use, dissemination,=20 > > distribution or reproduction of this message is prohibited.=20 > > If you have received this message in error, you should=20 > > destroy it and kindly notify the sender by reply e-mail.=20 > > Please advise immediately if you or your employer do not=20 > > consent to Internet e-mail for messages of this kind.=20 > > Opinions, conclusions and other information in this message=20 > > that do not relate to the official business of Expert=20 > > Information Services Pty Ltd ("The Company") shall be=20 > > understood as neither given nor endorsed by it. > >=20 > > The Company advises that this e-mail and any attached > > files should be scanned to detect viruses. The Company accepts no=20 > > liability for loss or damage (whether caused by negligence or not)=20 > > resulting from the use of any attached files. > > **EIS******** End of Disclaimer ********** > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > 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 > >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > 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 >=20 |
From: Matt R. <ma...@ra...> - 2003-01-03 06:03:03
|
I'm using the Thread Local Session as described at http://hibernate.bluemars.net/42.html. To my knowledge, this is a singleton - or do I need to get fancier, as this (http://members.tripod.com/rwald/java/articles/Singleton_in_Java.html) suggests? Thanks, Matt > -----Original Message----- > From: hib...@li... > [mailto:hib...@li...] On > Behalf Of Gavin King > Sent: Thursday, January 02, 2003 7:47 PM > To: Matt Raible; hib...@li... > Subject: RE: [Hibernate] Hibernate Thread Local Session and JUnit > > > > > The old way I was doing it - now obviously kludgy - was to > > create a new session factory everytime I initialized a DAO. > > That would have been your problem. You *must* make sure that > ALL DAOs are using the same Session instance. (And > SessionFactory _should_ certainly be a singleton.) > > > ********** CAUTION - Disclaimer ********** > This message may contain privileged and confidential > information. If you are not the intended recipient of this > message (or responsible for delivery of the message to such > person) you are hereby notified that any use, dissemination, > distribution or reproduction of this message is prohibited. > If you have received this message in error, you should > destroy it and kindly notify the sender by reply e-mail. > Please advise immediately if you or your employer do not > consent to Internet e-mail for messages of this kind. > Opinions, conclusions and other information in this message > that do not relate to the official business of Expert > Information Services Pty Ltd ("The Company") shall be > understood as neither given nor endorsed by it. > > The Company advises that this e-mail and any attached > files should be scanned to detect viruses. The Company > accepts no liability for loss or damage (whether caused > by negligence or not) resulting from the use of any > attached files. > **EIS******** End of Disclaimer ********** > > > > ------------------------------------------------------- > 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: Richard M. <rn...@cu...> - 2003-01-03 05:32:30
|
(Sorry, to repost, I forgot to change subject) Konstantin/all, Thanks very much for your xdoclet/hibernate/jboss example. I have learned a lot. It has made me re-think my current application approach. Maybe I will use EJB's after all. One question, I'm new to JBoss. Should the example run in a vanilla JBoss 3.0.4 (with Tomcat) install? I changed the hibernate.properties before building and now it deploy's fine. But when I run the client (run.sh) I get two errors: 1) cannot fine DefaultDS data source and 2) no users.properties found. I checked the default hsqldb-service.xml file and all seems fine - hibernate and JBoss use the same default userid and password. I read a little of the JBoss Getting Started Guide and browsed their newsgroups enough to figure out how to setup a users.properties and roles.properties file in the JBoss conf directory. Still no joy, but a change - I now get: 20:52:11,973 ERROR [LogInterceptor] EJBException, causedBy: java.lang.SecurityException: Authentication exception, principal=null The users.properties file looks like: guest=guest guest1= user1=user1 admin=admin unauthenticatedIdentity=guest and the roles.properties file looks like: guest=guest,user guest1=guest user1=guest,admin,user admin=guest,admin,user unauthenticatedIdentity=guest I realize this is more of a JBoss problem and its a newbie problem at that. But it would be great if the example could work out-of-the box. Thanks again - Richard -----Original Message----- From: no...@so... [mailto:no...@so...] Sent: Friday, December 27, 2002 10:29 AM To: no...@so... Subject: [hibernate - Open Discussion] There is *working* example Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=1809362 By: ko5tik <bragOn> I have working demo to download: http://www.pribluda.de/hibernate-test.tar.gz - xdoclet + hibernate + jboss </bragOn> It seems that your MBean does not find your mappings - i put everything in deployable sar. Look in the sample. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge and visit: https://sourceforge.net/forum/monitor.php?forum_id=128638 |
From: Richard M. <rn...@cu...> - 2003-01-03 05:30:47
|
Konstantin/all, Thanks very much for your xdoclet/hibernate/jboss example. I have learned a lot. It has made me re-think my current application approach. Maybe I will use EJB's after all. One question, I'm new to JBoss. Should the example run in a vanilla JBoss 3.0.4 (with Tomcat) install? I changed the hibernate.properties before building and now it deploy's fine. But when I run the client (run.sh) I get two errors: 1) cannot fine DefaultDS data source and 2) no users.properties found. I checked the default hsqldb-service.xml file and all seems fine - hibernate and JBoss use the same default userid and password. I read a little of the JBoss Getting Started Guide and browsed their newsgroups enough to figure out how to setup a users.properties and roles.properties file in the JBoss conf directory. Still no joy, but a change - I now get: 20:52:11,973 ERROR [LogInterceptor] EJBException, causedBy: java.lang.SecurityException: Authentication exception, principal=null The users.properties file looks like: guest=guest guest1= user1=user1 admin=admin unauthenticatedIdentity=guest and the roles.properties file looks like: guest=guest,user guest1=guest user1=guest,admin,user admin=guest,admin,user unauthenticatedIdentity=guest I realize this is more of a JBoss problem and its a newbie problem at that. But it would be great if the example could work out-of-the box. Thanks again - Richard -----Original Message----- From: no...@so... [mailto:no...@so...] Sent: Friday, December 27, 2002 10:29 AM To: no...@so... Subject: [hibernate - Open Discussion] There is *working* example Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=1809362 By: ko5tik <bragOn> I have working demo to download: http://www.pribluda.de/hibernate-test.tar.gz - xdoclet + hibernate + jboss </bragOn> It seems that your MBean does not find your mappings - i put everything in deployable sar. Look in the sample. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge and visit: https://sourceforge.net/forum/monitor.php?forum_id=128638 |
From: cheeser <hib...@ch...> - 2003-01-03 04:41:49
|
Here's the pgsql log. See anything wrong? LOG: query: set autocommit =3D on; commit; LOG: query: set autocommit =3D off;=20 LOG: query: select nextval ('uid_sequence') LOG: query: insert into CommentTable ( Value, DateEntered, PrimaryKey,=20 subclass ) values ( null, null, 4, 'Comment' ) LOG: query: update CommentTable set Value =3D 'this is a test', DateEnte= red =3D=20 null where PrimaryKey =3D 4 LOG: query: SELECT Comme0.PrimaryKey AS PrimaryKey, Comme0.Value as Valu= e,=20 Comme0.DateEntered as DateEntered FROM CommentTable Comme0 WHERE=20 Comme0.PrimaryKey =3D 4 LOG: pq_recvbuf: unexpected EOF on client connection On Thursday 02 January 2003 09:00 pm, Gavin King wrote: > That "unexpected EOF" usually occurs if somehow the connection > between client and database processes is broken (eg. the > VM dies). What happens if you use a sequence, instead > of hi/lo generation? (And remember that you can't use > HiLoGenerator in an appserver....) > > > -----Original Message----- > > From: cheeser [mailto:hib...@ch...] > > Sent: Friday, 3 January 2003 2:40 PM > > To: hib...@li... > > Subject: [Hibernate] saving to pgsql > > > > > > I'm having troubles getting my objects to persist. In my > > pgsql.err, i get > > error messages about "unexpected EOF on client connection." > > Has anyone seen > > this? I create the bean and call session.save() with it. > > When I'm done with > > the session, I call flush() and close() (trying to force it) > > and nothing gets > > saved. Here's part of my hibernate.xml: > > > > =09<class name=3D"org.cheeseronline.antfarm.system.CommentBean" > > =09=09table=3D"CommentTable" discriminator-value=3D"Comment"> > > > > =09=09<id name=3D"PrimaryKey"> > > =09=09=09<generator > > class=3D"cirrus.hibernate.id.HiLoGenerator"> > > =09=09=09=09<param>uid_table</param> > > =09=09=09=09<param>next_hi_value_column</param> > > =09=09=09</generator> > > =09=09</id> > > =09=09<discriminator column=3D"subclass" type=3D"string"/> > > =09=09<property name=3D"Text" type=3D"string" column=3D"Value"/> > > =09=09<property name=3D"DateEntered" type=3D"date"/> > > =09</class> > > > > There are other classes in there, but the code is generated > > so it all looks > > the same. Can anyone see what I'm doing wrong? > > > > cheeser > > > > > > ------------------------------------------------------- > > 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 > > ********** CAUTION - Disclaimer ********** > This message may contain privileged and confidential > information. If you are not the intended recipient of this > message (or responsible for delivery of the message to > such person) you are hereby notified that any use, > dissemination, distribution or reproduction of this message > is prohibited. If you have received this message in error, > you should destroy it and kindly notify the sender by reply > e-mail. Please advise immediately if you or your employer > do not consent to Internet e-mail for messages of this kind. > Opinions, conclusions and other information in this > message that do not relate to the official business of > Expert Information Services Pty Ltd ("The Company") > shall be understood as neither given nor endorsed by it. > > The Company advises that this e-mail and any attached > files should be scanned to detect viruses. The Company > accepts no liability for loss or damage (whether caused > by negligence or not) resulting from the use of any > attached files. > **EIS******** End of Disclaimer ********** |
From: Gavin K. <Gav...@ex...> - 2003-01-03 04:10:25
|
> it *mostly* works. The only problem seems to be=20 > that Oracle=20 > apparently does not distinguish between zero-length strings=20 > and NULL, so I have run into this before with Oracle. Very yucky. > if you initialize the CLOB with Hibernate.createClob(""), the actual=20 > database column is nullified and the subsequent getClob()=20 > call returns=20 > null, making the clob.getCharacterOutputStream() fail with a NPE. >=20 > As a quick&dirty hack, I've changed createClob("") to createClob(" ")=20 > and everything seems to work ok.=20 Ugo, would you please produce a page documenting your approach to this for the Wiki. Other people will also need to know this stuff. > However, I was wondering if it is=20 > really necessary to open a new session. Couldn't we somehow reuse the=20 > former session? Well, not currently. Occasionally other people have requested things like Session.refresh(), which I have stubbornly not implemented because I never saw a really compelling use case. ( *This* is a good use case for refresh(). ) For Hibernate 2, should we add one or both of: Session.evict(foo); //remove foo from the Session-level cache Session.refresh(foo); //reload foo's state from the database There *would* be some exotic cases (like this one) where they could be useful.... Opinions? ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Gavin K. <Gav...@ex...> - 2003-01-03 04:04:13
|
> * Rename the 'role' attribute to 'name' in all collection > elements in the new DTD, for consistency with <many-to-one>,=20 > <id> and <property> elements. The role attribute no longer > has any extra semantics beyond being a simple property > name. Done. > * Change the default for unsaved-value to "null" in the new=20 > DTD. The current default is surprising to new users. Done. > * Change the default for default-cascade to "save-update" > in the new DTD. We will leave this the way it is. > * Remove the exception that occurs if you save an object > that is already associated with the session. This > makes save() consistent with saveOrUpdate(). Lets make this change. > * Remove the exception that occurs if you delete an object > that is already deleted in that session.=20 Lets make this change also (for consistency). Max, I don't see=20 much value in making this configurable. We don't want to spawn=20 millions of config properties for minor issues like these. ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Gavin K. <Gav...@ex...> - 2003-01-03 04:00:36
|
That "unexpected EOF" usually occurs if somehow the connection between client and database processes is broken (eg. the VM dies). What happens if you use a sequence, instead of hi/lo generation? (And remember that you can't use HiLoGenerator in an appserver....) > -----Original Message----- > From: cheeser [mailto:hib...@ch...]=20 > Sent: Friday, 3 January 2003 2:40 PM > To: hib...@li... > Subject: [Hibernate] saving to pgsql >=20 >=20 > I'm having troubles getting my objects to persist. In my=20 > pgsql.err, i get=20 > error messages about "unexpected EOF on client connection." =20 > Has anyone seen=20 > this? I create the bean and call session.save() with it. =20 > When I'm done with=20 > the session, I call flush() and close() (trying to force it)=20 > and nothing gets=20 > saved. Here's part of my hibernate.xml: >=20 > <class name=3D"org.cheeseronline.antfarm.system.CommentBean" > table=3D"CommentTable" discriminator-value=3D"Comment"> >=20 > <id name=3D"PrimaryKey"> > <generator=20 > class=3D"cirrus.hibernate.id.HiLoGenerator"> > <param>uid_table</param> > <param>next_hi_value_column</param> > </generator> > </id> > <discriminator column=3D"subclass" type=3D"string"/> > <property name=3D"Text" type=3D"string" column=3D"Value"/> > <property name=3D"DateEntered" type=3D"date"/> > </class> >=20 > There are other classes in there, but the code is generated=20 > so it all looks=20 > the same. Can anyone see what I'm doing wrong? >=20 > cheeser >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > hibernate-devel mailing list hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel >=20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: cheeser <hib...@ch...> - 2003-01-03 03:40:04
|
I'm having troubles getting my objects to persist. In my pgsql.err, i ge= t=20 error messages about "unexpected EOF on client connection." Has anyone s= een=20 this? I create the bean and call session.save() with it. When I'm done = with=20 the session, I call flush() and close() (trying to force it) and nothing = gets=20 saved. Here's part of my hibernate.xml: =09<class name=3D"org.cheeseronline.antfarm.system.CommentBean" =09=09table=3D"CommentTable" discriminator-value=3D"Comment"> =09=09<id name=3D"PrimaryKey"> =09=09=09<generator class=3D"cirrus.hibernate.id.HiLoGenerator"> =09=09=09=09<param>uid_table</param> =09=09=09=09<param>next_hi_value_column</param> =09=09=09</generator> =09=09</id> =09=09<discriminator column=3D"subclass" type=3D"string"/> =09=09<property name=3D"Text" type=3D"string" column=3D"Value"/> =09=09<property name=3D"DateEntered" type=3D"date"/> =09</class> There are other classes in there, but the code is generated so it all loo= ks=20 the same. Can anyone see what I'm doing wrong? cheeser |
From: Gavin K. <Gav...@ex...> - 2003-01-03 03:33:04
|
Sorry, thats nowhere near enough information. You should show the code that uses the Hibernate Session and also the full stack trace. A Hibernate TRACE-level log is also sometimes useful. -----Original Message----- From: Laurent Fleuriot [mailto:lfl...@co...]=20 Sent: Friday, 3 January 2003 1:52 AM To: hib...@li... Subject: [Hibernate] sorted collection I have 2 classes.=20 The first class contains a collection of the second class. I want the collection is sorted but, when I return the collection, I have a= n error "Failed to lazily initialize a collection" My mapping is : <class name=3D"Class1" table=3D"table1"> ... <set role=3D"child" lazy=3D"true" cascade=3D"save-update" sort=3D"natur= al" > <key type=3D"int" column=3D"columnName"/> <one-to-many class=3D"Class2"/> </set> .... </class> .... and My java code is : public Class1() { .... child =3D new java.util.TreeSet(); ... } Laurent FLEURIOT | Ing=E9nieur =C9tudes et D=E9veloppement=20 =20 Chemin de Saint Lambert - Actiburo 1 B=E2timent A - 13400 Aubagne=20 T=E9l : +33 4 91 87 84 03 - Fax : +33 4 91 87 81 09 - Mobile : +33 6 22 05 = 82 74=20 www.cosmosbay.com=20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Pablo I. L. <pi...@gm...> - 2003-01-03 03:16:13
|
Same problem on Interbase/Firebird. pil m> Could you give an hbm.xml and query example that gives that error ? (it m> would be nice to have some test scenario :) m> (especially, since it would be nice to know what one could do to avoid m> such a thing....- it would also be a problem on db2 since it also has m> some "weird" low limitations) m> /max >>Yick. The biggest design problem with Hibernate at present is >>the fact that we have no single class responsible for rendering >>SQL. (As I have mentioned before, Hibernate models SQL >>statements using StringBuffer...) So little things like this >>that should be *very* easy turn out to be way more tricky >>than you expect. However there are a couple of methods that >>are responsible for dealing with SQL quoted identifiers so >>you may be able to hook in there. >> >>We *do* need to fix this problem of StringBuffer being used >>everywhere. >> >> >> >>>-----Original Message----- >>>From: Mark Woon [mailto:mor...@SM...] >>>Sent: Wednesday, 1 January 2003 10:33 AM >>>To: Hibernate Mailing List >>>Subject: [Hibernate] Length of Hibernate-generated aliases in SQL >>> >>> >>> >>>Does Hibernate do any checking on the length of the aliases >>>it generates >>>when it creates it's SQL queries? I'm getting "identifier is >>>too long" >>>errors against Oracle 9.2 at the moment because Hibernate >>>tacks on some >>>extra text to some column names. >>> >>>If not, would it be terribly difficult to add this >>>functionality? Which >>>classes should I be looking at to figure this out? >>> >>>Thanks, >>>-Mark >>> >>> >>> >>>------------------------------------------------------- >>>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 >>> >>> >>> m> ------------------------------------------------------- m> This sf.net email is sponsored by:ThinkGeek m> Welcome to geek heaven. m> http://thinkgeek.com/sf m> _______________________________________________ m> hibernate-devel mailing list m> hib...@li... m> https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Gavin K. <Gav...@ex...> - 2003-01-03 02:55:53
|
Try something like: Query q =3D sess.createQuery("from h in class Headend where h.id in (:id_list) order by h.name"); q.setParameterList("id_list", headendIds); List sorted =3D q.list(); Note that this is might not be very good if the id List is very long... > -----Original Message----- > From: Raible, Matt [mailto:Mat...@ca...]=20 > Sent: Friday, 3 January 2003 11:33 AM > To: 'hib...@li...' > Subject: [Hibernate] Getting a sorted list of results >=20 >=20 > I am using the following method to get back a list of objects=20 > based on ids. What I would prefer is to get back a list of=20 > objects sorted by object.name. I know there's an easier way=20 > to do this with hibernate, but I can't seem to find it. >=20 > // loop through the list of headend ids and get=20 > their names > for (int i =3D 0; i < headendIds.size(); i++) { >=20 > headend =3D (Headend) headendIds.get(i); // get the id >=20 > Long headendId =3D headend.getId(); > if (log.isDebugEnabled()) { > log.debug("looking for headend with id:=20 > " + headendId); > } > headend =3D (Headend) ses.load(Headend.class,=20 > headendId); // get the headend >=20 > if (headend =3D=3D null) { > log.error("No headend name found for id:=20 > " + headendId); > throw new DAOException("No headend name=20 > found for id: " > + > headendId); > } else { > if (log.isDebugEnabled()) { > log.debug("returning headend=20 > with name: " + headend); > } > } >=20 > // replace the object in the list > headendList.add(i, headend); > } >=20 > Thanks, >=20 > Matt >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > hibernate-devel mailing list hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel >=20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Gavin K. <Gav...@ex...> - 2003-01-03 02:47:32
|
> The old way I was doing it - now obviously kludgy - was to=20 > create a new session factory everytime I initialized a DAO. =20 That would have been your problem. You *must* make sure that ALL DAOs are using the same Session instance. (And=20 SessionFactory _should_ certainly be a singleton.) ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Raible, M. <Mat...@ca...> - 2003-01-03 00:33:40
|
I am using the following method to get back a list of objects based on ids. What I would prefer is to get back a list of objects sorted by object.name. I know there's an easier way to do this with hibernate, but I can't seem to find it. // loop through the list of headend ids and get their names for (int i = 0; i < headendIds.size(); i++) { headend = (Headend) headendIds.get(i); // get the id Long headendId = headend.getId(); if (log.isDebugEnabled()) { log.debug("looking for headend with id: " + headendId); } headend = (Headend) ses.load(Headend.class, headendId); // get the headend if (headend == null) { log.error("No headend name found for id: " + headendId); throw new DAOException("No headend name found for id: " + headendId); } else { if (log.isDebugEnabled()) { log.debug("returning headend with name: " + headend); } } // replace the object in the list headendList.add(i, headend); } Thanks, Matt |
From: Matt R. <ma...@ra...> - 2003-01-02 23:45:03
|
I'd be interested in your code, and would love to come up with a *recommended* way to implement Hibernate in webapps. However, I prefer to keep any database connections out of my web tier. Since I only use them in my dao's that's where I prefer to use them. I also am using a Business Delegate to talk from my Web Tier to my DAOs. I like this b/c it makes it easy to test each different layer with JUnit and I feel like I'm following recommended patterns. I don't like this because it feels like it takes forever to implement a new table to talk to. A big reason for implementing business delegates and dao's is to allow for re-usability, but most of the projects I've been on only ever talk to the DB through the web. Here's to hoping my "patterns" payoff someday. That being said, I modified my HibernateSession object to allow for both JNDI and JUnit type testing. Please let me know if you see any issues in my implementation. Thanks, Matt > Hi Matt, > > From your example code that you posted, it doesn't seem like you were > ever closing the sessions you opened. Is this true, or are you perhaps > doing it somewhere else in your code? > > The way that I handle Hibernate sessions in all of my applications is > to use a ServletFilter that opens a Hibernate session at the beginning > of the request, and then closes the Hibernate session at the end of the > request. It makes everything so much cleaner if you can just assume > that that Hibernate session will be there for you whenever you need it, > and that it will be closed when you are done using it. > > If you want, I can send you a code snippet. Just let me know... > > I don't know if you have the same situation that I have, but for half > of my requests, I don't actually need the Hibernate session, so I > recently enhanced my ServletFilter to actually create a Proxy object > that looks like a Hibernate session. If and when my application tries > to call a method on the Proxy object, then the Proxy object initialized > the session, and away we go, otherwise we never actually waste the > effort of opening a database connection. > > I would think that a combination of my ServletFilter approach and your > current ThreadLocal approach would take care of all of your problems. > > Regards, > Jon... > > Let me know if you want to > On Thursday, January 2, 2003, at 09:01 PM, Matt Raible wrote: > > > I *think* I fixed this problem by implementing a Connection Pool in > > Tomcat and > > configuring Hibernate with a HibernationSession (using ThreadLocal) and > > talking to Oracle using that method. Seems to only open one > > connection now. > > > > Thanks, > > > > Matt > > > >> I'm getting the following error when using Hibernate as my persistence > >> layer: > >> > >> java.sql.SQLException: ORA-02391: exceeded simultaneous > >> SESSIONS_PER_USER > >> limit ORA-02063: preceding line from NAS_AC_72 > >> ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit ORA-02063: > >> preceding line from NAS_AC_72 > >> > >> Could this be caused by Hibernate? I'm hoping not, but I don't know > >> enough > >> about it to argue with the DBA that Hibernate (and my code) is not the > >> problem. Here's is a sample class I'm using to connect: > >> > >> public class ChangeRequestDAOHibernate extends BaseDAOHibernate > >> implements > >> ChangeRequestDAO { > >> private static SessionFactory sessionFactory; > >> private static Datastore datastore; > >> private Log log = > >> LogFactory.getLog(ChangeRequestDAOHibernate.class); > >> > >> public ChangeRequestDAOHibernate() throws DAOException { > >> try { > >> datastore = Hibernate.createDatastore(); > >> > >> datastore.storeClass(com.cable.comcast.dmc.itd.cct.persistence.ChangeR > >> equest > >> .class); > >> > >> // build a SessionFactory > >> sessionFactory = datastore.buildSessionFactory(); > >> } catch (MappingException e) { > >> throw new DAOException(e); > >> } catch (HibernateException e) { > >> throw new DAOException(e); > >> } > >> } > >> /** > >> * @see > >> com.cable.comcast.dmc.itd.cct.persistence.ChangeRequestDAO#getHeadends > >> (MSO) > >> */ > >> public List getHeadendsForMSO(MSO mso) throws DAOException { > >> Session ses = null; > >> List headendList = null; > >> > >> try { > >> ses = sessionFactory.openSession(); > >> > >> List changeRequests = > >> (List) ses.find("from cr in class > >> com.cable.comcast.dmc.itd.cct.persistence.ChangeRequest where > >> cr.msoId=?", > >> mso.getId(), > >> Hibernate.LONG); > >> > >> if ((changeRequests == null) || > >> (changeRequests.size() == 0)) { > >> log.warn("No headends found for msoId: " + > >> mso.getId()); > >> return new ArrayList(); > >> } > >> > >> // if results are found, look up the headend names > >> and build a list of headend objects > >> LookupDAO lookupDAO = new LookupDAOHibernate(); > >> List headendIds = new ArrayList(); > >> > >> // loop though the change requests and build a list > >> of headends > >> for (int i=0; i < changeRequests.size(); i++) { > >> ChangeRequest cr = (ChangeRequest) > >> changeRequests.get(i); > >> Headend h = new Headend(); > >> h.setId(cr.getHeadendId()); > >> headendIds.add(h); > >> } > >> > >> headendList = lookupDAO.getHeadendNames(headendIds); > >> > >> } catch (Exception e) { > >> try { > >> ses.connection().rollback(); > >> } catch (Exception ex) { > >> e.printStackTrace(); > >> } > >> > >> throw new DAOException(e); > >> } finally { > >> try { > >> ses.close(); > >> } catch (Exception ex) { > >> ex.printStackTrace(); > >> } > >> } > >> > >> return headendList; > >> > >> } > >> > >> } > >> > >> ------------------------------------------------------- > >> 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 > > > > > > > > -- Matt Raible, Raible Designs, Morrison CO US > > -- Tel: +1 303 979-5340 > > -- Mob: +1 720 560-8460 > > -- Fax: +1 508 256-6471 > > -- Web: http://www.raibledesigns.com > > > > > > ------------------------------------------------------- > > 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 -- Matt Raible, Raible Designs, Morrison CO US -- Tel: +1 303 979-5340 -- Mob: +1 720 560-8460 -- Fax: +1 508 256-6471 -- Web: http://www.raibledesigns.com |
From: Raible, M. <Mat...@ca...> - 2003-01-02 23:35:56
|
I was able to "work-around" this problem by doing the following: We have a table - user_sys_access, where the primary key is the combination of userid, mso_id, and headend_id. There can be multiple rows so that you might end up with something like the following: userid mso_id headend_id ------ ------- ---------- tomcat 1 3 tomcat 2 2 The mso's and headend's are used to control a user's access. I didn't design the database, so I don't want to go there ;) What I do want to do is to query the user table and get all the user's mso_ids. Using the query below, it didn't work. So I added another query, and this works: String qry = "from cct_user in class com.cable.comcast.dmc.itd.cct.persistence.User where cct_user.userId=?"; List users = (List) ses.find(qry, userId, Hibernate.STRING); List msoList = (List) ses.find("select distinct cct_user.msoId " + qry, userId, Hibernate.STRING); If there's a better way, please let me know as this seems like kindof a kludge. Matt -----Original Message----- From: Konstantin Priblouda [mailto:kpr...@ya...] Sent: Tuesday, December 31, 2002 9:49 AM To: Raible, Matt Cc: hibernate-devel Subject: Re: [Hibernate] List only returns first row, rather than both --- "Raible, Matt" <Mat...@ca...> wrote: > I have to rows in my "user" table and I expect to > get two rows of data back. > However, the following query returns two items in > the list, but they're the > same: > > List users = (List) ses.find("from cct_user in class > com.cable.comcast.dmc.itd.cct.persistence.User where > cct_user.userId=?", > userId, Hibernate.STRING); > > Is this because userId is the named in User.hbm.xml > as the primary key? I > tried to create a composite-id element, which is > what it is in the database, > but XDoclet doesn't seem to let me. I added two > @hibernate.id tags to two > different getters, but that just generated two > different id elements in my > xml mapping file. Matt, file issue in JIRA and assign it to me ( or it will be lost ) I will look at it. regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
From: Jon L. <jon...@xe...> - 2003-01-02 20:59:03
|
Hi Matt, From your example code that you posted, it doesn't seem like you were ever closing the sessions you opened. Is this true, or are you perhaps doing it somewhere else in your code? The way that I handle Hibernate sessions in all of my applications is to use a ServletFilter that opens a Hibernate session at the beginning of the request, and then closes the Hibernate session at the end of the request. It makes everything so much cleaner if you can just assume that that Hibernate session will be there for you whenever you need it, and that it will be closed when you are done using it. If you want, I can send you a code snippet. Just let me know... I don't know if you have the same situation that I have, but for half of my requests, I don't actually need the Hibernate session, so I recently enhanced my ServletFilter to actually create a Proxy object that looks like a Hibernate session. If and when my application tries to call a method on the Proxy object, then the Proxy object initialized the session, and away we go, otherwise we never actually waste the effort of opening a database connection. I would think that a combination of my ServletFilter approach and your current ThreadLocal approach would take care of all of your problems. Regards, Jon... Let me know if you want to On Thursday, January 2, 2003, at 09:01 PM, Matt Raible wrote: > I *think* I fixed this problem by implementing a Connection Pool in > Tomcat and > configuring Hibernate with a HibernationSession (using ThreadLocal) and > talking to Oracle using that method. Seems to only open one > connection now. > > Thanks, > > Matt > >> I'm getting the following error when using Hibernate as my persistence >> layer: >> >> java.sql.SQLException: ORA-02391: exceeded simultaneous >> SESSIONS_PER_USER >> limit ORA-02063: preceding line from NAS_AC_72 >> ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit ORA-02063: >> preceding line from NAS_AC_72 >> >> Could this be caused by Hibernate? I'm hoping not, but I don't know >> enough >> about it to argue with the DBA that Hibernate (and my code) is not the >> problem. Here's is a sample class I'm using to connect: >> >> public class ChangeRequestDAOHibernate extends BaseDAOHibernate >> implements >> ChangeRequestDAO { >> private static SessionFactory sessionFactory; >> private static Datastore datastore; >> private Log log = >> LogFactory.getLog(ChangeRequestDAOHibernate.class); >> >> public ChangeRequestDAOHibernate() throws DAOException { >> try { >> datastore = Hibernate.createDatastore(); >> >> datastore.storeClass(com.cable.comcast.dmc.itd.cct.persistence.ChangeR >> equest >> .class); >> >> // build a SessionFactory >> sessionFactory = datastore.buildSessionFactory(); >> } catch (MappingException e) { >> throw new DAOException(e); >> } catch (HibernateException e) { >> throw new DAOException(e); >> } >> } >> /** >> * @see >> com.cable.comcast.dmc.itd.cct.persistence.ChangeRequestDAO#getHeadends >> (MSO) >> */ >> public List getHeadendsForMSO(MSO mso) throws DAOException { >> Session ses = null; >> List headendList = null; >> >> try { >> ses = sessionFactory.openSession(); >> >> List changeRequests = >> (List) ses.find("from cr in class >> com.cable.comcast.dmc.itd.cct.persistence.ChangeRequest where >> cr.msoId=?", >> mso.getId(), >> Hibernate.LONG); >> >> if ((changeRequests == null) || >> (changeRequests.size() == 0)) { >> log.warn("No headends found for msoId: " + >> mso.getId()); >> return new ArrayList(); >> } >> >> // if results are found, look up the headend names >> and build a list of headend objects >> LookupDAO lookupDAO = new LookupDAOHibernate(); >> List headendIds = new ArrayList(); >> >> // loop though the change requests and build a list >> of headends >> for (int i=0; i < changeRequests.size(); i++) { >> ChangeRequest cr = (ChangeRequest) >> changeRequests.get(i); >> Headend h = new Headend(); >> h.setId(cr.getHeadendId()); >> headendIds.add(h); >> } >> >> headendList = lookupDAO.getHeadendNames(headendIds); >> >> } catch (Exception e) { >> try { >> ses.connection().rollback(); >> } catch (Exception ex) { >> e.printStackTrace(); >> } >> >> throw new DAOException(e); >> } finally { >> try { >> ses.close(); >> } catch (Exception ex) { >> ex.printStackTrace(); >> } >> } >> >> return headendList; >> >> } >> >> } >> >> ------------------------------------------------------- >> 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 > > > > -- Matt Raible, Raible Designs, Morrison CO US > -- Tel: +1 303 979-5340 > -- Mob: +1 720 560-8460 > -- Fax: +1 508 256-6471 > -- Web: http://www.raibledesigns.com > > > ------------------------------------------------------- > 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: Matt R. <ma...@ra...> - 2003-01-02 20:26:22
|
I am using the Thread Local Session Design Pattern as documented at: http://hibernate.bluemars.net/42.html This worked great in my web application when running through Tomcat. Tomcat uses Commons DBCP for connection pooling. The old way I was doing it - now obviously kludgy - was to create a new session factory everytime I initialized a DAO. This worked great for unit tests though, and it'd read from my hibernate.properties file for db connection stuff. Any tips/suggestions on enhancing HibernateSession.java to allow for both types of configuration? Thanks, Matt |
From: Matt R. <ma...@ra...> - 2003-01-02 20:02:15
|
I *think* I fixed this problem by implementing a Connection Pool in Tomcat and configuring Hibernate with a HibernationSession (using ThreadLocal) and talking to Oracle using that method. Seems to only open one connection now. Thanks, Matt > I'm getting the following error when using Hibernate as my persistence > layer: > > java.sql.SQLException: ORA-02391: exceeded simultaneous SESSIONS_PER_USER > limit ORA-02063: preceding line from NAS_AC_72 > ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit ORA-02063: > preceding line from NAS_AC_72 > > Could this be caused by Hibernate? I'm hoping not, but I don't know enough > about it to argue with the DBA that Hibernate (and my code) is not the > problem. Here's is a sample class I'm using to connect: > > public class ChangeRequestDAOHibernate extends BaseDAOHibernate implements > ChangeRequestDAO { > private static SessionFactory sessionFactory; > private static Datastore datastore; > private Log log = LogFactory.getLog(ChangeRequestDAOHibernate.class); > > public ChangeRequestDAOHibernate() throws DAOException { > try { > datastore = Hibernate.createDatastore(); > > datastore.storeClass(com.cable.comcast.dmc.itd.cct.persistence.ChangeRequest > .class); > > // build a SessionFactory > sessionFactory = datastore.buildSessionFactory(); > } catch (MappingException e) { > throw new DAOException(e); > } catch (HibernateException e) { > throw new DAOException(e); > } > } > /** > * @see > com.cable.comcast.dmc.itd.cct.persistence.ChangeRequestDAO#getHeadends(MSO) > */ > public List getHeadendsForMSO(MSO mso) throws DAOException { > Session ses = null; > List headendList = null; > > try { > ses = sessionFactory.openSession(); > > List changeRequests = > (List) ses.find("from cr in class > com.cable.comcast.dmc.itd.cct.persistence.ChangeRequest where cr.msoId=?", > mso.getId(), > Hibernate.LONG); > > if ((changeRequests == null) || > (changeRequests.size() == 0)) { > log.warn("No headends found for msoId: " + > mso.getId()); > return new ArrayList(); > } > > // if results are found, look up the headend names > and build a list of headend objects > LookupDAO lookupDAO = new LookupDAOHibernate(); > List headendIds = new ArrayList(); > > // loop though the change requests and build a list > of headends > for (int i=0; i < changeRequests.size(); i++) { > ChangeRequest cr = (ChangeRequest) > changeRequests.get(i); > Headend h = new Headend(); > h.setId(cr.getHeadendId()); > headendIds.add(h); > } > > headendList = lookupDAO.getHeadendNames(headendIds); > > } catch (Exception e) { > try { > ses.connection().rollback(); > } catch (Exception ex) { > e.printStackTrace(); > } > > throw new DAOException(e); > } finally { > try { > ses.close(); > } catch (Exception ex) { > ex.printStackTrace(); > } > } > > return headendList; > > } > > } > > ------------------------------------------------------- > 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 -- Matt Raible, Raible Designs, Morrison CO US -- Tel: +1 303 979-5340 -- Mob: +1 720 560-8460 -- Fax: +1 508 256-6471 -- Web: http://www.raibledesigns.com |
From: Raible, M. <Mat...@ca...> - 2003-01-02 17:58:05
|
I'm getting the following error when using Hibernate as my persistence layer: java.sql.SQLException: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit ORA-02063: preceding line from NAS_AC_72 ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit ORA-02063: preceding line from NAS_AC_72 Could this be caused by Hibernate? I'm hoping not, but I don't know enough about it to argue with the DBA that Hibernate (and my code) is not the problem. Here's is a sample class I'm using to connect: public class ChangeRequestDAOHibernate extends BaseDAOHibernate implements ChangeRequestDAO { private static SessionFactory sessionFactory; private static Datastore datastore; private Log log = LogFactory.getLog(ChangeRequestDAOHibernate.class); public ChangeRequestDAOHibernate() throws DAOException { try { datastore = Hibernate.createDatastore(); datastore.storeClass(com.cable.comcast.dmc.itd.cct.persistence.ChangeRequest .class); // build a SessionFactory sessionFactory = datastore.buildSessionFactory(); } catch (MappingException e) { throw new DAOException(e); } catch (HibernateException e) { throw new DAOException(e); } } /** * @see com.cable.comcast.dmc.itd.cct.persistence.ChangeRequestDAO#getHeadends(MSO) */ public List getHeadendsForMSO(MSO mso) throws DAOException { Session ses = null; List headendList = null; try { ses = sessionFactory.openSession(); List changeRequests = (List) ses.find("from cr in class com.cable.comcast.dmc.itd.cct.persistence.ChangeRequest where cr.msoId=?", mso.getId(), Hibernate.LONG); if ((changeRequests == null) || (changeRequests.size() == 0)) { log.warn("No headends found for msoId: " + mso.getId()); return new ArrayList(); } // if results are found, look up the headend names and build a list of headend objects LookupDAO lookupDAO = new LookupDAOHibernate(); List headendIds = new ArrayList(); // loop though the change requests and build a list of headends for (int i=0; i < changeRequests.size(); i++) { ChangeRequest cr = (ChangeRequest) changeRequests.get(i); Headend h = new Headend(); h.setId(cr.getHeadendId()); headendIds.add(h); } headendList = lookupDAO.getHeadendNames(headendIds); } catch (Exception e) { try { ses.connection().rollback(); } catch (Exception ex) { e.printStackTrace(); } throw new DAOException(e); } finally { try { ses.close(); } catch (Exception ex) { ex.printStackTrace(); } } return headendList; } } |
From: Max R. A. <ma...@eo...> - 2003-01-02 12:23:04
|
forgot one... >* Remove the exception that occurs if you save an object > that is already associated with the session. This > makes save() consistent with saveOrUpdate(). >I am probably a +1 on this I would suggest the same mechanism as with delete - it is nice to have it as an option. /max |
From: Max R. A. <ma...@eo...> - 2003-01-02 12:20:05
|
Just quick comments before i go on a 2 day without net :( >* Rename the 'role' attribute to 'name' in all collection > elements in the new DTD, for consistency with <many-to-one>, > <id> and <property> elements. The role attribute no longer > has any extra semantics beyond being a simple property > name. >I am +1 +1 >* Change the default for unsaved-value to "null" in the new > DTD. The current default is surprising to new users. >I am +1 +1 >* Change the default for default-cascade to "save-update" > in the new DTD. >I am undecided ... interested to hear the views of others. Don't think there are any good default...How about forcing an save-update attribute on the global level, so they are forced to make a choice ? (just a thought) >* Remove the exception that occurs if you save an object > that is already associated with the session. This > makes save() consistent with saveOrUpdate(). I am probably a +1 on this >* Remove the exception that occurs if you delete an object > that is already deleted in that session. >I am undecided. The current behaviour forces people to >think about who "owns" an object, who is responsible for >deleting it. However, it *can* be a pain in the ass. >In particular it means that: >session.delete("from o in class java.lang.Object"); >never has any possibility of success if you use cascade >delete anywhere. Im also undecided - I REALLY like having the developers think about ownership. How about having it as an option on either the method call or in the metadata ? delete(Object o, boolean beSilentAboutCollisions) so: session.delete(o) is the same as session.delete(o, false); or Session.setBeSilentAboutDelteCollisons(boolean) - so it can be set on each session ? (so - one can easily enable it to see if ones code is "nice" or "bad" :) |
From: Ugo C. <u....@cb...> - 2003-01-02 11:35:35
|
Gavin King wrote: > Ahhhh the > 4000 characters bit is where you start to need > the "for update" clause. We were wondering about that > earlier. I think you *could* make it work like this: > > s = sf.openSession(); > tx = s.beginTransaction(); > foo = new Foo(); > foo.setClob( Hibernate.createClob("") ); > s.save(foo); > tx.commit(); > s.close(); > > s = sf.openSession(); > tx = s.beginTransaction(); > foo = (Foo) s.load( Foo.class, foo.getId(), LockMode.UPGRADE ); > oracle.sql.CLOB clob = (oracle.sql.CLOB) foo.getClob(); > java.io.Writer pw = clob.getCharacterOutputStream(); > pw.write(content); > pw.close(); > tx.commit(); > s.close(); > > > Would you try that for me, please? Tried it and it *mostly* works. The only problem seems to be that Oracle apparently does not distinguish between zero-length strings and NULL, so if you initialize the CLOB with Hibernate.createClob(""), the actual database column is nullified and the subsequent getClob() call returns null, making the clob.getCharacterOutputStream() fail with a NPE. As a quick&dirty hack, I've changed createClob("") to createClob(" ") and everything seems to work ok. However, I was wondering if it is really necessary to open a new session. Couldn't we somehow reuse the former session? Ugo |