Re: [Hibernate] Mail Archive
Done! :) |-+---> | | "Brian Topping" | | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 30/07/03 08:59 PM | | | | |-+---> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: [Hibernate] Mail Archive | >--| Hi, Could someone with admin privs on sf.net add mailto:[EMAIL PROTECTED] to the subscription roster through the direct interface? This will archive the documents on mail-archive. What would be even cooler is if someone who had the entire list on their computer was able to get it uploaded to mail-archive. http://www.mail-archive.com/faq.html#import explains the process. Let me know if I can help! -b --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] HQL, User defined type
Hibernate.custom(MyType.class) |-+---> | | Jenica Humphreys| | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 31/07/03 10:47 AM | | | | |-+---> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: [Hibernate] HQL, User defined type | >--| I'm /still/ using Hibernate 1.25 - I have a user-defined "ThreeStateType" type that implements the UserType interface. The getter and setter each use a ThreeState class that's implemented using the enumeration pattern. (The class has only 3 instantiations and can't be externally instantiated. Possible values are Yes/No/Unknown.) The ThreeStateType is used in the hbm.xml file, and the ThreeState class is used in the business object. I can load and save these objects beautifully with hibernate. Where I'm having trouble is running a query - For a long parameter in HQL I pass in the Long and Hibernate.LONG as the type. What do I pass in for this user defined type? Thanks for your help! Jenica Humphreys - ThreeState.java: package com.mvsc.czee.persistence; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; public class ThreeState extends ThreeStateType { public static final ThreeState Unknown = new ThreeState("U"); public static final ThreeState Yes = new ThreeState("Y"); public static final ThreeState No = new ThreeState("N"); private final String myName; // for debug only private ThreeState(String name) { myName = name; } public String toString() { return myName; } public boolean equals(Object other) { boolean result = false; if (other instanceof ThreeState) { ThreeState castOther = (ThreeState) other; result = new EqualsBuilder() .append(this.myName, castOther.myName) .isEquals(); } return result; } public int hashCode() { return new HashCodeBuilder() .append(myName) .toHashCode(); } } ThreeStateType.java: package com.mvsc.czee.persistence; import cirrus.hibernate.UserType; import cirrus.hibernate.HibernateException; import cirrus.hibernate.Hibernate; import java.sql.Types; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.PreparedStatement; public class ThreeStateType implements UserType { private static final int[] TYPES = {Types.STRING; public int[] sqlTypes() { return TYPES; } public Class returnedClass() { return ThreeState.class; } public boolean equals(Object o, Object o1) { boolean result = false; if ((o != null) && (o1 != null)) { result = o.equals(o1); } return result; } public Object nullSafeGet(ResultSet resultSet, String[] names, Object o) throws HibernateException, SQLException { Object result = ThreeState.Unknown; String first = (String) Hibernate.STRING.nullSafeGet(resultSet, names[0]); if (first == null) { result = ThreeState.Unknown; } else if (first.equals("Y")) { result = ThreeState.Yes; } else if (first.equals("N")) { result = ThreeState.No; } return result; } public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { String fieldValue = null; if (value == null) { fieldValue = ThreeState.Unknown.toString(); } else if (value instanceof ThreeState) { fieldValue = value.toString(); } else { fieldValue = ThreeState.Unknown.toString(); } Hibernate.STRING.nullSafeSet(st, fieldValue, index); } public Object deepCopy(Object o) { return o; //it's a enum... I can't really copy it } public boolean isMutable() { return false; } } ---
[Hibernate] Hibernate 2.1 Branch
I've created a new branch in CVS: v21branch This branch will be used for development of Hibernate 2.1 features. Currently it includes a reworked collection loading algorithm and an implementation of batch loads for collections. All working very nicely, far as I can tell. I will have batch loads for entities done very soon. Gavin. --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Uniqueness of fields
yes: unique-key="name" |-+---> | | Miroslav Lazarević | | | <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 31/07/03 10:44 PM | | | | |-+---> >--| | | | To: "Hibernate-Devel" <[EMAIL PROTECTED]> | | cc: | | Subject: [Hibernate] Uniqueness of fields | >--| Hi, I have a question about uniqueness of objects. Does it possible to tell Hibernate to make unique index on two columns automatically? This xdoclet tag with : /** * @hibernate.property * column="COL_NAME" * unique="true" */ will create unique index in my database on table's column when I'm using net.sf.hibernate.tool.hbm2ddl.SchemaExport class. Can I tell Hibernate to make unique index on combination of two object's fields? I can do this manually if I create unique index in some db tool for appropriate table but I want to know does Hibernate somehow can do this for me when using SchemaExport or SchemaUpdate classes? -- Best regards, Mickey [EMAIL PROTECTED], [EMAIL PROTECTED] --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] hbm2java newbie problem
What JDK is it? this is a very weird problem that people sometimes observe I think we manged to trace it down to a JVM bug. If you are able to help me reproduce this in my environment, I'd really appreciate it. |-+---> | | "Serkan Soykan" | | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 01/08/03 12:53 AM | | | | |-+---> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: [Hibernate] hbm2java newbie problem | >--| Hi, I'm trying to generate Java source files from a hibernate mapping file using hbm2java and I get the following error: Mapping file: - http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd";> Error: - Java net.sf.hibernate.tool.hbm2java.CodeGenerator Card.hbm.xml Exception in thread "main" java.lang.ExceptionInInitializerError: java.lang.NullPointerException at java.util.HashMap.put(Unknown Source) at net.sf.hibernate.type.TypeFactory.(TypeFactory.java:50) at net.sf.hibernate.tool.hbm2java.ClassMapping.getFieldType(ClassMapping.java:615) at net.sf.hibernate.tool.hbm2java.ClassMapping.initWith(ClassMapping.java:195) at net.sf.hibernate.tool.hbm2java.ClassMapping.(ClassMapping.java:73) at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:99) Any ideas? Best regards... Ismail Serkan SOYKAN Information Technologies Kocbank A.S. Phone: +90(216)4540600-4612 E-mail: [EMAIL PROTECTED] Bu mesaj ve onunla iletilen tüm ekler gönderildigi kisi ya da kuruma özel ve Bankalar Kanunu geregince, gizlilik yükümlülügü tasiyor olabilir. Bu mesaj, hiçbir sekilde, herhangi bir amaç için çogaltilamaz, yayinlanamaz ve para karsiligi satilamaz; mesajin yetkili alicisi veya alicisina iletmekten sorumlu kisi degilseniz, mesaj içerigini ya da eklerini kopyalamayiniz, yayinlamayiniz, baska kisilere yönlendirmeyiniz ve mesaji gönderen kisiyi derhal uyararak bu mesaji siliniz. Bu mesajin içeriginde ya da eklerinde yer alan bilgilerin dogrulugu, bütünlügü ve güncelligi Bankamiz tarafindan garanti edilmemektedir ve bilinen virüslere karsi kontrolleri yapilmis olarak yollanan mesajin sisteminizde yaratabilecegi zararlardan Bankamiz sorumlu tutulamaz. This message and the files attached to it are under the privacy liability in accordance with the Banking Law and confidential to the use of the individual or entity to whom they are addressed.This message cannot be copied, disclosed for any purpose or sold for any monetary consideration. If you are not the intended recipient of this message, you should not copy, distribute, disclose or forward the information that exists in the content and in the attachments of this message; please notify the sender immediately and delete all copies of this message. Our Bank does not warrant the accuracy, integrity and currency of the information transmitted with this message. This message has been detected for all known computer viruses hence our Bank is not liable for the occurrence of any system corruption caused by this message. ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentialit
[Hibernate] Querying s and s
This has been a huge missing feature since ancient versions of Hibernate. I sat down today and got it 90% done in about 3 hours. Much easier than I feared. Theres still a bit of work to go on this to finish it off, but its useful already. eg. from Foo foo join foo.setOfStrings string where string='foo' from Foo foo join foo.bagOfCompositeElements celem where celem.property='foo' seems to be working very nicely. In CVS v21branch I am very, very happy about this. --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] FW: externalize SQL
Hibernate 2.1 will support queries written in SQL so yes, it will be possible, essentially. Take a look at the latest Road Map on the wiki. |-+---> | | "Morgan, Jennifer" | | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 02/08/03 03:49 AM | | | | |-+---> >--| | | | To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> | | cc: | | Subject: [Hibernate] FW: externalize SQL | >--| > Is it possible to make hibernate externalize the SQL it's using so that > our database group can tune it and > tweak as they see fit? > Thanks! > > Jennifer Morgan :-) > [EMAIL PROTECTED] > 303-397-5173 > > > > The information in this electronic mail message is sender's business Confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this Internet electronic mail message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. The sender believes that this E-mail and any attachments were free of any virus, worm, Trojan horse, and/or malicious code when sent. This message and its attachments could have been infected during transmission. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective and remedial action about viruses and other defects. Galileo International is not liable for any loss or damage arising in any way from this message or its attachments. --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Feature idea
Yes, I can certainly see the attraction - and it *has* been requested before. It would be nice to be able to plug in a something like: NamingStrategy strategy = new MyCustomNamingStrategy(); Configuration cfg = new Configuration(); cfg.setNamingStrategy(strategy); perhaps we could even allow this as: The naming strategy itself would have methods like: String getColumnName(String propertyName) String getTableName(String className) String overrideColumName(String columnName) String overrideTableName(String tableName) Add a feature request to JIRA! Note that this is *really* easy to do, with just a little bit of playing with the .cfg package. Why not implement it yourself, and send a patch? |-+---> | | Timo Verhoeven <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 02/08/03 02:25 AM | | | | |-+---> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: [Hibernate] Feature idea | >--| Hi all! When I design database datamodels I usually encounter clashes between reserved names and names I'd like to use for my tables/columns, e.g. "user", "role", etc.. So I ended up prefixing all tables/views/columns: Tables have a "tbl" prefix, views a "qry" prefix and columns either have a "fld" or a prefix based on the datatype ("txt"/"str" for varchars, etc.). I like to keep my mapping files small (/ to have few xdoclet tags) and like the fact that hibernate has smart default for column names: it uses the property's name. Would it be possible/would you consider it useful to be able to specify "default prefixes" for tables/columns so that I don't have to name my columns manually in my mappings when I have to use prefixes? Such settings could go into the SessionFactory configuration. Opinions? Timo --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Joined-subclass with Hibernate and XDoclet
Have you set in the ant script? |-+---> | | "Robb Greathouse" | | | <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 02/08/03 12:16 AM | | | | |-+---> >--| | | | To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> | | cc: | | Subject: [Hibernate] Joined-subclass with Hibernate and XDoclet | >--| joined-subclass works fine in Hibernate; but we can't get XDoclet to create the DTD. It simply ignores the joined-subclass classes. Anyone else have this problem? Were you able to fix it? (See attached file: TEXT.htm) ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** joined-subclass works fine in Hibernate; but we can't get XDoclet to create the DTD. It simply ignores the joined-subclass classes. Anyone else have this problem? Were you able to fix it?
[Hibernate] Mass Deletes
Many users have asked for session.delete("from Foo foo where foo.count=0"); to issue a single SQL DELETE. This is certainly not possible for objects with collections or cascades (though it might not matter if we ignore Lifecycle callback; not sure). For other classes it is conceptually possible. Now, this is really quite easy to implement - it would take me about 1-2 hours to do it. But my big problem is: how do we know which _loaded_ objects were deleted? I don't think there is any good way to do this. All we get back from DELETE is a row count. * Do we issue a SELECT beforehand, to fetch the ids . and then issue the delete? * Do we just disable mass delete for classes which have loaded instances? * Is it simply not worth it? The select-then-delete option doesn't seem particularly better than the current situation when JDBC batch updates are enabled. The disable-when-instances-are-loaded option looks like it would work, but only for some very limited usecases (though it may work for the usecases we are most interested in). Thoughts? ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Mass Deletes
Sorry! I thought of that one, but forgot to write it down! Its probably the best option, actually, though less transparent to the user. |-+> | | "Domagoj | | | Jugovich"| | | <[EMAIL PROTECTED]>| | || | | 04/08/03 05:23 PM| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Re: [Hibernate] Mass Deletes | >--| and fourth :issue a delete and flush all cache but disable-when-instances-are-loaded is OK, when we want a mass delete we must take care that we don't have nothing loaded of that class, it is more logical because this mass-delete feature is primarily for speed/performance so we should tradeoff everithing , lifecycle, caching, if we want lifecacyle etc.. we do normal deletion. But how will be the choosing implemented (mass or normal delete) ? - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 04, 2003 5:36 AM Subject: [Hibernate] Mass Deletes > Many users have asked for > > session.delete("from Foo foo where foo.count=0"); > > to issue a single SQL DELETE. This is certainly not possible for objects > with collections or cascades (though it might not matter if we ignore > Lifecycle callback; not sure). For other classes it is conceptually > possible. > > Now, this is really quite easy to implement - it would take me about 1-2 > hours to do it. > > But my big problem is: how do we know which _loaded_ objects were deleted? > I don't think there is any good way to do this. All we get back from DELETE > is a row count. > > * Do we issue a SELECT beforehand, to fetch the ids . and then issue > the delete? > * Do we just disable mass delete for classes which have loaded instances? > * Is it simply not worth it? > > The select-then-delete option doesn't seem particularly better than the > current situation when JDBC batch updates are enabled. The > disable-when-instances-are-loaded option looks like it would work, but only > for some very limited usecases (though it may work for the usecases we are > most interested in). > > > Thoughts? > > > ** > Any personal or sensitive information contained in this email and > attachments must be handled in accordance with the Victorian Information > Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 > (Commonwealth), as applicable. > > This email, including all attachments, is confidential. If you are not the > intended recipient, you must not disclose, distribute, copy or use the > information contained in this email or attachments. Any confidentiality or > privilege is not waived or lost because this email has been sent to you in > error. If you have received it in error, please let us know by reply > email, delete it from your system and destroy any copies. > ** > > > > > > > --- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it
Re: [Hibernate] Mass Deletes
Note that the single problem with this is that objects that _aren't_ actually being deleted (and that might be referenced by the application) are suddenly evicted - and any subsequent modifications are lost. Actually, the disable-when-instances-are-loaded option can almost be used to emulate the evict-all-instances option. The user just has to manually evict any instances that might cause mass update to be disabled. P.S. I just realised that this is more than a 2 hr job. I was hoping to reuse the existing HQL translation code completely. Unfortunately, databases dont like: delete from foos f where f.count > 10 You aren't allowed to use aliases in a DELETE. I wasn't really aware of that (makes sense). But anyway, its still certainly doable. |-+> | | "Domagoj | | | Jugovich"| | | <[EMAIL PROTECTED]>| | || | | 04/08/03 05:23 PM| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Re: [Hibernate] Mass Deletes | >--| and fourth :issue a delete and flush all cache but disable-when-instances-are-loaded is OK, when we want a mass delete we must take care that we don't have nothing loaded of that class, it is more logical because this mass-delete feature is primarily for speed/performance so we should tradeoff everithing , lifecycle, caching, if we want lifecacyle etc.. we do normal deletion. But how will be the choosing implemented (mass or normal delete) ? - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 04, 2003 5:36 AM Subject: [Hibernate] Mass Deletes > Many users have asked for > > session.delete("from Foo foo where foo.count=0"); > > to issue a single SQL DELETE. This is certainly not possible for objects > with collections or cascades (though it might not matter if we ignore > Lifecycle callback; not sure). For other classes it is conceptually > possible. > > Now, this is really quite easy to implement - it would take me about 1-2 > hours to do it. > > But my big problem is: how do we know which _loaded_ objects were deleted? > I don't think there is any good way to do this. All we get back from DELETE > is a row count. > > * Do we issue a SELECT beforehand, to fetch the ids . and then issue > the delete? > * Do we just disable mass delete for classes which have loaded instances? > * Is it simply not worth it? > > The select-then-delete option doesn't seem particularly better than the > current situation when JDBC batch updates are enabled. The > disable-when-instances-are-loaded option looks like it would work, but only > for some very limited usecases (though it may work for the usecases we are > most interested in). > > > Thoughts? > > > ** > Any personal or sensitive information contained in this email and > attachments must be handled in accordance with the Victorian Information > Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 > (Commonwealth), as applicable. > > This email, including all attachments, is confidential. If you are not the > intended recipient, you must not disclose, distribute, copy or use the > information contained in this email or attachments. Any confidentiality or > privilege is not waived or lost because this email has been sent to you in > error. If you have received it in error, please let us know by reply > email, delete it from your system and destroy any copies. > ** > > > > > > > --- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > ***
Re: [Hibernate] Mass Deletes
AFAICT, databases do not support DELETEs with joins |-+> | | Max Rydahl | | | Andersen | | | <[EMAIL PROTECTED]> | | || | | 04/08/03 06:32 PM| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: [EMAIL PROTECTED] | | Subject: Re: [Hibernate] Mass Deletes | >--| [EMAIL PROTECTED] wrote: > Many users have asked for > > session.delete("from Foo foo where foo.count=0"); > > to issue a single SQL DELETE. This is certainly not possible for objects > with collections or cascades (though it might not matter if we ignore > Lifecycle callback; not sure). For other classes it is conceptually > possible. > > Now, this is really quite easy to implement - it would take me about 1-2 > hours to do it. > > But my big problem is: how do we know which _loaded_ objects were deleted? > I don't think there is any good way to do this. All we get back from DELETE > is a row count. > > * Do we issue a SELECT beforehand, to fetch the ids . and then issue > the delete? > * Do we just disable mass delete for classes which have loaded instances? > * Is it simply not worth it? > > The select-then-delete option doesn't seem particularly better than the > current situation when JDBC batch updates are enabled. The > disable-when-instances-are-loaded option looks like it would work, but only > for some very limited usecases (though it may work for the usecases we are > most interested in). > > > Thoughts? > I would go for the disable-when-instances-are-loaded option. And we should need some small support methods like: "isMassDeletable(Class c)" or "isMassDeletable(String hql), something to be able to query on the state to find possible answers to why my delete("from People f where f.location = 'Earth') takes a billion years instead of just a couple of seconds ;) Btw. how would joins fit into this scenario ? Is any/all HQL query deletable ? Can one find out upfront without issuing the delete ? /max ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01 ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] JCA RollBack
>>> The other problem and perhaps Gavin has some input on this, is that when you make use of the proxy feature, it appears that the proxy keeps a refernce to the session that was used to create that proxy. So if the connection is getting closed between SB calls this proxy object fails when passed to a second SB. This is a bit of a dilemma for me as the proxy would greatly impact performace of my system (the only other solution is to stop using the one to one mapping and return id values of these colums instead, not very object). << huh? what is the problem here? It is just like passing objects back to the web tier, right?? You call Hibernate.initialize(), of whatever else to initialize the proxy first, before passing it on I guess, we *could* implement ThreadLocalSession internally in Hibernate so that proxies and lazy collections _automatically_ pick up a reference to the current Session. But I've so far resisted this design. It doesn't work too well for collections, since they can't be reassociated with a new Session without their current owner also being reassociated. And there is no way to implement a backpointer from the collection to its owner. |-+---> | | Andy Britz | | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | ceforge.net | | | | | | | | | 05/08/03 05:27 PM | | | Please respond to andy | | | | |-+---> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: [Hibernate] JCA RollBack | >--| Hi Igor Thanks for the quick response. I will try and use the solution you suggested. Hopefully this will solve the transaction and update problems with loaded objects. The other problem and perhaps Gavin has some input on this, is that when you make use of the proxy feature, it appears that the proxy keeps a refernce to the session that was used to create that proxy. So if the connection is getting closed between SB calls this proxy object fails when passed to a second SB. This is a bit of a dilemma for me as the proxy would greatly impact performace of my system (the only other solution is to stop using the one to one mapping and return id values of these colums instead, not very object). So I can only figure out two senarios that solve this 1. if it is impossible to use the thread local pattern, I need a proxy that gets a handle to a new session everytime it tries a lazy load. 2. I need hibenrate to control its own DB connections so that I can use a thread local pattern. Once again any input would be most apreciated regards Andy At Monday, 04 August 2003, Igor Fedorenko <[EMAIL PROTECTED]> wrote: >Andy, > >It's been a while sinse I last looked at this code but as far as I >remember there was a way to force JBoss to use the same JCA connection >to be used by multiple EJBs participating in the same transaction (if >this is what you want). If I am not mistaken, you should specify >ejb-resource-ref/Sharable in ejb-jar.xml and track-connection-by-tx (or >something like this) in hibernate-ds.xml file. If you did that, JBoss >would use the same HibernateSession instance throughout entire >transaction so you don't need to implement you own ThreadLocal. The >problem with this approach is that generally speaking you cannot >guarantee that all EJBs are deployed in one JVM (you can have a cluster, >for example). > >Andy Britz wrote: >> Hi guys, this mail is aimed mainly at Daniel and Igor as I understand >> they are responsible for the JCA implementation >> >> I would like to get some information regarding the JCA adapter and >> request a possible rollback to an earlier implementation provided >> by Daniel. >> >> Here is a Scenario (mine actually), many different local Session >> beans in JBoss. All attempting to share a session using the ThreadLocal >> pattern. The reason for this is an attempt to use the lazy loading >> and proxy features prov
[Hibernate] Refactored Persistence Logic
I would appreciate if people would look over and try to understand the new design.I would like to get as much input into this stuff as possible. My goal was to cleanly seperate logic that is general to Hibernate's model of entities/components/values/collections from code that implements a particular strategy for persisting an entity. The most pressing need for this was to support different mapping strategies like the normalized table-per-subclass mapping. However, there are other (hypothetical) examples of how "persistence strategies" might be useful: * an entity is persisted by stored procedure calls * an entity is persisted to LDAP * an entity persists instance variables with no property accessors Now I don't propose that Hibernate would have built-in with persistence strategies to address these cases (I view them as out-of-scope). However, it would be nice to have an API we could point to and say: if you need to do something different, implement this interface. So I've added two new packages. * the cirrus.hibernate.persister package defines - the contract between the session and persistence strategies (ClassPersister) - the contract between QueryTranslator and a persistence strategy that supports querying (Queryable) - the contract between Loader and a persistence strategy that supports built-in loading - a default persistence strategy (EntityPersister) * the cirrus.hibernate.loader package defines the built-in loading mechanisms, which may or may not be used by a particular persistence strategy - Loader implements the most generic logic used by all built-in loaders and the QueryTranslator - OuterJoinLoader implements logic for loading a graph of associated objects using outerjoins - etc. As part of all that, I moved a lot of code around (and rewrote some bad code) and cleaned up a number of internal interfaces. SessionImpl is now completely abstracted from generated SQL and almost completely abstracted from JDBC. Then only remaining code dealing with JDBC is the code that does batching (which I dont know where else to put). Critiques are very welcome :) Gavin --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ClobType
The fact that I don't know what I think is the main reason I've never added a ClobType before. I'm assuming that the best way would be to somehow provide access to the JDBC Clob object (and similarly for Blobs). Is this possible? Do you need to provide a seperate Holder class? I like the reader/writer idea but the trouble with that is how on earth do you do dirty checking? Hibernate can't compare the reader to the writer to see if it changed. - Original Message - From: "Mark Woon" <[EMAIL PROTECTED]> To: "Hibernate Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, October 16, 2002 6:11 PM Subject: [Hibernate] ClobType > Gavin, > > I know I've reported that Hibernate works with CLOB's, but I'm afraid > that I was wrong. Hibernate persists Strings into CLOB columns > perfectly fine, but reading it out of the db yields a null. I've added > a new ClobType to handle CLOB columns to treat them as Strings. I've > attached a diff and the new file. > > I'm not sure that this is the right thing to do, because some may want > direct access to the Clob object, or would prefer a Reader (in which > case the setter ought to be a Writer), which would be a lot more > complicated. If we go with the former, Hibernate would need to > implement it's own Clob object. What do you think? > > -Mark > > > ? build > ? patch.diff > ? cirrus/hibernate/type/ClobType.java > ? lib/j2ee.jar > ? lib/junit.jar > Index: cirrus/hibernate/Hibernate.java > === > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Hibernate.java,v > retrieving revision 1.59 > diff -c -r1.59 Hibernate.java > *** cirrus/hibernate/Hibernate.java 5 Oct 2002 04:18:30 - 1.59 > --- cirrus/hibernate/Hibernate.java 16 Oct 2002 08:02:56 - > *** > *** 50,55 > --- 50,59 > */ > public static final NullableType STRING = new StringType(); > /** > + * Hibernate clob type > + */ > + public static final NullableType CLOB = new ClobType(); > + /** > * Hibernate time type > */ > public static final NullableType TIME = new TimeType(); > Index: cirrus/hibernate/impl/SessionImpl.java > === > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v > retrieving revision 1.128 > diff -c -r1.128 SessionImpl.java > *** cirrus/hibernate/impl/SessionImpl.java 15 Oct 2002 16:04:05 - 1.128 > --- cirrus/hibernate/impl/SessionImpl.java 16 Oct 2002 08:03:04 - > *** > *** 1002,1008 > } > else if ( old!=null ) { > throw new HibernateException( > ! "Another object was associated with this id (the object with the given id was already loaded)" > ); > } > > --- 1002,1009 > } > else if ( old!=null ) { > throw new HibernateException( > ! "Another object of " + object.getClass().toString() + > ! " has already been loaded with the id " + id > ); > } > > Index: cirrus/hibernate/sql/OracleDialect.java > === > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/OracleDialect.java,v > retrieving revision 1.25 > diff -c -r1.25 OracleDialect.java > *** cirrus/hibernate/sql/OracleDialect.java 2 Oct 2002 06:27:55 - 1.25 > --- cirrus/hibernate/sql/OracleDialect.java 16 Oct 2002 08:03:05 - > *** > *** 31,36 > --- 31,37 > register( Types.TIMESTAMP, "DATE" ); > register( Types.VARBINARY, "RAW($l)" ); > register( Types.NUMERIC, "NUMBER(19, $l)" ); > + register( Types.CLOB, "CLOB" ); > > outerJoinGenerator = new OracleOuterJoinGenerator(); > > Index: cirrus/hibernate/type/TypeFactory.java > === > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/TypeFactory.java,v > retrieving revision 1.20 > diff -c -r1.20 TypeFactory.java > *** cirrus/hibernate/type/TypeFactory.java 5 Oct 2002 09:33:42 - 1.20 > --- cirrus/hibernate/type/TypeFactory.java 16 Oct 2002 08:03:06 - > *** > *** 39,44 > --- 39,45 > basics.put( Hibernate.CHARACTER.getName(), Hibernate.CHARACTER); > basics.put( Hibernate.INTEGER.getName(), Hibernate.INTEGER); > basics.put( Hibernate.STRING.getName(), Hibernate.STRING); > + basics.put( Hibernate.CLOB.getName(), Hibernate.CLOB); > basics.put( Hibernate.DATE.getName(), Hibernate.DATE); > basics.put( Hibernate.TIME.getName(), Hibernate.TIME); > basics.put( Hibernate.TIMESTAMP.getName(), Hibernate.TIMESTAMP); > > //$Id: ClobType.java,v 1.17 2002/10/11 05:39:15 oneovthafew Exp $ > package cirrus.hibernate.type; > > import java.sql.Clob; > import java.sql.PreparedStatement; > import java.sql.ResultSet; > import jav
Re: [Hibernate] 5 meg worth of hibernate.....
Ah. Thats a bad way of measuring, of course The dependencies don't squash, whereas the documentation does! derr... so the 4.5 meg tar.gz breaks down to: 1 meg doc/ 600k hibernate.jar 200k src/ 3 meg lib/ So its the dependencies killing us. We *could* externalise optional jars: jcs.jar, commons-lang.jar, c3p0.jar, commons-dbcp.jar, commons-pool.jar, commons-collections.jar but Hibernate wouldnt compile without them - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, September 15, 2002 5:53 PM Subject: [Hibernate] 5 meg worth of hibernate. > Hmmm. The latest filesizes have got a bit out of hand: > > hibernate-1.1rc2.tar.gz 4649334 > hibernate-1.1rc2.zip 5300474 > > unzipped its over 10 meg: > > * 1.1 meg src/ > * 3.1 meg lib/ > * 6 meg doc/ > * 600k hibernate.jar > > I was going to suggest a seperate source distribution, but thats not really > going to be much help. The real killer is all the doco (and note we aren't > even distributing the documentation source). > > If anyone has a problem with it being a 5 meg download, please let me > know > > > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] support for dynabeans
> Hadnt thought of that, thanks, > > Would it be possible to add my definitions to the DataStore, and then > recreate or reinitialize the SessionFactoryImpl? > > Then I could build a guy where the user can define his new tables, and > modify just the DataStore, and when he clicks on "apply", i update the > db and recreate the SessionFactoryImpl. > > Would that work? Can't think why not. Should be fine. The Datastore is designed to allow multiple calls to buildSessionFactory (but you should watch out for bugs in that because its not covered in the test suite!) --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Another bug (this is not my lucky day...)
Ah, yeah I can see how that could happen. I'll fix it tomorrow. This is a fairly new bug, I think. - Original Message - From: "Andrea Aime" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 25, 2002 1:23 AM Subject: [Hibernate] Another bug (this is not my lucky day...) > I've found another bug... let's consider the following mapping: > > > > > > > > > the following query: > > Iterator num = s.iterate("select max(c.idCode) from c in " + > Customer.class); > > will return the max of the id property, not that of idCode! Changing the > column > name doesn't help, changing the property name solves the problem. > Best regards > > Andrea "lucky man" Aime > > > > --- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0003en > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0003en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Question about onUpdate
> It appears to me that the onUpdate() method is not getting called when it should. onUpdate() gets called only when you explicitly pass a transient object to Session.update(). ie. its called when a transient object becomes "sessional". Its not called when an dirty object is UPDATEd on the database. I'm not sure if that is the source of some confusion, or if there is an actual bug. I know it seems to make sense to have a callback just before changes are persisted, and I spent a lot of time thinking about that. However, I decided that this was actually not a good idea for a number of reasons (I will describe them if you want but my girlie wants to us the computer now so I don't have time...) > Before I go digging around and trying to fix this, I wanted to make sure no one else was working on it. Yeah, could you please check thats its working as I described. There is a test for this but tests are not infallible. > PS - Is anyone working on adding outer join support for Oracle? If not, then I'd like to volunteer to do this. Yes, please. No-one is working on this AFAIK and I'm not planning to implement it myself. I'm playing around with a little ODMG-compliant API adaptor at the moment. Much less powerful API than Hibernate, because ODMG was designed as a lowest-common-denominator thing. But its is an established standard. Doesn't hurt to support it as an alternative. --- In remembrance www.osdn.com/911/ ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] try/finally in testcode ?
> They don't stop, do they ? They halt - and waitand waits...and waits :) Interestingly *enough*, that depends upon the JDBC driver Its all part of "write once, run anywhere".. ;) --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] How to create an index on normal property element ?
Yick! but it looks like the property isn't really called "ownernumber"; perhaps you meant "ownerNumber"? - Original Message - From: "Jochen Rebhan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Gavin King" <[EMAIL PROTECTED]> Sent: Tuesday, November 26, 2002 1:48 AM Subject: Re: [Hibernate] How to create an index on normal property element ? > Thanks for your help, but exactly in the line with the colum tag (corresponds to line 15) the schema generator shows an error: > > > > > > > Any ideas ??? > > Kind regards > Jochen Rebhan > [EMAIL PROTECTED] > > > > > > My message from the Schema generator: > > Arguments: > processing mapping for class: buddy.database.Meetings > processing mapping for class: buddy.database.Friend > property "ownernumber" in class Friend is missing a type attribute > Copying 2 files to C:\java\buddySrv\src > Compiling 2 source files to C:\java\buddySrv\web\WEB-INF\classes > (cirrus.hibernate.helpers.XMLHelper$1.error:38) - Error parsing XML: src/buddy/database/Friend.hbm.xml(15) > org.xml.sax.SAXParseException: Attribute "type" must be declared for element type "column". > at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) > at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unk nown Source) > at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) > at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkno wn Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc her.dispatch(Unknown Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) > at cirrus.hibernate.helpers.XMLHelper.parseInputSource(XMLHelper.java:48) > at cirrus.hibernate.helpers.XMLHelper.parseFile(XMLHelper.java:22) > at cirrus.hibernate.impl.DatastoreImpl.storeFile(DatastoreImpl.java:68) > at cirrus.hibernate.tools.SchemaExport.main(SchemaExport.java:203) > (cirrus.hibernate.helpers.XMLHelper$1.error:38) - Error parsing XML: src/buddy/database/Friend.hbm.xml(15) > org.xml.sax.SAXParseException: Attribute "lenth" must be declared for element type "column". > at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) > at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unk nown Source) > at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) > at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkno wn Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc her.dispatch(Unknown Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) > at cirrus.hibernate.helpers.XMLHelper.parseInputSource(XMLHelper.java:48) > at cirrus.hibernate.helpers.XMLHelper.parseFile(XMLHelper.java:22) > at cirrus.hibernate.impl.DatastoreImpl.storeFile(DatastoreImpl.java:68) > at cirrus.hibernate.tools.SchemaExport.main(SchemaExport.java:203) > (cirrus.hibernate.impl.DatastoreImpl.store:106) - Could not compile the mapping document > cirrus.hibernate.MappingException: Could not find a getter for ownernumber in class buddy.database.Friend > at cirrus.hibernate.helpers.ReflectHelper.getGetterMethod(ReflectHelper.java:11 9) > at cirrus.hibernate.helpers.ReflectHelper.reflectedPropertyType(ReflectHelper.j ava:163) &
Re: [Hibernate] writing the properties of a persistent object to a string
> ...or am I being thick, and most stringifying can pretty much be done with > toXML and an appropriate stylesheet? > yup, thats exactly the idea --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Would someone try out this MS SQL server driver?
I never noticed this project before: http://jtds.sourceforge.net/ I don't have MSSQL installed on this machine to try it out, though. --- This SF.net email is sponsored by: ApacheCon, November 18-21 in Las Vegas (supported by COMDEX), the only Apache event to be fully supported by the ASF. http://www.apachecon.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Re: [Hibernate-commits] Hibernate/cirrus/hibernate/test FooBarTest.java,1.237,1.238 MultiTableTest.java,1.21,1.22
IBM JVM returns reflected methods in the reverse order. So if some test deosn't clean up after itself, it might fail on one JVM but not the other :) > -Original Message- > From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 31 December 2002 12:16 AM > To: [EMAIL PROTECTED] > Subject: [Hibernate] Re: [Hibernate-commits] > Hibernate/cirrus/hibernate/test FooBarTest.java,1.237,1.238 > MultiTableTest.java,1.21,1.22 > > > Just curious, what is different in IBM JVM since the tests > did not run on it ? > > /max > > - Original Message - > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, December 30, 2002 2:11 PM > Subject: [Hibernate-commits] Hibernate/cirrus/hibernate/test > FooBarTest.java,1.237,1.238 MultiTableTest.java,1.21,1.22 > > > > Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test > > In directory sc8-pr-cvs1:/tmp/cvs-serv14135/cirrus/hibernate/test > > > > Modified Files: > > FooBarTest.java MultiTableTest.java > > Log Message: > > got tests working in IBM JVM > > > > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > 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 ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Using CLOBs
The name of the type is "clob", and the expected property type is java.sql.Clob. Note that there are restrictions upon what you can do with Clobs (they can't be used outside of transaction, for example). You should also take notice of Hibernate.createClob(). > -Original Message- > From: Ugo Cei [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 31 December 2002 1:06 AM > To: [EMAIL PROTECTED] > Subject: [Hibernate] Using CLOBs > > > Hi people, > > does anybody have some documentation and/or samples re using CLOBs in > the current CVS version? > > Do I have to declare 'type="clob"' in my mapping file? Do my class > attributes have to be String's or java.sql.Clob's or something else? > > Since I need this feature, I'd like to help testing and maybe fixing > them, in particular with Oracle, but I need a couple of hints just to > get me started. > > Thanks in Advance, > > Ugo > > -- > Ugo Cei - http://www.beblogging.com/blog/ > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > 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 ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Delete bug (and fix)
The reason it doesn't check list!=null is that find() is never supposed to return a null list How did you make that happen?? Do you have a stacktrace, etc? > I've found a bug that causes a NPE in the Session.delete(String query) > implementation: if you pass a query that return no objects you end up > with an NPE. The incriminated code follows: > > SessionImpl.java (line 1178) > > public int delete(String query, Object[] values, Type[] types) throws > HibernateException, SQLException { > > if ( log.isTraceEnabled() ) { > log.trace( "delete: " + query ); > if (values.length!=0) log.trace( "parameters: " + > StringHelper.toString(values) ); > } > > List list = find(query, values, types); > int size = list.size(); > for ( int i=0; i return size; > } > > The list.size() call fails if list is null... should look like: > > if(list != null) { > int size = list.size(); > for ( int i=0; i return size; > } else { > return 0; > } > > Bye > Andrea > > > > > --- > This sf.net email is sponsored by: > Access Your PC Securely with GoToMyPC. Try Free Now > https://www.gotomypc.com/s/OSND/DD > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: Access Your PC Securely with GoToMyPC. Try Free Now https://www.gotomypc.com/s/OSND/DD ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Tools road map
My comments are now added in /italics/ on the page itself... > -Original Message- > From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 31 December 2002 7:16 AM > To: [EMAIL PROTECTED] > Subject: [Hibernate] Tools road map > > > I've been so "insane" to plot down a "road-map" for the Tools > in Hibernate...it actually turned out to include more than an > road-map... So please take a look at > http://hibernate.bluemars.net/52.html > > And please provide any comment you see fit :) > > /max > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > 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 ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Another problem: jmx vs static initialization
Yup, thats right. - Original Message - From: "Urberg, John" <[EMAIL PROTECTED]> To: "'Andrea Aime'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, October 24, 2002 11:15 PM Subject: RE: [Hibernate] Another problem: jmx vs static initialization > >> Your question is timely, I was givin a look at Hibernate, Configure and > Datastore source trying to figure out how does it work... anyway, it seems > as simple as calling Configure.configure("xmlfile"), getting the session > factory from the array returned and using it, right? No static objects > whatsoever that may disallow reconfiguring data? << > > I'll have to let Gavin answer that one. I haven't worked much with the XML > configuration. > > Regards, > John > > > --- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ad.doubleclick.net/clk;4729346;7592162;s?http://www.sun.com/javavote > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ad.doubleclick.net/clk;4729346;7592162;s?http://www.sun.com/javavote ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Hibernate XDoclet Task
> * Is there any chance to add predefined queries to the > generated mapping? Ummm, I thought theres was a @hibernate.query tag > * Is there any chance to generate the bean-pattern > (setXXX(), getXXX() >and especially the addXXX(Child)/setXXX(Parent)) methods of the >java-bean class? I really do not like to write them down... If you want that kind of thing, its probably better to go with CodeGenerator rather than XDoclet. Hibernate is stubbornly "property-centric" rather than "field-centric" and most people think this is a feature. It would cut against the grain to let you mark up persistent fields and have the get/set pair be generated. (Anyway, I just let Eclipse generate my get/set pair.) ** 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 [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] CodeGenerator
> > > > > > JavaDoc comment for getBar() > > > > java.lang.Object > > > > . > > But this one ? Isn't this a bit "cloudy" > If I understand this correctly you want that if "java-type" > is provided the codegenerator should use that type instead of > the type specified in the propertyJust curious, when is > that usefull ? For example: currently generates: public java.sql.Date getDate(); what if you wanted public java.util.Date getDate(); Hey, I just thought of another that would be *very* useful: protected JavaDoc comment for getBar() surprised I didn't think of that before ** 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 [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] buglet in 1.2.1
For the new logging stuff I added something like: Log log = LogFactory.getLog( Type.class.getPackage().getName() ); Turns out that getPackage() is allowed to return null if the JVM can't be bothered implementing it. And some (but not all) versions of the IBM JVM do just that. So there is a version of the IBM JVM for which Hibernate 1.2.1 will die *instantly* with an NPE :( Not the version I tested on before releasing, however! The fix is to replace Type.class.getPackage().getName() with "cirrus.hibernate.type" ** 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 [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Please check out the new locking API
Could people do me a favor + check out the new locking API and let me know what they think. 'Cos if no-one else has any very strong opinions on this stuff, I might as well release it in the next version. TIA Gavin --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Ohhh this looks cool
> i think the difference would be marginal, as dynamic proxies also use > class generation behind the scenes... I have a suspicion it will be slightly slower with CGLIB, actually. --- This sf.net emial is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ad.doubleclick.net/clk;4699841;7576301;v? http://www.sun.com/javavote ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Contribution: Added UNIX version of demo.bat to the top directory of a release
Thanks. I added it to the Hibernate2 CVS tree :) > -Original Message- > From: Zhenlei Cai [mailto:[EMAIL PROTECTED] > Sent: Sunday, 12 January 2003 7:43 PM > To: [EMAIL PROTECTED] > Subject: [Hibernate] Contribution: Added UNIX version of > demo.bat to the top directory of a release > > > I copied the demo.bat to demo.sh to run under Linux, > initalially I was > getting a strange java.lang.NoClassDefFoundError. > Then I realized it's caused by the Windows line endings of demo.bat. > Also it'd be nice if the demo.bat references the on-line > tutorial about this demo: > http://hibernate.bluemars.net/29.html ( I did > not realize I > > need to change hibernate.properties until after I read that page). > Anyway here is the demo.sh script: > > #!/bin/sh > JDBC_DRIVER=/opt/pgsql/lib/postgresql-jdbc3-7.3.jar > java -cp > ..:$JDBC_DRIVER:./lib/commons-logging.jar:./lib/commons-collec tions.jar:./lib/commons-> lang.jar:./lib/cglib.jar:./lib/bcel.jar:./lib/odmg.jar:./lib/j > dom.jar:./lib/xml-apis.jar:./lib/xerces.jar:./lib/xalan.jar:./ > hibernate.jar > cirrus.hibernate.eg.NetworkDemo > > > > --- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something > 2 See! http://www.vasoftware.com > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > 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 ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Re: writing the properties of a persistent object to a string
> ( object instanceof HibernateProxy ) && ( (HibernateProxy) > object ).isUninitialized() Of course, you noticed my mistake, its really: ( object instanceof HibernateProxy ) && ( (HibernateProxy) object ).isUninitialized_() (trailing underscore) so that the methods of the Proxy are less likely to conflict with the names of methods of the persistent class... --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] RE: composite-id still doesn't work for me...
I think you need to understand how cascade="all" interacts with unsaved-value, etc. If you have cascade="all", update(parent) will pass the children to saveOrUpdate(). If the children have unsaved-value="none", they will all get updated; if they have unsaved-value="any", they will all get inserted. So if you don't want this behaviour, you can easily change it by disabling the cascade and explicitly save() or update()ing each child. I personally believe this is a good way to go, because it makes your meaning quite explicit in the code (and is efficient). Or else you could use synthetic ids, which is a much better approach for all sorts of reasons, but that also gives you the benefits of unsaved-value="null". (Which will dissolve all your issues here instantly.) This is all explained quite clearly in the documentation. Have you sat down and read it from top to bottom yet? Aside from the (fixed) bug in 1.2.2, the semantics here are *quite* clear and well defined if you read the documentation carefully. peace Gavin "Matt Raible" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] RE: composite-id still doesn't work for me... eforge.net 24/01/03 12:16 AM So is it possible to get a parent w/ children and only make a call to update(parent)? From your e-mail below, I gathered that I could change my storeObject() method to use update() rather than saveOrUpdate() and everything would work peachy-keen. Nope, I still get the same error - so obviously this is not the case. But from the FAQ (http://hibernate.bluemars.net/14.html#10), it seems to imply that I need to loop through all the children, doing update(child) and then do an update(parent). If I do this, I'd think that I would need to remove the children from the parent before calling update(parent). I don't mind doing it this way - I just want to make sure I'm following "best practices" for parent-child relationships with composite-ids. Thanks, Matt In reply to: http://sourceforge.net/mailarchive/forum.php?thread_id=1557661&forum_id= 7517 Of course! Its a FAQ item that assigned ids including composite ids can't distinguish between a saved or unsaved object (you have a choice between "always update" or "always insert"). So if you want to add a new child (with unsaved-value="none"), simply save () it manually first: child.setParent(parent); parent.addChild(child); session.save(child); session.update(parent); None of these things are issues if you use synthetic ids, as is best practice for all sorts of other reasons (see Scott Ambler's paper). --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ***
RE: [Hibernate] CVS doesn't compile
Silly me. Thanks. > -Original Message- > From: Mark Woon [mailto:[EMAIL PROTECTED] > Sent: Thursday, 12 December 2002 7:00 PM > To: Hibernate Mailing List > Subject: [Hibernate] CVS doesn't compile > > > FYI, > > The tree in CVS doesn't compile: > > 1) The TransactionManagerLookup interface implements > getUserTransactionName(). > 2) JTATransactionFactory has a bad variable name. > > Attached patch fixes these problems. > > -Mark > > ** 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: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] State of the Hibernate2 codebase?
Hi Jeff, theres a little bug in Hibernate2 SQL generation that has been pointed out in the forum, but it would only affect table joins accross tables with common column names. Anyway, I will fix that tonight or first thing tomorrow, so it will definately be fine for Monday. Apart from that, it is all working smoothly as far as I know. The reason it hasn't been released as a beta yet is that I still want to redesign the configuration APIs. If you accept that you will have to change you app configuration code to support the new API at some stage, I don't see any other reason not to use Hibernate2 for development code. Certainly don't use Hibernate2 for anything that will go into production in the next month or so! :) "Schnitzer, Jeff" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] State of the Hibernate2 codebase? eforge.net 24/01/03 09:50 AM I was wondering, how usable is the Hibernate2 codebase right now? Obviously I'm not looking to rush it into production, but I have a project that would be a suitable guinea pig if Hib2 compiles and (mostly) works... Thanks, Jeff --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] limit (was: problems with date comparision)
> Uh, LIMIT and OFFSET are not supported? setMaxResults() and setFirstResult() are supported. They achieve the same thing. > This may not be standard SQL, but some DBs > that Hibernate supports do support that SQL > extension. As far as I can tell, each database has its own syntax for this. Queries written using LIMIT would not be portable. > I thought that the whole point > of having different Dialects for different > types of databases was to support things > that are different, non-standard about them. > No? No. The idea of having Dialects is to ABSTRACT common functionality that is implemented in different ways on different platforms. In this case, the MySQL JDBC driver already does this abstraction; it abstracts the limit clause to Statement.setMaxRows(). > Are there any plans to support LIMIT and > OFFSET? Not really; not unless such a feature would be extremely popular. Its very easy to implement, but I havn't noticed anyone requesting it of late. > I know I will be needing it in my > application, which will use PostgreSQL. I > am already using it in some code that uses > straight JDBC, which I was hoping to convert > to work with Hibernate. Use setMaxResults() and setFirstResult() which will allow portability of your application to different platforms. --- This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will allow you to extend the highest allowed 128 bit encryption to all your clients even if they use browsers that are limited to 40 bit encryption. Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] jcs cache
The cache is not used for *queries*. It is used for calls to load() and for resolving associations. Also note that the cache does not store actual Vertex instances; it stores a *copy* of the state of the vertex. So an instance retrieved from the cache will always be a different instance from the one that went in there. This is essential to how Hibernate's multi-version- concurrency caching mechanism works. (Hibernate NEVER causes threads to block!) --- This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will allow you to extend the highest allowed 128 bit encryption to all your clients even if they use browsers that are limited to 40 bit encryption. Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Glarch$$EnhancedByCGLIB$$3 (Repeative method name/signature) and deadlock!
I just did a CVS diff and ran tests from the Ant script. All is working. Let me check that cglib.jar has -kb - Original Message - From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> To: "Max Rydahl Andersen" <[EMAIL PROTECTED]>; "Gavin King" <[EMAIL PROTECTED]> Cc: "hibernate list" <[EMAIL PROTECTED]> Sent: Sunday, November 03, 2002 10:05 AM Subject: Re: [Hibernate] Glarch$$EnhancedByCGLIB$$3 (Repeative method name/signature) and deadlock! > hmm - and now that I checkout the latest cglib.jar from cvs it still fails > ?!!? > > /max > > - Original Message - > From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> > To: "Gavin King" <[EMAIL PROTECTED]> > Cc: "hibernate list" <[EMAIL PROTECTED]> > Sent: Saturday, November 02, 2002 11:55 PM > Subject: Re: [Hibernate] Glarch$$EnhancedByCGLIB$$3 (Repeative method > name/signature) and deadlock! > > > > ok - it was also the next panic attempt I was about to take :) > > > > /max > > > > - Original Message - > > From: "Gavin King" <[EMAIL PROTECTED]> > > To: "Max Rydahl Andersen" <[EMAIL PROTECTED]> > > Cc: "hibernate list" <[EMAIL PROTECTED]> > > Sent: Saturday, November 02, 2002 11:46 PM > > Subject: Re: [Hibernate] Glarch$$EnhancedByCGLIB$$3 (Repeative method > > name/signature) and deadlock! > > > > > > > Ah. You need to grab the latest cglib.jar. I will add it to CVS now. > > > > > > - Original Message - > > > From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Sunday, November 03, 2002 9:33 AM > > > Subject: [Hibernate] Glarch$$EnhancedByCGLIB$$3 (Repeative method > > > name/signature) and deadlock! > > > > > > > > > > Hi! > > > > > > > > While running FooBarTest on the latest code from cvs I get the > following > > > > error (multiple times): > > > > java.lang.reflect.InvocationTargetException: > java.lang.ClassFormatError: > > > > cirrus/hibernate/test/Glarch$$EnhancedByCGLIB$$3 (Repeative method > > > > name/signature) > > > > > > > > The complete stack trace is at the bottom. > > > > > > > > Furthermore I also seem to get a deadlock between the connection that > > has > > > > created all the tables ( in schemaexport) and the next tests that do > > some > > > > updates! > > > > Doesn't schemeexport close its connection ? (or at least release its > > > locks?) > > > > > > > > /max > > > > > > > > > > > > ps. running MS SQL with the JTurbo driver. > > > > > > > > > > > > java.lang.reflect.InvocationTargetException: > java.lang.ClassFormatError: > > > > cirrus/hibernate/test/Glarch$$EnhancedByCGLIB$$3 (Repeative method > > > > name/signature) > > > > at java.lang.ClassLoader.defineClass0(Native Method) > > > > at java.lang.ClassLoader.defineClass(ClassLoader.java:493) > > > > at java.lang.ClassLoader.defineClass(ClassLoader.java:428) > > > > at java.lang.reflect.Method.invoke(Native Method) > > > > at net.sf.cglib.proxy.Enhancer.enhance(Enhancer.java:245) > > > > at > > > > > > > > > > cirrus.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.ja > > > > va:43) > > > > at > > cirrus.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1464) > > > > at > > cirrus.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1409) > > > > at > > > > > > > > > > cirrus.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:63) > > > > at cirrus.hibernate.type.EntityType.nullSafeGet(EntityType.java:118) > > > > at > > > cirrus.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:132) > > > > at cirrus.hibernate.type.AbstractType.hydrate(AbstractType.java:65) > > > > at cirrus.hibernate.loader.Loader.hydrate(Loader.java:334) > > > > at cirrus.hibernate.loader.Loader.loadFromResultSet(Loader.java:284) > > > > at cirrus.hibernate.loader.Loader.doFind(Loader.java:136) > > > > at cirrus.hibernate.loader.Loader.find(Loader.java:471) > > > > at cirrus.hibernate.impl.SessionImpl.find(SessionImpl.java:1069) > > > > at cirrus.hibernate.impl.Sess
Re: [Hibernate] saveOrUpdate()
You'll probably also be happy with the new refresh() method in Hibernate2 then, I imagine ;) > I'd love to see #2, since there are quite a few things in my system that > gets update by triggers, and I've been quite worried that these fields > might get overwritten. #1 and #3 are nice to haves, but I don't have > any immediate needs for these features. Ditto with #4. ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Metadata, codegenerator et.al...
> But now we do not NEED the proxies so it is better now, but not perfect > (since someone might > like to have proxies :) You still need proxies for polymorphic persistence. Check out the latest doco on the website for an explanation.. > Any suggestions on formats/semantics of it all ? (property and attribute are > dubious names in > this db context, so is custom-attribute a good tag-name/metadata name for > it ?) How about > I would love to contribute the above mentioned stuff, if I had a clear > vision on the existing parsing and building > of metadata info in Hibernateand currently it seems that Hibernate > CANNOT parse an hbm.xml without > having the related classes in its classpath ...and that is somewhat of an > limitiation when it is a codegenerator that > is about to generate these classes :) Good point. > Anyone with a clear vision and understanding of hibernates hbm.xml parsing > that can untangle that web of assumptions > in the hibernate core ? Okay, there are two levels of metadata. The "parsed" metadata, represented by the cirrus.hibernate.map package and the "compiled" metadata which is really just the internal state of the EntityPersisters. You have no chance of using the compiled metadata. On the other hand, it would be reasonably easy to remove any references to actual classes from the cirrus.hibernate.map package which is used to represent the internal state of Datastore. If you could clean up that package a little bit, it would probably do what you want. Now, that package is definately not meant to be exposed to users, but you might be able to expose it to the toolset. --- This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ad.doubleclick.net/clk;4729346;7592162;s?http://www.sun.com/javavote ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Whats the correct NUMERIC type for *your* database?
Cool! Thanks, Doug... Do you know if you need to specify a precision and/or scale value for NUMERIC columns in McKoi ... ie. is there some dumb default value like scale=0? - Original Message - From: "Doug Currie" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Sent: Monday, September 23, 2002 11:57 AM Subject: Re: [Hibernate] Whats the correct NUMERIC type for *your* database? > Gavin, > > I put an update to FooBarTest.java into CVS -- it removes restrictions > on MckoiDialect. I have FooBarTested Hibernate with Mckoi 0.94e. > > I added these lines to MckoiDialect.java and placed in CVS: > > public String getSequenceNextValString(String sequenceName) { > return "SELECT UNIQUEKEY('" + sequenceName + "')"; > } > public String getCreateSequenceString(String sequenceName) { > return "CREATE TABLE " + sequenceName + "(id NUMERIC)"; > } > public String getDropSequenceString(String sequenceName) { >return "DROP TABLE " + sequenceName; > } > > Re: your query... I believe Mckoi treats both column types NUMERIC and > DECIMAL equivalently as BigDecimals. > > Regards, > > e > > Sunday, September 22, 2002, 8:34:44 PM, you wrote: > > > Hi everyone, > > > in response to a user request, I'm adding a BigDecimal type. According to > > the JDBC spec, the correct mapping for this type is Types.NUMERIC. So we > > need to go ahead and add a NUMERIC type to all the dialects. To make this a > > bit easier, would people please let me know what database column type > > Types.NUMERIC should be mapped to for their platforms? --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] JCS cache - Distributable read-write
> --> The session hold a set of the items that have been updated/deleted in the transaction, > when the transaction commit, we iterate the set and remove each entry from the cache. but merely removing is not enough, because after removal, another transaction (that started *earlier*) could come along and try to write stale data in the cache because the database is actually free to return stale data to a read operation. Thats the reason for the more complicated logic in read-write cache. What you have to ensure is that a transaction that writes to the cache _started after the completion_ of the transaction that removed the object from the cache. (This is what the current read-write cache does.) > With this logic, we end with a read only cache ( we never update an item in the cache) for > mutable objects. I don't understand how this is different to the existing read-write cache which actually doesn't allow *update* of a cached item, it only allows removal from the cache when an object is updated. There seems to be three types of cache: Type 1: you can add an item you can't remove an item you can't update an item Type 2: you can add an item you can remove an item (when you attempt to update it on the DB) you can't update an item Type 3: you can add an item you can update an item (when you *know* you have updated its persistent state) Hibernate supports Type 1 (read-only) and Type 2 (read-write) but not Type 3. Type 3 would require Hibernate to know whether or not a transaction is successful (which it doesn't, in general). I'm not convinced that what you are implementing is different to Type 2 (except that it seems to have some holes...) --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Hooking into Hibernate classloader
I think its better to do this kind of thing by subclassing EntityPersister and overriding instantiate(). However, that will not work properly in the current implentation (for example getPersister( object.getClass() ) would fail). Would you please investigate what kind of changes would be required to make this approach work? - Original Message - From: "Chris Nokleberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 10:27 AM Subject: [Hibernate] Hooking into Hibernate classloader > I'd like to dynamically wrap my persistent classes using CGLIB or JDK1.3 > proxies to provide things like getters for metadata which aren't in the > compiled class file. I've done some searching and it appears that all of the > persistent classes are loaded by Hibernate using > > cirrus.hibernate.helpers.ReflectHelper.classForName(String) > > which is implemented as: > > public static Class classForName(String name) throws ClassNotFoundException { > try { > return Thread.currentThread().getContextClassLoader().loadClass(name); > } catch (Exception e) { > return Class.forName(name); > } > } > > One option would be to try to set the current context class loader before > Hibernate starts loading classes. But that is error-prone, I think. Another > way would be to add a method to set the classloader to use. But really I'd > just prefer a simple callback interface: > > public interface HibernateClassLoader { > public Class loadClass(String name) throws ClassNotFoundException; > } > > I guess the loader would be configurable per-datastore? > If there's a better way, let me know. > > Thanks, > Chris > > > --- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Re: Jmx error in 1.1.5
Ah. heh. yeah thats a misprint, isnt it. Thanks - Original Message - From: "Andrea Aime" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Sent: Sunday, October 20, 2002 1:57 AM Subject: Re: Jmx error in 1.1.5 > Because the line should be: > > this.mapResources = mappingResources.trim(); > > mapResources has not been initialized so it's null and we are > calling a trim on it... and we are discarding the mappingResources > parameter... > Andrea > > > Yick! Sorry, I actually wasn't fully aware of this bug. > > > > Are you suggesting the problem is here: > > > > > > public void setMapResources(String mappingResources) { > > > > this.mapResources = mapResources.trim(); > > > > } > > > > > > > > if so, why exactly is setMapResources() being called with a null argument. > > I'm confused > > > > > > - Original Message - > > From: "Andrea Aime" <[EMAIL PROTECTED]> > > To: "Gavin King" <[EMAIL PROTECTED]> > > Sent: Sunday, October 20, 2002 1:43 AM > > Subject: Jmx error in 1.1.5 > > > > > Hi Gavin, > > > the error in cirrus/hibernate/jmx/HibernateService.java > > > > (setMapResources.java) > > > > > that prevents the use of Hibernate as a jmx service is still there in > > > > 1.1.5, > > > > > thought it was corrected in cvs some time ago... this is particularly > > > frustrating since someone trying to deploy hibernate as a service will > > > > only > > > > > see a nullPointerException again and again (and wondering what he did > > > wrong...). Hope you can fix it and put out a 1.1.5b... > > > Best regards > > > Andrea Aime --- This sf.net email is sponsored by: Access Your PC Securely with GoToMyPC. Try Free Now https://www.gotomypc.com/s/OSND/DD ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] XML Mapping Option: class prefix
I can see how this would be nice, but hibernate.query.imports already makes me feel a bit quesy (and can be a source of bugs). I don't really wish to compound this by introducing a similar thing into the mapping files. - Original Message - From: "Donnerstag, Juergen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 15, 2002 10:48 PM Subject: [Hibernate] XML Mapping Option: class prefix > > I'm fairly new to hibernate. Please apologize if this is silly question. > > I have several XML mapping files, one for each table. Each mapping file > contains several locations where fully qualified class names are required. > > Like hibernate.query.imports is there a way to define the package, or at > least some common root package which is used as a common prefix. I wouldn't > have to type in the fully qualified class name over and over again. Besides > it makes it easier to modify and more flexible. I could imagine a hibernate > property as default location and and as > redefinition in case it is needed. > > regards > Jürgen > > > --- > This sf.net email is sponsored by: To learn the basics of securing > your web site with SSL, click here to get a FREE TRIAL of a Thawte > Server Certificate: http://www.gothawte.com/rd524.html > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] set, bag and list
Either Set or bag could be faster, depending upon the situation. Neither require an column. Hibernate bags are actually java.util.Lists because the java collections framework has no Bag. jiesheng zhang <[EMAIL PROTECTED]>To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] set, bag and list eforge.net 30/01/03 01:00 PM I have a collection of thing. I do not care whether there is duplication or not. I can use Set to prohibit duplication. I can also use list and bag. If I use Set rather than list/bag, I think the performance is not so good as it is for list/bag, since set has to limit duplication. I noticed that tag is required for list. But if I used linked list, I do not care about index. Can I omit the tag? Therefore I think bag is a good choice for my implementation: no index tag requirement and no performance penalty from set. However where the bag is declared? I looked through java.util.*. I did not find it. Thanks jason __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Hibernate2UML
Yeah that would be cool. I think with the new *Metadata interfaces its also quite easily doable. I don't know much about xmi myself but if you do, I think you would be able to implement this quite straightforwardly - Original Message - From: "Ampie Barnard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, October 26, 2002 1:23 PM Subject: [Hibernate] Hibernate2UML > Just a thought > > Currently Hibernate allows me to generate java code and db schemas from my > mapping file. It would be great if I could generate a UML class diagram (in > the form an xmi file ) from my mapping file. The mapping file is already > rich in UML concepts like composition, aggregation, association, keyed and > ordered relationships. Yet another indication how well Hibernate sticks to > the OO paradigm! > > Personally my class diagrams seldom go into more detail than my persistence > model, but I do find that as we approach the deadline of a project, even > these diagrams get out of sync with my code and the db. And then after that > I have the business analysts on my back asking all sorts of silly questions, > which they could answer for themselves if they understood my Hibernate > mapping file, which will never get out of sync with my db and code. > > Ampie > > > > --- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.net email is sponsored by: ApacheCon, November 18-21 in Las Vegas (supported by COMDEX), the only Apache event to be fully supported by the ASF. http://www.apachecon.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] interface and implemenation mapping
Ignore the interface A. jiesheng zhang <[EMAIL PROTECTED]>To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] interface and implemenation mapping eforge.net 30/01/03 01:20 PM Suppose we have a interface A, and an implemenation class A_Impl. In this case, there is no discriminator column and discrimator value. Can I use ... to map this? Or I have to use http://mailplus.yahoo.com --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Using hibernate - best practices
>If someone were to implement the sessionFactory as a JCA connector, all of >this code would become the responsibility of the container. It would also do >the propagation of transaction contexts. I am looking into implementing a JCA connector, by the way --- This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Whats the correct NUMERIC type for *your* database?
Hi everyone, in response to a user request, I'm adding a BigDecimal type. According to the JDBC spec, the correct mapping for this type is Types.NUMERIC. So we need to go ahead and add a NUMERIC type to all the dialects. To make this a bit easier, would people please let me know what database column type Types.NUMERIC should be mapped to for their platforms? TIA Gavin --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] hib2 - parent in composite-element
Thats perfectly fine its just doing a deep copy, for the purposes of dirty checking, so it doesn't need the parent. Of course it also doesn't need to call setParent()! ;) I will remove that call, but its harmless, so don't worry about it. - Original Message - From: "Viktor Szathmary" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 31, 2003 4:07 PM Subject: Re: [Hibernate] hib2 - parent in composite-element > hi, > > On Thu, 30 Jan 2003 23:39:18 -0500, "Viktor Szathmary" > <[EMAIL PROTECTED]> said: > > > alas, i got an IllegalArgumentException: "argument type mismatch" when > > it's calling the setter... it turns out the problem is more of a > > misunderstanding - the for the nested composite-element is > > actually the outermost according to Hibernate.. > > it seems something else is borked too - when i'm loading the objects, > hibernate first calls the setter to set the proper parent - right after > that it goes and calls the setter with a null... > > i pasted the mapping file below, and two stack traces of the setter being > called... > > > "-//Hibernate/Hibernate Mapping DTD 2.0//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd";> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > stack trace of the call with a valid parent: > at net.sf.flock.hibernate.Item.setOrigin(Item.java:32) > 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 net.sf.hibernate.util.ReflectHelper$Setter.set(ReflectHelper.java:39) > at net.sf.hibernate.type.ComponentType.instantiate(ComponentType.java:211) > at net.sf.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:130) > at net.sf.hibernate.collection.CollectionPersister.readElement(CollectionPersis ter.java:301) > at net.sf.hibernate.collection.Bag.readFrom(Bag.java:87) > at net.sf.hibernate.loader.Loader.doFind(Loader.java:161) > at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:472) > at net.sf.hibernate.loader.CollectionLoader.initialize(CollectionLoader.java:74 ) > at net.sf.hibernate.impl.SessionImpl.initialize(SessionImpl.java:2396) > at net.sf.hibernate.collection.PersistentCollection.getInitialValue(PersistentC ollection.java:102) > at net.sf.hibernate.type.PersistentCollectionType.getCollection(PersistentColle ctionType.java:63) > at net.sf.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentC ollectionType.java:159) > at net.sf.hibernate.type.PersistentCollectionType.nullSafeGet(PersistentCollect ionType.java:48) > at net.sf.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:123) > at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:65) > at net.sf.hibernate.loader.Loader.hydrate(Loader.java:348) > at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:298) > at net.sf.hibernate.loader.Loader.doFind(Loader.java:142) > at net.sf.hibernate.loader.Loader.find(Loader.java:487) > at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:951) > at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1146) > at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1125) > at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1121) > at net.sf.flock.hibernate.HibernateSubscriptionManager.loadSubscription(Hiberna teSubscriptionManager.java:72) > at net.sf.flock.hibernate.HibernateSubscriptionManagerTest.testPersistence(Hibe rnateSubscriptionManagerTest.java:51) > 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 junit.framework.TestCase.runTest(TestCase.java:166) > at junit.framework.TestCase.runBare(TestCase.java:140) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:131) > at junit.framework.TestSuite.runTest(TestSuite.java:173) > at junit.framework.TestSuite.run(TestSuite.java:168) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu nner.java:360) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner. java:246) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner .java:146) > > > and this is when it's calling it with null: > at net.sf.flock.hibernate.Item.setOrigin(Item.java:32) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
Re: [Hibernate] collections (in one-to-many, many-to-one, etc..)
The reason we do it this way is to preserve the semantics that update() *completely* replaces the existing state. Otherwise, there is the potential for another transaction to have come in and added something to the collection. Then after the update() and flush(), the state in memory and the state on disk would not be the same (there would be this extra row). I think that this is not a bad way to do things. (It is slow for very large collections, however). "Max Rydahl Andersen" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> Sent by:cc: [EMAIL PROTECTED] Subject: Re: [Hibernate] collections (in one-to-many, many-to-one, eforge.net etc..) 20/01/03 12:27 AM Ok - that surprises me a little :) I understand that if the collection instance is replaced then hibernate can not have any clue on what to do (or maybe it could load the existing relationship from the db, and do an compare ? Or is this to complex/heavy ?). But I had somewhat expected (silly me :) that if the collection was one of the hibernate'ones then hibernate would "trust" them to be "correct" and tracked. s = sf.createSession(); Cat c = new Cat("Morris"); p.getFriends().add(new Cat("Gustav")); Cat sabrina = new Cat("Sabrina") p.getFriends().add(sabrina); p.getFriends().add(new Cat("Bond")); s.save...(save of c and all its siblings) s.flush(); s.close(); p.getFriends().remove(sabrina); // I had expected that the hibernateSet here would track this removal s = sf.createSession(); // will this result in a delete of all cat-to-friends pairs in the many-to-many table ? // and afterwards result in insertion of the siblings left in the getFriends() set ? s.saveOrUpdate(p); s.flush(); s.close(); And if the friends relationship (many-to-many) would have been children instead (many-to-one), then Gustav, Sabrina and Bond's parent key woud have been nulled (via an update) and then afterwards Gustav and Bond's would be again updated, right ? Does this makes sense :) /max - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 18, 2003 11:36 PM Subject: Re: [Hibernate] collections (in one-to-many, many-to-one, etc..) > > Inside a Session, Hibernate keeps a snapshot of the original state > of a collection and so can do removals/additions individually. > > However, an object that came into the session via a call to update() > may have had all kind of things done to it (a PersistentCollection > completely replaced with a transient Collectin, for example). So we > can't really have been tracking changes. In this case Hibernate > simply removes all the existing rows using a single DELETE or > UPDATE and then recreates the whole collection, based upon the new > state of the object that was passed to update(). > > Think of update() as "trash whatever was there and use this instead". > OTOH, load() followed by flush() means "grab the existing state and > then carefully make any necessary adjustments". > > > > How does Hibernate decide/track how to delete, update, insert tuples based > > on what the user has added and/or removed in the sets/lists representing > > many-to-one and many-to-many mappings ? > > > > (the question just came to my mind when i saw: "P.S. Hibernate is *not* > > tracking which objects were removed from the collection (also a Good > > Thing)." - and I came to think: Ok, but then how does it decide to do a > > delete of something if it does not track deletions :) > > (I g
Re: [Hibernate] hib2 - parent in composite-element
Yeah, don't worry about the call from deepCopy(). I removed that in the latest CVS, since it was unnecessary. It should not have been actually *harmful*, however. "Viktor Szathmary" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: [Hibernate] hib2 - parent in composite-element eforge.net 03/02/03 10:33 AM hi, On Mon, 3 Feb 2003 09:32:39 +1100, [EMAIL PROTECTED] said: > > Are there proxies involved? > hopefully not :) it seems that there's actually two calls to nestedChild.setParent() on the same nestedChild instance - the second one occurs during deepCopy, and blows away the value that was set first... here are the stacktraces (the assertion in the testcase expected the parent to be [EMAIL PROTECTED]): [EMAIL PROTECTED]( [EMAIL PROTECTED] ): at net.sf.flock.hibernate.Item.setOrigin(Item.java:28) at net.sf.flock.hibernate.Feed.setItems(Feed.java:31) 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 net.sf.hibernate.util.ReflectHelper$Setter.set(ReflectHelper.java:39) at net.sf.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:132) at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:64) at net.sf.hibernate.loader.Loader.hydrate(Loader.java:348) at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:298) at net.sf.hibernate.loader.Loader.doFind(Loader.java:142) at net.sf.hibernate.loader.Loader.find(Loader.java:487) at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:951) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1186) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1165) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1161) at net.sf.flock.hibernate.HibernateSubscriptionManager.loadSubscription(HibernateSubscriptionManager.java:72) at net.sf.flock.hibernate.HibernateSubscriptionManagerTest.testPersistence(HibernateSubscriptionManagerTest.java:50) and then... [EMAIL PROTECTED]( [EMAIL PROTECTED] ): at net.sf.flock.hibernate.Item.setOrigin(Item.java:28) at net.sf.flock.hibernate.Feed.setItems(Feed.java:31) 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 net.sf.hibernate.util.ReflectHelper$Setter.set(ReflectHelper.java:39) at net.sf.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:181) at net.sf.hibernate.type.ComponentType.deepCopy(ComponentType.java:204) at net.sf.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:188) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1743) at net.sf.hibernate.loader.Loader.doFind(Loader.java:180) at net.sf.hibernate.loader.Loader.find(Loader.java:487) at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:951) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1186) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1165) at net.sf.hibernate.impl.SessionImpl.fi
Re: [Hibernate] DynaBean components
Its not *runtime* extension to schemas, which I find a troubling concept. Its *deployment* time, which could be useful. Note that previously people have proposed allowing DynaBeans as _entities_. This patch allows them as components. "Max Rydahl Andersen" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> Sent by:cc: [EMAIL PROTECTED] Subject: Re: [Hibernate] DynaBean components eforge.net 20/01/03 12:56 AM Ok - this sounds interesting :) I vaguely remember that someone tried to do this earlier for Hibernate, is this the thing that was done at that time ? I'm curious to what this stuff can be used ... you mention that one can better dynamically extend the schema, as you do not need to modify the classes, I dig that :) Any other Good Thing's about this one ? (One could argue that dynamically extending the schema is a Bad Thing - but I won't - not yet :) /max - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 19, 2003 1:04 PM Subject: [Hibernate] DynaBean components > I added support for DynaBean components to Hibernate2. You can now > use mappings like: > > > . > > > > > > > > > Can people please try this out, to check that I didn't get anything > wrong; I am new to DynaBeans, so I'm not sure I am using it right. > (Like all the Jakarta stuff it is completely underdocumented.) > > What I didn't find was a way to do the equivalent of Class.forName() > to retrieve a DynaClass. So Hibernate and the user code aren't > actually using the same DynaClass instance, which is suboptimal. > > > > > > > --- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is
RE: [Hibernate] Lazy Collections
I had a *really* close look into the possibility that Hibernate issues the unclosed session WARNing when the session has in fact been closed and I've concluded that it doesn't. I am quite certain that the problem is that the user is not closing the sessions. (In a couple of previous complaints about this, that turned out to be the case.) As to the use of finally, cleanup code that *must* be executed is *exactly* the role of the finally block, as per any Java textbook. And it is completely predictable. Method exit cannot occur without execution of the finally block. Are you sure the redbook wasn't talking about finalize(), which *is* unreliable? > -Original Message- > From: Brad Clow [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 3 December 2002 9:01 PM > To: Aapo Laakkonen > Cc: [EMAIL PROTECTED] > Subject: Re: [Hibernate] Lazy Collections > > > > I have also other problems with lazy collections. I get > WARNings about > > Unclosed Sessions (finalize method in SessionImpl). I use > Maverick Web > > MVC Framework and it has discard() method in one interface that you > > can implement. I have put my Session closing code in it, but it > > doesn't help. It continues to leave sessions open. I have > tried almost > > everything, but I cannot get rid of those Unclosed Sessions. Only > > solution I have found is closing session before going to a view > > rendering phase, and that means that lazy initialization is not an > > option anymore. > > on the project i am currently working on we use a servlet > filter to open a connection in a try block and stick the > close connection in a finally block. we r not having any > probs with lazy initialisation or unclosed sessions. however, > we r also not using the absolute latest version of hibernate. > > > Also I see that Hibernate uses a lot of finally {} blocks > to do some > > cleaning. If I understand correctly, at least what I have read from > > some of IBM's whitepapers, they don't recommend you to use > finally {} > > to do a cleaning (mainly they don't recommend to put connection > > closing code in > > it) as it cannot be determined when that block gets called. > I migth be > > u definitely don't want to rely on finally blocks to clean up > connections, sockets, etc. when it can/should be done some > other way. however, aren't they the last line of defence > when u r relying on someone else to clean up > after themselves? for example, only the developer of the > client app knows > when they r finished with a session and therefore when to close it. > > regards > brad > > > > --- > This SF.net email is sponsored by: Get the new Palm Tungsten T > handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > 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 ** --- This SF.net email is sponsored by: Microsoft Visual Studio.NET comprehensive development tool, built to increase your productivity. Try a free online hosted session at: http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Lazy Collections
I agree. Furthermore there are some serious conceptual problems with regards to ensuring transaction isolation and also potential performance problems if a single task required multiple connections to the database. -Original Message- From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] Sent: Tuesday, 3 December 2002 10:59 PM To: Jonas Van Poucke; Hibernate Developers Subject: Re: [Hibernate] Lazy Collections No! If an session has been closed forcefully or by other means, hibernate internals should not reopen the session - at least not per default! If the session has been closed there is a reason for it - one might be to ensure that the ui-layer does not accidently fetches data by "dotting" around in the object graph. If you want the session to be (re)opend - why don't you just keep the session open ? /max - Original Message - From: "Jonas Van Poucke" <[EMAIL PROTECTED]> To: "Hibernate Developers" <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 9:20 AM Subject: [Hibernate] Lazy Collections The implementation of the write() method in cirrus.hibernate.collections.PersistentCollection states: protected final void write() { initialize(true); if ( session!=null && session.isOpen() ) session.dirty(this); } This means the session needs to be open. Also, the Docs mentions that lazy collections need to have an open session. Could we safely modify the code to reopen the session when needed? protected final void write() { initialize(true); if ( session != null ) { if ( session.isOpen() ) { session.dirty(this); } else { // Re-open session session.reopen(); // ommitted try-catch session.dirty(this); } } } *** Hou uw internetverbruik beter onder controle ... surf met Tiscali Complete http://tiscali.complete.be --- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en ___ hibernate-devel mailing list [EMAIL PROTECTED] 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 ** --- This SF.net email is sponsored by: Microsoft Visual Studio.NET comprehensive development tool, built to increase your productivity. Try a free online hosted session at: http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Lazy Collections
Where are connections coming from? A Hibernate ConnectionProvider? Or an application supplied connection? What guarantees does Maverick make about when / wether discard() will be called? Is it *guaranteed* to be called in the case of an exception, etc? > -Original Message- > From: Aapo Laakkonen [mailto:[EMAIL PROTECTED] > Sent: Thursday, 5 December 2002 12:35 AM > To: [EMAIL PROTECTED] > Subject: FW: [Hibernate] Lazy Collections > > > > I had a *really* close look into the possibility > > that Hibernate issues the unclosed session WARNing > > when the session has in fact been closed and I've > > concluded that it doesn't. I am quite certain that > > the problem is that the user is not closing the > > sessions. (In a couple of previous complaints about > > this, that turned out to be the case.) > > Ok it might be my fault (and probably is). Do you see any strange in > this: > > Background: > > - I have extended Maveric Dispatcher so that it loads > Hibernate Session Factory from JNDI and places it in servlet > context. Is that proper thing to do? > - I have abstract controller that every of my maverick > commands extends. > - Abstract controller has 2 methods. getSession() that loads > Session factory from Servlet context and then opens a new > session (if user has already called this.getSession, then it > returns previously opened > session) and places it in class level variable and then > returns it to user. > - User then uses session. > - User does not close session. > - Session is closed in Abstract controller's discard() method > that maverick calls automatically after it has served the > client (e.g. gui is generated). > > The proces goes like this: > > 1. User makes request eg. grid.m that is a maveric command. > 2. Maverick initializes NEW controller (the controller > extends abstract > controller) 3. Then maverick calls execute method. 4. execute > method calls this.getSession.find("whatever") <- lazy > collection 5. execute method returns a string (that is the > view to be rended) 6. Maverick generates a view (view uses > lazy collection) 7. Maverick calls discard (that closes a session) > > The generated HTML (in this case) contains many img tags like this > > > > So every needed image gets loaded throught Maverick from > database. image.m command opens session as above and after > sending raw data with proper content-type session get's > closed in execute method (Maveric calls discard, but it > doesn't do anything cause session is already closed by > execute command). > > The problem is that I have no idea why Hibernate's > SessionImpl finalize method tries to close connections that I > have already closed (I can output proper log messages when > discard is called). What I have found is that if I don't > close connections in execute method (prior view), then I > sometimes leaves connections open. At least on load testing. > If I don't use lazy collections I do not have this problem. > > > As to the use of finally, cleanup code that *must* > > be executed is *exactly* the role of the finally > > block, as per any Java textbook. And it is > > completely predictable. Method exit cannot occur > > without execution of the finally block. Are you > > sure the redbook wasn't talking about finalize(), > > which *is* unreliable? > > It's quite long time when I read that, and I could have read > it wrong (I checked IBM docs and they all used finally)... > and if I think about it, I agree with you. The errors I get > about unclosed connections, I get them from SessionImpl > finalize(). But problem is not there I think. > > Is it proper to place SessionFactory in servlet context, or > should I always retrieve it from JNDI? I think that JNDI > lookup causes some overhead, so I have put the Session > factory in servlet context. > > When I should use Session.disconnect / reconnect instead open > and close? > > Should I set session to null and should I also check if > session.close returns an open connection? Do I need to close > the connection then manually? Do i need to set connection = null? > > Kind Regards > Aapo ungle Laakkonen > > > > --- > This SF.net email is sponsored by: Microsoft Visual Studio.NET > comprehensive development tool, built to increase your > productivity. Try a free online hosted session at: http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en ___ hibernate-devel mailing list [EMAIL PROTECTED] 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
RE: [Hibernate] Lazy Collections
Comments inline > 04:18:56,649 WARN > [JTATransactionFactory] No TransactionManagerLookup configured > (use of JCS read-write cache is not > recommended) > > What is this setting. I get that warning even if I don't use JCS. > > This is my hibernate.properties: > > hibernate.use_outer_join=true > hibernate.show_sql=false > hibernate.jdbc.batch_size=10 > hibernate.statement_cache.size=20 > hibernate.transaction.factory_class=cirrus.hibernate.transacti > on.JTATran > sactionFactory > hibernate.transaction.manager_class=cirrus.hibernate.transacti > on.JNDITra > nsactionManagerLookup > hibernate.query.substitutions yes 'Y', no 'N' > jta.UserTransaction=java:comp/UserTransaction > There was a doco bug that was reported and fixed only recently. (My fault.) The property should be hibernate.transaction.manager_lookup_class But JNDITransactionManagerLookup is not a valid value. You must choose the correct strategy for your application server. Otherwise I don't recommend use of usage="read-write" JCS caching. > Another warning I get with Resin is: > > 04:18:57,258 WARN > [SessionFactoryObjectFactory] InitialContext did not > implement EventContext > > Should I care about it? Nah, don't worry about that one ** 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: Microsoft Visual Studio.NET comprehensive development tool, built to increase your productivity. Try a free online hosted session at: http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Lazy Collections
Cool. You beat me to it. Thanks for the Resin-specific code - I will integrate it as soon as I get to a PC with CVS access (I've been unable to do anything the past few days.) > -Original Message- > From: Aapo Laakkonen [mailto:[EMAIL PROTECTED] > Sent: Thursday, 5 December 2002 2:06 AM > To: [EMAIL PROTECTED] > Subject: RE: [Hibernate] Lazy Collections > > > > 04:18:56,649 WARN > > [JTATransactionFactory] No TransactionManagerLookup configured > > (use of JCS read-write cache is not > recommended) > > Ok there is error in documentation (it's not > hibernate.transaction.manager_class). > > This works: > hibernate.transaction.manager_lookup_class=cirrus.hibernate.tr > ansaction. > ResinTransactionManagerLookup > > > Now it works fine! Great work! Definately the best O/R tool. > > > --- code --- > > Here is code for ResinTransactionManagerLookup class: > > package cirrus.hibernate.transaction; > > public final class ResinTransactionManagerLookup extends > JNDITransactionManagerLookup { > > /** >* @see > cirrus.hibernate.transaction.JNDITransactionManagerLookup#getName() >*/ > protected String getName() { > return "java:comp/TransactionManager"; > } > > } > > --- code --- > ** 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: Microsoft Visual Studio.NET comprehensive development tool, built to increase your productivity. Try a free online hosted session at: http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] saving to pgsql
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:[EMAIL PROTECTED] > Sent: Friday, 3 January 2003 2:40 PM > To: [EMAIL PROTECTED] > 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: > > table="CommentTable" discriminator-value="Comment"> > > >class="cirrus.hibernate.id.HiLoGenerator"> > uid_table > next_hi_value_column > > > > > > > > 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 [EMAIL PROTECTED] > 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 ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Using CLOBs
> it *mostly* works. The only problem seems to be > that Oracle > apparently does not distinguish between zero-length strings > and NULL, so I have run into this before with Oracle. Very yucky. > 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. 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 > really necessary to open a new session. Couldn't we somehow reuse the > 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 ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Hibernate 2
> * Rename the 'role' attribute to 'name' in all collection > elements in the new DTD, for consistency with , >and 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 > 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. Lets make this change also (for consistency). Max, I don't see much value in making this configurable. We don't want to spawn 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 ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Re: PersistentEnum Problem
Stack Trace? --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Hibernate usage question
Check out the "open session in view" pattern for these kind of simple applications. The basic idea is to use a servlet filter to open and close sessions. Chris Conrad <[EMAIL PROTECTED]>To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] Hibernate usage question eforge.net 11/02/03 11:54 AM After reading the Hibernate documentation and contributed documentation, I have not seen any advice on how to best utilize Hibernate for this application. I'm currently working on a community based collaboration web application. The architecture is fairly basic, an MVC framework (probably Struts) for the web tier, local stateless session beans for the business tier and hibernate for the persistence layer. The problem I've run across is this application has many entities which are inter-related in a potentially large object graph. For example, a User is associated with 1 or more Communities. Each Community is associated with 1 or more Conversations. Each Conversation can have any number of Threads, etc. My question is, what is the best way to manage a large object graph like this? The first thought I had was to use lazy loading and proxies, but since the session is already closed by the time the data gets to the web tier, that doesn't work. The Lightweight Class pattern seems to partially solve the problem but leaves two issues unresolved: 1. It will require a large number of Lightweight Classes to avoid retrieving unnecessary data from the database. For example, the basic user information will be stored in the HttpSession. To get the Communities related to it, an object mapped just to the user's Communities relationship will be necessary. To get the Tasks assigned to them, an object mapped just to the users Tasks relationship will be necessary. Using a heavy weight class with proxies and lazy loading allows for only 1 object to be used, but then all of the data already stored in the user's session will be fetched as well, adding an extra query (1 query for the data I already have, 1 query to lazy load the data I actually want). 2. There doesn't appear to be any way to manage creating new relationships without at least 1 extra query. If I want to add a Conversation to a Community, I'll need to load the Community (at least 1 query, 2 if using lazy loading) and then add the Conversation to the Community (a second query to update the join table). Unfortunately, I've been unable to find any documentation or examples that deal with a large object graph but are unable to use lazy loading and proxies because of the EJB layer. I'd be very grateful for any pointers to docs or examples that solve this problem. I'm sure I'm going about it from the complete wrong direction which is why I'm running into this issue in the first place. --Chris --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privi
RE: [Hibernate] Hibernate Thread Local Session and JUnit
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:[EMAIL PROTECTED] > Sent: Friday, 3 January 2003 5:03 PM > To: [EMAIL PROTECTED] > Subject: RE: [Hibernate] Hibernate Thread Local Session and JUnit > > > 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: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > > Behalf Of Gavin King > > Sent: Thursday, January 02, 2003 7:47 PM > > To: Matt Raible; [EMAIL PROTECTED] > > 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 [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Normalized table mappings
Oh yeah, I expect this. MultiTableEntityPersister does some SQL generation itself thats not (yet) aware of Oracle-style outerjoins. Just do a search for "left outer join". This generated SQL is probably not being used if outerjoin fetching is enabled. I just noticed that currently MultiTableEntityPersister doesn't support loadWithLock(). So I guess thats also on the TODO list. - Original Message - From: "Wolfgang Jung" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Cc: "hibernate list" <[EMAIL PROTECTED]> Sent: Thursday, November 07, 2002 2:03 AM Subject: Re: [Hibernate] Normalized table mappings > On Wednesday 06 November 2002 15:19, Gavin King wrote: > > > Currently I have another problem with the OuterJoinGenerator: > > > The SQL created by the constructor of EntityLoader is always using ' LEFT > > > OUTER JOIN' > > > > > even if I use the OracleOuterJoinGenerator. I've added the a log > > > statement in the constructor > > > > > and it tells me that the sql 'select from foo left outer join bar on > > >' was created withan OracleOuterJoinGenerator???!!!? > > > > I'm not following properly. > > > > MultiTableEntityPersister produces some SQL with "left outer join" > > hardcoded, as you noted. Some refactoring is needed to fix this. But I'm > > pretty sure the SQL generation for outerjoin fetching never produces "LEFT > > OUTER JOIN" when the SQL dialect is set for Oracle. Surely you aren't > > seeing this when using EntityPersister? > > I've added the following logging code to the constructor of EntityLoader: > log.info("Built select=" + sql + " via " > + outerJoinGenerator.getClass().getName()); > > and get the following while running MultiTableTest: > > [junit] Nov 6, 2002 3:56:24 PM cirrus.hibernate.sql.Dialect > [junit] INFO: Using dialect: cirrus.hibernate.sql.OracleDialect > > [junit] Nov 6, 2002 3:56:24 PM cirrus.hibernate.loader.OuterJoinLoader > > [junit] INFO: Using JoinGenerator > cirrus.hibernate.loader.OracleOuterJoinGenerator > [junit] Nov 6, 2002 3:56:24 PM cirrus.hibernate.loader.EntityLoader > [junit] INFO: Built select=SELECT rootc0.id_ AS id_, rootc01.amount as > amount10, rootc02.extraProp as extraProp8, rootc02.other2 as other29, > rootc0.count_ as count_0, rootc0.name as name1, rootc0.address as address2, > rootc0.date_ as date_3 FROM rootclass rootc0 left outer join submulti > rootc01 on rootc0.id_=rootc01.sid left outer join nuthasubclass rootc02 on > rootc0.id_=rootc02.sid WHERE rootc0.id_ = ? via > cirrus.hibernate.loader.OracleOuterJoinGenerator > [junit] Nov 6, 2002 3:56:24 PM > cirrus.hibernate.persister.MultiTableEntityPersister generateSelectString > [junit] INFO: Using select=select rootclass.id_, submulti.amount as > amount10, nuthasubclass.extraProp as extraProp8, nuthasubclass.other2 as > other29, rootclass.count_ as count_0, rootclass.name as name1, > rootclass.address as address2, rootclass.date_ as date_3 from rootclass, > submulti, nuthasubclass where rootclass.id_ = ? and > rootclass.id_=submulti.sid (+) and rootclass.id_=nuthasubclass.sid (+) > . > > Maybe the SQL-code from EntityLoader is never reached, but I have no clue, > where the sql-String from EntityLoader is comming from. > > > CU > -- > Wolfgang Jung, Softwareentwickler > Micromata_Objects GmbH Tel: +49 561 316793-0 > Marie-Calm Strasse 1, D-34131 Kassel Fax: +49 561 316793-11 > mailto:[EMAIL PROTECTED] http://www.micromata.de --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Looking for Volunteers
I'm pre-warning you that this will be a bit involved, Jon - and you will probably have to change the Loadable interface, refactoring some stuff thats currently done in the Loader hierarchy onto the EntityPersister classes. I don't have an existing testcase, but if you add a many-to-one association to some class in Multi.hbm.xml, that will be enough. MultiTableEntityPersister implements table-per-subclass persistence. EntityPersister implements the old-style persistence. Currently MultiTableEntityPersister is a valid implementation of operations from ClassPersister and Queryable but *not* of all operations defined on Loadable. ie. MultiTableEntityPersister defines the operations needed by SimpleEntityLoader but not by OuterJoinLoader. At the moment, I am generating SQL along the lines of: select t.id as id1, t.clazz as clazz1, t.prop as prop1, t1.subprop as subprop1 from roottable t left outer join subtable t1 on t.id = t1.id for the _query_ stuff. That will have to change in a couple of ways: (1) it doesn't handle the case of two columns with the same name in different tables (2) it shouldnt always be an outerjoin really sometimes it should be just a join but thats enough to get us started. Baby steps. So if you generate something similar for outerjoin loading, we will be in business. P.S. I just noticed that because MultiTableEntityPersister doesn't support outerjoin loading, it also can't be loaded by CollectionLoader or EntityLoader. So this is an important thing to finish. - Original Message - From: "Jon Lipsky" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Sent: Friday, October 11, 2002 4:34 PM Subject: Re: [Hibernate] Looking for Volunteers > Hi Gavin, > > Not a problem. If you can point me to a valid test case for this, I'd be > more than willing to make sure the outer join fetching works. > > Jon... > > > - Original Message - > From: "Gavin King" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, October 09, 2002 6:56 PM > Subject: [Hibernate] Looking for Volunteers > > > > Okay, I finally have something concrete for normalized > (table-per-subclass) > > mappings. I went down a couple of wrong paths before I decided on the best > > approach (a completely new implementation of ClassPersister). > > > > I can save/load/update/delete instances already. > > > > We need (in order of importance): > > > > * SchemaExport support (and proper support in the mapping document) > > * Query language integration (the hard bit) > > * Support for outerjoin fetching > > * Support for versioning (easy) > > * support for native id-generation (not very hard) > > > > If anyone wants to help out with any of these problems, I would very much > > appreciate it. > > > > ( In particular, since Jon Lipsky understands the outerjoin fetching code, > > maybe he would have a look at that stuff? ) > > > > I'm perhaps being slightly over-eager here, since I still need to rework > the > > map package part of this; what I've got there now is kludge. But I will do > > that (and finish it) tomorrow. When I do that, it will knock the top item > > off the list by side-effect and make the other items doable. > > > > Anyway, if anyone can spare the time, please stick your hand up and I will > > point in right direction > > > > Gavin > > > > > > > > --- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > ___ > > hibernate-devel mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] DeathMarch Error Message
How disconcerting. The exception is being thrown by the JDBC driver and is most likely something to do with connection pooling. Looks like you should disable C3P0's prepared statement cache. (Or try some other connection pool implementation...) Melonie Brown <[EMAIL PROTECTED]>To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] DeathMarch Error Message eforge.net 05/02/03 06:55 AM I'm new to Hibernate and am getting a strange error when saving an object to the database. The save is happening, but an error of "java.lang.RuntimeException: Internal inconsistency: A (not new) checking-out statement is not in deathmarch." is alarming. Do I need to worry about it? Log follows: 14:35:48,774 INFO DatastoreImpl:137 - Mapping resource: foo/bar.hbm.xml 14:35:48,794 INFO XMLHelper:34 - Parsing XML: unknown system id 14:35:48,814 DEBUG DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd in classpath under cirrus/hibernate/ 14:35:48,824 DEBUG DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd in classpath 14:35:49,064 DEBUG Root:136 - Root class: foo.bar -> FOOOBAR 14:35:49,114 INFO Environment:270 - Hibernate 1.2.3 14:35:49,114 INFO Environment:303 - loaded properties from resource hibernate.properties 14:35:49,124 WARN Environment:264 - Usage of obsolete property: hibernate.use_jdbc_batch no longer supported, use: hibernate.jdbc.batch_size 14:35:49,124 INFO Environment:326 - JVM proxy support: true 14:35:49,124 DEBUG SessionFactoryImpl:116 - Instantiating session factory 14:35:49,144 INFO Dialect:37 - Using dialect: cirrus.hibernate.sql.OracleDialect 14:35:49,174 INFO C3P0ConnectionProvider:64 - C3P0 using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@111.11.11.111::MACHINENAME 14:35:49,174 INFO C3P0ConnectionProvider:65 - Connection properties: {user=FOO, password=BAR} 14:35:49,264 INFO SessionFactoryImpl:147 - Use outer join fetching: true 14:35:50,316 INFO SessionFactoryImpl:170 - Use scrollable result sets: true 14:35:50,316 INFO SessionFactoryImpl:171 - JDBC 2 max batch size: 15 14:35:50,756 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory 14:35:50,756 DEBUG SessionFactoryObjectFactory:76 - registered: 2008a044f32a564100f32a5648da (unnamed) 14:35:50,756 INFO SessionFactoryObjectFactory:82 - no JDNI name configured 14:35:50,766 INFO SessionFactoryImpl:264 - Query language substitutions: {} 14:35:50,766 DEBUG SessionFactoryImpl:279 - Instantiated session factory 14:35:50,816 DEBUG SessionImpl:334 - opened session 14:35:50,816 DEBUG SessionImpl:523 - saving [foo.bar#2008a044f32a564100f32a564921] 14:35:50,827 DEBUG SessionImpl:1616 - flushing session 14:35:50,837 DEBUG SessionImpl:1693 - Flushing entities and processing referenced collections 14:35:50,837 DEBUG SessionImpl:1885 - Processing unreferenced collections 14:35:50,837 DEBUG SessionImpl:1909 - Scheduling collection removes/(re)creates/updates 14:35:50,847 DEBUG SessionImpl:1628 - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects 14:35:50,847 DEBUG SessionImpl:1633 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections 14:35:50,847 DEBUG SessionImpl:1663 - Executing 14:35:50,847 DEBUG EntityPersister:466 - Inserting entity: foo.bar#2008a044f32a564100f32a564921 14:35:50,847 DEBUG BatcherImpl:109 - 1 open PreparedStatements 14:35:50,847 DEBUG SessionFactoryImpl:472 - prepared statement get: insert into DATABASE.TABLE ( FIELD, FIELD, FIELD, FIELD, FIELD, FIELD, FIELD ) values ( ?, ?, ?, ?, ?, ?, ? ) 14:35:50,847 DEBUG SessionFactoryImpl:482 - preparing statement 14:35:50,927 D
Re: [Hibernate] Metadata, codegenerator et.al...
Unfortunately, the parsing code sucks. It sucks because (a) it was written to "do the job", not be elegant (b) it uses DOM (c) there are a lot of places where things are implied by a combination of the mapping file and the class itself We could fix (b) by chucking the whole .map package and re-doing it using some databinding fwk. I'm not sure whats the best for databinding currently though. I would actually very much like to do this, to get rid of ugly code. However, currently the design of the map package has not been a problem for _me_ in the functionality I've been concentrating upon. (c) is more difficult since it means that plenty of perfectly legitimate mapping files can't be fully compiled without the classes. However, if we chucked + re-did with databinding, we would need a second-pass to fill in reflected values *anyway*, so maybe there is also a way forward there. Now, if it turns out to be worthwhile doing this, there is one thing working in our favor. We have heaps of unit tests, so we shouldn't need to be worried about breaking things. - Original Message - From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Sent: Monday, October 28, 2002 1:33 AM Subject: Re: [Hibernate] Metadata, codegenerator et.al... > > > Any suggestions on formats/semantics of it all ? (property and attribute > > are > > > dubious names in > > > this db context, so is custom-attribute a good tag-name/metadata name > for > > > it ?) > > > > How about > > So, we got a metadata to augment/describe the metadata - well, I suppose > that's the > way it is supposed to be :) > > > > I would love to contribute the above mentioned stuff, if I had a clear > > > vision on the existing parsing and building > > > of metadata info in Hibernateand currently it seems that Hibernate > > > CANNOT parse an hbm.xml without > > > having the related classes in its classpath ...and that is somewhat of > an > > > limitiation when it is a codegenerator that > > > is about to generate these classes :) > > > > Good point. > > > > > Anyone with a clear vision and understanding of hibernates hbm.xml > parsing > > > that can untangle that web of assumptions > > > in the hibernate core ? > > > > Okay, there are two levels of metadata. The "parsed" metadata, represented > > by the cirrus.hibernate.map package and the "compiled" metadata which is > > really just the internal state of the EntityPersisters. > > > > You have no chance of using the compiled metadata. On the other hand, it > > would be reasonably easy to remove any references to actual classes from > the > > cirrus.hibernate.map package which is used to represent the internal state > > of Datastore. If you could clean up that package a little bit, it would > > probably do what you want. Now, that package is definately not meant to be > > exposed to users, but you might be able to expose it to the toolset. > > I've tried to dig into the map package, but it seems there is waaay to many > places > the code tries to do a classForName to check if it can continue to do its > parsing - > and by waaay to many, I mean waaay to many for me to go changing the parse > semantics :( > > So, I'll try to "just" add the metadata tag stuff...that should be doable > without changing much > of the semantics, but it sure won't be as usable when the parser still > requires the classes to > be available ;( > > /max --- This SF.net email is sponsored by: ApacheCon, November 18-21 in Las Vegas (supported by COMDEX), the only Apache event to be fully supported by the ASF. http://www.apachecon.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Re: Jmx error in 1.1.5
Yick! Sorry, I actually wasn't fully aware of this bug. Are you suggesting the problem is here: public void setMapResources(String mappingResources) { this.mapResources = mapResources.trim(); } if so, why exactly is setMapResources() being called with a null argument. I'm confused - Original Message - From: "Andrea Aime" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Sent: Sunday, October 20, 2002 1:43 AM Subject: Jmx error in 1.1.5 > Hi Gavin, > the error in cirrus/hibernate/jmx/HibernateService.java (setMapResources.java) > that prevents the use of Hibernate as a jmx service is still there in 1.1.5, > thought it was corrected in cvs some time ago... this is particularly > frustrating since someone trying to deploy hibernate as a service will only > see a nullPointerException again and again (and wondering what he did > wrong...). Hope you can fix it and put out a 1.1.5b... > Best regards > Andrea Aime --- This sf.net email is sponsored by: Access Your PC Securely with GoToMyPC. Try Free Now https://www.gotomypc.com/s/OSND/DD ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Odd Query behavior
I've already fixed this on my local machine its just a matter of calling ps.setFecthSize(0); ps.setMaxRows(0); when re-caching the PreparedStatement. I'll commit this to CVS tonight, hopefully Ken Robinson <[EMAIL PROTECTED]> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>, Ken Sent by: Robinson <[EMAIL PROTECTED]> [EMAIL PROTECTED] cc: "Hibernate developer list (E-mail)" eforge.net <[EMAIL PROTECTED]> Subject: RE: [Hibernate] Odd Query behavior 19/02/03 10:10 AM Rather than disabling PS caching entirely, we've got this workaround when we want to (rarely) see all values. query.setFirstResult(0); query.setMaxResults(Integer.MAX_VALUE); I'll submit a bug report now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 18, 2003 3:58 PM To: Ken Robinson Cc: Hibernate developer list (E-mail) Subject: Re: [Hibernate] Odd Query behavior Yick! You are probably right. PreparedStatement must retain the value of setMaxRows(). I had kinda assumed it only applied for the very next executeQuery() method, but probably not. Thats a VERY nasty bug. Would you submit a bug report please? (Workaround is to disable Hibernate PreparedStatement caching.) Ken Robinson <[EMAIL PROTECTED]> To: "Hibernate developer list (E-mail)" Sent by: <[EMAIL PROTECTED]> [EMAIL PROTECTED] cc: eforge.net Subject: [Hibernate] Odd Query behavior 19/02/03 08:18 AM Hi all, We're noticing some strange behavior with Query.setFirstResult/Query.setMaxResults. If we execute a query with these values set, we get the expected result. However, if we then execute the same query (in a new session, with a new Query) without limiting the resultset, we still only get the limited resultset. Example: query1 = "select x from x in class X" query1.setFirstResult(0); query1.setMaxResults(20); query1.list() //returns the 20 results we expect then in a new session, we create a new Query object which just happens to have the same HQL. query2 = "select x from x in class X" query2.list() //still only returns 20 rows. Is there some sort of caching going on of the first/max values, or does the PreparedStatement cache think this is the same query, or is there something else going on here? Thanks, Ken --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-de
Re: [Hibernate] Hibernate documentation
Fixed :) - Original Message - From: "Fay, Kevin J, ALBAS" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 24, 2002 6:44 AM Subject: [Hibernate] Hibernate documentation > I'm attempting to download the Hibernate reference documentation .pdf file and it says "The file is damaged and couldn't be repaired". The URL is. > > http://hibernate.sourceforge.net/reference/pdf/hibernate_reference.pdf > > If you could fix this that would be great as I am quickly moving to integrate Hibernate into our application. > > Thanks, > Kevin Fay > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Enum
If you write a JakartaEnumType, I will integrate it into the next version. Shouldn't be too difficult. Gavin - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, October 06, 2002 5:35 AM Subject: [Hibernate] Enum > hi, > > would it be feasible to migrate to using the Enum classes from jakarta > (lang commons)? in the long run, i think it would greatly reduce the need > to create adapter classes for these... > > best regards, > viktor > > -- > > [EMAIL PROTECTED] > > -- > http://fastmail.fm - Email service worth paying for. Try it for free > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Dirty checking and int/boolean arrays
I was just having a look over the source of BitSet. It doesn't seem to me that it would be more performant than a simple boolean[]. (It would probably consume less _memory_, but that doesn't seem to be a very critical issue here.) Juozas, why do you expect there to be a performance gain from using BitSet? --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] patch to cirrus.hibernate.jmx.HibernateService
Put it in the patch manager if you like THanks Gavin - Original Message - From: "Chris Winters" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 01, 2002 12:42 PM Subject: [Hibernate] patch to cirrus.hibernate.jmx.HibernateService > I have a patch to cirrus.hibernate.jmx.HibernateService to make > subclassing easier. (In particular, it just changes all references to > the mapping resources to method calls rather than direct variable > accesses so that a subclass can define a different way to get the > mapping files.) > > Should I submit it to the Sourceforge patch manager, the mailing list, > or...? > > Thanks, > > Chris > > -- > Chris Winters ([EMAIL PROTECTED]) > Java Developer > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] 1.1 final is up
Enjoy! --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: RE: [Hibernate] CodeGenerator in Hibernate2
Yeah, I'm not sure. I havn't had time to look at the code myself, and no response from Max.. is he on holiday or something? otisg <[EMAIL PROTECTED]> Sent by:To: [EMAIL PROTECTED] [EMAIL PROTECTED] cc: eforge.net Subject: Re: RE: [Hibernate] CodeGenerator in Hibernate2 31/01/03 05:04 AM Please respond to otisg I agree 100%, and I'm puzzled by this. I posted about that in the Forum on SF, asking the same questions. Cf. http://sourceforge.net/forum/forum.php?thread_id=802051&forum_id=128638 No answers yetam I missing something here? Thanks, Otis On Thu, 30 Jan 2003, Aapo Laakkonen ([EMAIL PROTECTED]) wrote: > Ok, I see that the BasicRenderer seems to want some parameter and it > defaults to private, which is insane, I think (should default to > public). > > > > --- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] multiple beans in one table
I think Benoit Menendez' patch fixed that. > -Original Message- > From: cheeser [mailto:[EMAIL PROTECTED] > Sent: Sunday, 22 December 2002 5:20 AM > To: [EMAIL PROTECTED] > Subject: Re: [Hibernate] multiple beans in one table > > > Sorry I was in a bit of a hurry when writing that. In the > 1.2 hibernate > didn't support generating schemas where multiple beans lived > in one table. > It would generate a create table for each bean resulting in > multiple create > tables for some tables. It looks like CVS has resolved this. > > On Friday 20 December 2002 04:00 pm, Gavin King wrote: > > Sorry, I don't know quite what you're referring to. > > > > > -Original Message- > > > From: cheeser [mailto:[EMAIL PROTECTED] > > > Sent: Saturday, 21 December 2002 5:56 AM > > > To: [EMAIL PROTECTED] > > > Subject: [Hibernate] multiple beans in one table > > > > > > > > > Was this fixed since 1.2? I was just about to submit a > patch, but > > > it looks like it's already been done. > > > > > > > > > --- > > > This SF.NET email is sponsored by: The Best Geek Holiday Gifts! > > > Time is running out! Thinkgeek.com has the coolest gifts for > > > your favorite geek. Let your fingers do the typing. Visit Now. > > > T H I N K G E E K . C O Mhttp://www.thinkgeek.com/sf/ > > > ___ > > > hibernate-devel mailing list [EMAIL PROTECTED] > > > 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 ** > > > > --- > This SF.NET email is sponsored by: Order your Holiday Geek > Presents Now! Green Lasers, Hip Geek T-Shirts, Remote Control > Tanks, Caffeinated Soap, MP3 Players, XBox Games, Flying > Saucers, WebCams, Smart Putty. > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- This SF.NET email is sponsored by: Order your Holiday Geek Presents Now! Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap, MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Road Map
I agree with this. It is the resposibility of the middle tier to fetch data. If it did not fulfil its part of the contract, we can't just have the web tier suddenly open connections to the database. That has all *kinds* of security implications. > I can't see any other decent way - the View layer should not > just assume it got the whole object model available to it... ** 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: Order your Holiday Geek Presents Now! Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap, MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Problem with Connection Pool Timeouts
RE: [Hibernate] 2 Hibernate questions
> 1. Does Hibernate allow for fine tuning lazy > vs. non-lazy loading? That is, can I > specify when to uze lazy loading and when > not to use lazy loading? You can specify loading strategy per-association. There is no support for "fetch profiles" currently. > 2. Does Hibernate allow me to override it > and specify my own SQL statements in places > where I want to use specific SQL statements? > I know I can always choose not to use > Hibernate in specific portions of my > application, but if I am okay with most DB > accesses going through Hibernate, and have > only very few exceptions, I'd rather specify > the exact SQL to use via Hibername, instead > of using my own 'direct to RDBMS access' > code in parallel. Heh this is one of those things that should have been done ages ago but simply never made it to the top of the todo list. I think its something that everyone new to Hibernate assumes that they will need more often than they actually *do* end up needing it. (As you say, there is always the fallback to direct JDBC when really necessary.) Anyway, this is not at all difficult to implement and I *will* get onto it eventually. ** 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: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Calling Prepared Statements
Yup. session.connection().prepareStatement("yada yada") > -Original Message- > From: Raible, Matt [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 8 January 2003 6:17 AM > To: '[EMAIL PROTECTED]' > Subject: [Hibernate] Calling Prepared Statements > > > I'm guessing the best way to call prepared statements is with > JDBC, rather than Hibernate. Correct? > > Thanks, > > Matt > > > > --- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something > 2 See! http://www.vasoftware.com > ___ > hibernate-devel mailing list [EMAIL PROTECTED] > 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 ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] composite-id still doesn't work for me...
Of course! Its a FAQ item that assigned ids including composite ids can't distinguish between a saved or unsaved object (you have a choice between "always update" or "always insert"). So if you want to add a new child (with unsaved-value="none"), simply save () it manually first: child.setParent(parent); parent.addChild(child); session.save(child); session.update(parent); None of these things are issues if you use synthetic ids, as is best practice for all sorts of other reasons (see Scott Ambler's paper). "Raible, Matt" <[EMAIL PROTECTED]> To: "'[EMAIL PROTECTED]'" Sent by: <[EMAIL PROTECTED]> [EMAIL PROTECTED] cc: eforge.net Subject: [Hibernate] composite-id still doesn't work for me... 23/01/03 05:10 AM I just did a fresh checkout from CVS and updated my hibernate version. I can still retrieve data (and children) just fine, but not save it. I noticed now that 's "unsaved-value" only allows "any" and "none" - however, neither of these work for me: results in: [junit] WARN [main] JDBCExceptionReporter.logExceptions(35) | SQL Error: 1407, SQLState: 72000 [junit] ERROR [main] JDBCExceptionReporter.logExceptions(42) | ORA-01407: cannot update ("CCTADM IN"."CMCF_MPS"."CCR_ID") to NULL If I set unsaved-value="any", then I get: [junit] WARN [main] JDBCExceptionReporter.logExceptions(35) | SQL Error: 1, SQLState: 23000 [junit] ERROR [main] JDBCExceptionReporter.logExceptions(42) | ORA-1: unique constraint (CCT ADMIN.CMCF_MPS_PK) violated My mapping to this class is: I guess I'll remove my "bag" mappings and populate my child object manually as this obviously isn't working for me ;-) Thanks, Matt --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Bug in CharacterType...
Woops yeah, I fixed it myself ... didn't get notified of the patch. - Original Message - From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, October 25, 2002 9:54 PM Subject: Re: [Hibernate] Bug in CharacterType... > hehe - I asked on this list BECAUSE it was in the first CVS revision and > had not changed since then - so I was not really sure if it was intentional > or not :) > > But now its fixed and my generic browser works again :) (note: I have also > submitted a patch - so if > you have checked something in, please update the patch tracking too :) > > /max > > p.s. looking forward to the prize :) > > - Original Message - > From: "Gavin King" <[EMAIL PROTECTED]> > To: "Max Rydahl Andersen" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Friday, October 25, 2002 1:48 PM > Subject: Re: [Hibernate] Bug in CharacterType... > > > > Wow, what an absolutely ancient bug!! Its in the very first CVS revision. > > Easy to see how it could slip through, though. I doubt many people have > > properties of type java.lang.Character > > > > You get some kind of prize for that. > > > > - Original Message - > > From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, October 25, 2002 7:17 PM > > Subject: [Hibernate] Bug in CharacterType... > > > > > > > Hi! > > > > > > The following code is found in CharacterType: > > > public Object get(ResultSet rs, String name) throws SQLException { > > > > > > return new Character(rs.getString(name).charAt(0)); > > > > > > } > > > > > > > > > > > > Shouldn't this be something like the following to avoid a possible null > > > value ?!: > > > > > > public Object get(ResultSet rs, String name) throws SQLException { > > > > > > String s = rs.getString(name); > > > > > > if(s!=null) { > > > > > > return new Character(s.charAt(0)); > > > > > > } else { > > > > > > return null; > > > > > > } > > > > > > } > > > > > > > > > > > > > > > > > > > > > --- > > > This sf.net email is sponsored by: Influence the future > > > of Java(TM) technology. Join the Java Community > > > Process(SM) (JCP(SM)) program now. > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > > > ___ > > > hibernate-devel mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > --- This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] writing the properties of a persistent object to a string
I prefer Anton's suggestion. There used to be a method like this on the session interface A Long Time Ago but I got rid of it because I didn't think it had anything to do with persistence. On the other hand, sessionFactory.openDatabinder().toXML(foo); does a really nice job of printing an object. - Original Message - From: "Anton van Straaten" <[EMAIL PROTECTED]> To: "Brad Clow" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 8:40 AM Subject: RE: [Hibernate] writing the properties of a persistent object to a string > I would find this useful. I rely on toString quite a bit. > > I assume that printToString could be added somewhere else, but would then > require a session object as a parameter? Or would that be very unnatural? > Design niceties aside, that would work fine for me. Would adding it to the > Hibernate class be any better from a reduced-interface-clutter perspective? > > Anton > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Brad Clow > Sent: Tuesday, October 01, 2002 5:43 PM > To: [EMAIL PROTECTED] > Subject: [Hibernate] writing the properties of a persistent object to a > string > > > i often add a toString method (that prints out the values of all properties) > to my persistent objects so that i can get detailed logging of an object's > state when it is loaded, saved, etc. i have just written a printToString > method for the Session interface/SessionImpl class that does this > dynamically, taking into account proxy's, lazy collections and > PersistentEnum types, so i don't have to write & maintain the toString > methods (for this purpose) anymore. i know gavin would rather the Session > interface didn't grow anymore :-), but i think this may be useful for others > to. > > comments? > > brad > > > > --- > This sf.net email is sponsored by: DEDICATED SERVERS only $89! > Linux or FreeBSD, FREE setup, FAST network. Get your own server > today at http://www.ServePath.com/indexfm.htm > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: DEDICATED SERVERS only $89! Linux or FreeBSD, FREE setup, FAST network. Get your own server today at http://www.ServePath.com/indexfm.htm ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Hooking into Hibernate classloader
Firstly, the API *should* use Class objects to reduce the possibility of runtime errors. I forget which project I saw recently that had used strings and was now moving to using class objects. Internally, we *could* use classnames, but that would be slower, right? Its much quicker to take an identityHashCode than to compute the hash of a (possibly quite long) String. Or am I wrong on this? As for why can't we compile mappings without the classes, thats because various things (property types, etc) may be determined by reflection. I still think this is a nice feature. - Original Message - From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> Cc: "hibernate list" <[EMAIL PROTECTED]> Sent: Thursday, November 07, 2002 7:23 PM Subject: Re: [Hibernate] Hooking into Hibernate classloader > > > But this doesn't handle things like SessionFactory.getClassMetadata, > > which takes a Class. > > Just asking out of personal interest :) > why is everything in hibernate bound up onto Class objects, why not > fully-qualifed-names in > the form of strings instead ? > > That would make it more flexible and resistant to things that might not be > availble on the classpath > and e.g. make it possible to load internal mapping model and use it for > codegeneration and other > stuff which in its nature cannot rely on the classing being in the > classpath. > > /max > > > Which leads me to believe that maybe it is better > > to keep this all out of Hibernate and just say that it's up to the > > application to wrap the Session, SessionFactory, and other public > > interfaces appropriately. > > > > -Chris > > > > > > > > > > --- > > This sf.net email is sponsored by: See the NEW Palm > > Tungsten T handheld. Power & Color in a compact size! > > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > > ___ > > hibernate-devel mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > > > --- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Re: Trouble with proxy implementations
Very, very cool One more request: is it possible to support this for package-visibility methods by generating the MetaClass in the same package? (Might have to have a different instance for each superclass in the hierarchy.) It would be a little bit of work to integrate this into Hibernate, but well worth the effort, I expect. > We have some public class "MetaClass" for public methods only, possible > "ReflectOptimizer" is a better name for it. > It copies bean properties from array and array to bean without reflection, --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Half baked idea about improved code generation
> - sets miss then not-null attribute, so I cannot judge if > they are to be included in the minimal constructor or not I *think* its reasonable to actually create a HashSet, ArrayList, etc in the minimal constructor. > (the not-null attribute should be added to set, bag, ...) H I'm not willing to do this, because the not-null attribute implies the existence of a constraint in the relational model. > - of course I'm not willing to maintain this pach-set outside > the CVS, so I will develop it further only if you like the > idea and are willing to accept my work... (the patch is > very small but it's annoying to keep it on par every time > a new hibernate release is out) Yes, of course; I think its a very useful addition.How would you like to send the code? Is the Sourceforge patch manager the easiest way for you? Gavin --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] CVS is broken
Yep, I know. I will get it fixed real soon. - Original Message - From: "Mark Woon" <[EMAIL PROTECTED]> To: "Hibernate Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, October 23, 2002 8:12 AM Subject: [Hibernate] CVS is broken > > > > --- > This sf.net emial is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This sf.net emial is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ClassMetadata
In Hibernate2 you can get access to this kind of stuff via the Configuration object (not from the Sessionfactory, since these things are not used at runtime). Ken Robinson <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] ClassMetadata eforge.net 12/02/03 12:38 PM Hi there, Looking throught the hibernate-mapping-1.1 dtd I noticed that the property element has a property called length. I'm assuming this can be used to indicate the size of the underlying column. From ClassMetadata I can get to the property names and types, but there doesn't seem to be any way to get at the length values. I need those values and I'd rather not have to query the DatabaseMetadata to get them. Any suggestions? Thanks, Ken --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Possible Bug in HQL
> Here is a query in HQL: > SELECT foo FROM foo IN CLASS Foo > WHERE foo.color='green' AND (foo.bar=? OR foo.bar.someValue='happy') > [snip] > The generated SQL-Code produces the cartesian product between > Foo and Bar: SELECT ... FROM Foo foo, Bar sim0 WHERE > (foo.color='green')AND((foo.barId=[id of the bar that I > provided] ) OR(sim0_.someValue='happy' and foo.barId=sim0_.id)) > > Thats what I want: > SELECT ... FROM Foo foo, Bar sim0 > WHERE (foo.color='green')AND((foo.barId=[id of the bar that I > provided] ) > OR(sim0_.someValue='happy')) AND foo.barId=sim0_.id > > Any comments? Hmm, yeah this is very interesting. I certainly wouldn't characterize it as a "bug" (because the generated SQL is exactly what is intended) but I agree it *is* counterintuitive that FROM foo IN CLASS Foo WHERE foo.color='green' OR foo.bar.baz='somethingThatBazIsNeverEqualTo' and FROM foo IN CLASS Foo WHERE foo.color='green' would have *completely* different result sets. Note that with the addition of a DISTINCT clause, they give the same results, ie. SELECT DISTINCT foo FROM foo IN CLASS Foo WHERE foo.color='green' OR foo.bar.baz='somethingThatBazIsNeverEqualTo' and SELECT DISTINCT foo FROM foo IN CLASS Foo WHERE foo.color='green' have exactly the same result sets. On the other hand, your proposal is no good either, since it does not return green Foos with bar=null. So it seems to me like both are imperfect, but existing functionality is better, because we can force what we mean by adding "distinct". I'm sure an OODB could handle this much more elegantly but for a relational database, I don't think we can do much better. ** 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 [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] saveOrUpdate vs. update
Ummm theres a bunch of things to get right and since I can't see your mappings, I'm not sure which. However, you should check out the functionality of: * unsaved-value attribute of * cascade attribute of associations * lazy attribute of collections * proxy attribute of , , by fiddling with those I think all your problems will go away ;) -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Friday, 27 December 2002 7:34 PM To: [EMAIL PROTECTED] Subject: [Hibernate] saveOrUpdate vs. update I have a BaseDAO that contains some generic (I think) Hibernate compatible code. It's basically removeObject, storeObject, and retrieveObject. I've found that Hibernate tries to do an INSERT if I use sess.saveOrUpdate in the following method: protected void storeObject(Object obj) throws DAOException { Session ses = null; try { ses = sessionFactory.openSession(); ses.saveOrUpdate(obj); ses.flush(); ses.connection().commit(); } 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(); } ; } } This causes an error, as there is already a user with this name. So I tried changing it to just ses.update(obj), but now I'm getting the following error: [junit] Testcase: testAddResume(org.appfuse.persistence.UserDAOTest): Caused an ERROR [junit] cirrus.hibernate.HibernateException: The given object has a null identifier property [org.appfuse.persistenc e.Resume] [junit] org.appfuse.persistence.DAOException: cirrus.hibernate.HibernateException: The given object has a null ident ifier property [org.appfuse.persistence.Resume] [junit] at org.appfuse.persistence.BaseDAOHibernate.storeObject(BaseDAOHibernate.ja va:117) [junit] at org.appfuse.persistence.UserDAOHibernate.addResume(UserDAOHibernate.java :117) [junit] at org.appfuse.persistence.UserDAOTest.testAddResume(UserDAOTest.java:91) All I'm trying to do is the following: user = dao.getUser("tomcat"); user.setAddress("new address"); User savedUser = dao.saveUser(user); assertEquals(savedUser.getAddress(), user.getAddress()); But it seems to be trying to go and persist the children - can I turn this off? Also, I've noticed that my user's children are retrieved when I get the user's information. Does this mean that if I create a bunch of mappings from user to other entities, that they're all going to be loaded when I get a user's information? This might not be desirable since I get a user's information when they login, and if they have a whole bunch of records associated with their name... you get the idea... Thanks, Matt ** 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 [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] question on H2 roadmap progress
I committed this to the Hibernate2 module last night, in fact. I have added an interface called Configurable to the id package. Check that out to see how it works. Hibernate2 will always use default constructors to instantiate id generators. = I am looking to create a custom id generator for my project and noticed several planned "enhancements" for H2 in the id generator area. Two are specific generator cases, so I am not concerned with them. What I would like to know is how far has the planning gone for * named id generator parameters so that I can make sure my generator is forward compatable? mainly, I want to make sure I can support the named params, especially as my generator will require params. Can I plan for it with some simple assumptions? something like one of these choices: craete getters/setters for named params (ie for the above example setMaxLo(int maxLo) or a Constructor or Configure method that accepts an xml doc/string or a name=value pair map Thanks in advance Russell --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] TODO
Heres a list of outstanding things for the next month or so: * add @tag generation to hbm2java * finish Middlegen plugin * design new config API I will be very busy for the immediate future, so if anyone is interested in taking on any of these tasks, that would be awesome. (They are all pretty fun things and don't require deep understanding of Hibernate internals.) I will do them myself, if I can't find anyone else, but I'm not sure when I will be able to get a chance. ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Caching
Collections are cached if (only if) they have their own subelement. - Original Message - From: Joost van de Wijgerd To: Gavin King Cc: hibernate list Sent: Wednesday, October 09, 2002 11:33 PM Subject: [Hibernate] Caching Gavin, Relating to the cache, I gather that collections that are defined inside a mapping are not cached? one would assume that you won't have to do a select for these collections since they can only be changed through the object itself? probably i'm wrong, but i just wanted to check this with you.. Joost.
Re: [Hibernate] What would a good locking API look like?
In your environment, is no-wait something you use every time you select from a table, or is it something that is used very occasionally? What I mean is; is it enough to have a system property hibernate.locking.use_no_wait or mapping file option, or should I have a new LockMode LockMode.EXCLUSIVE_NO_WAIT - Original Message - From: "Paul Szego" <[EMAIL PROTECTED]> To: "Gavin King" <[EMAIL PROTECTED]> Sent: Tuesday, October 01, 2002 3:04 PM Subject: Re: [Hibernate] What would a good locking API look like? > > Hi, > > a no-wait option would be useful. It's what's stopping us using this in > a few productions sytems. I hacked this in quite a while back, but the > codebase has moved on considerably. > > Session.lock(foo) == Session.lock(foo, LockMode.EXCLUSIVE) > == Session.lock(foo, LockMode.EXCLUSIVE, WaitMode.WAIT) > == Session.lock(foo, WaitMode.WAIT) > > with an alternative of WaitMode.NOWAIT, or just use a boolean if you're > that way inclined. > > PaulS. > > Gavin King wrote: > > Hi, I've been thinking about improving Hibernate's locking API recently. > > Currently your object could be in 3 different states: > > > > * No lock, for example if you just called session.update(foo) or if the > > session was disconnected > > * Shared lock, for example if you just called session.load(id) or > > session.find(query) > > * Exclusive lock, if you called session.loadWithLock(id) or > > session.lock(foo), or if changes to the object have been flush()ed > > > > There is currently no mechanism for upgrading a lock from No lock to Shared > > lock, ie. to do a version check for an object. > > > > So I'm wondering about deprecating Session.lock() and Session.loadWithLock() > > and replacing them with > > > > Session.load(clazz, id, lockMode) > > Session.load(object, id, lockMode) > > Session.lock(object, lockMode) > > > > I would introduce a new class, > > > > public class LockMode { > > public static final LockMode NONE; > > public static final LockMode SHARED; > > public static final LockMode EXCLUSIVE; > > } > > > > Then > > > > Session.loadWithLock(clazz, id) == Session.load(clazz, id, > > LockMode.EXCLUSIVE) > > Session.lock(foo) == Session.lock(foo, LockMode.EXCLUSIVE) > > > > There is also a certain argument for allowing Session.update(foo, lockMode), > > but thats a bit more difficult to implement, so lets leave it for later > > > > Ideas + criticisms are very welcome! > > > > Gavin > > > > > > > > --- > > This sf.net email is sponsored by: DEDICATED SERVERS only $89! > > Linux or FreeBSD, FREE setup, FAST network. Get your own server > > today at http://www.ServePath.com/indexfm.htm > > ___ > > hibernate-devel mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > > --- This sf.net email is sponsored by: DEDICATED SERVERS only $89! Linux or FreeBSD, FREE setup, FAST network. Get your own server today at http://www.ServePath.com/indexfm.htm ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel