You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
(175) |
Jul
(209) |
Aug
(302) |
Sep
(287) |
Oct
(339) |
Nov
(314) |
Dec
(329) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(479) |
Feb
(389) |
Mar
(599) |
Apr
(307) |
May
(390) |
Jun
(300) |
Jul
(410) |
Aug
(458) |
Sep
(299) |
Oct
(315) |
Nov
(363) |
Dec
(529) |
2005 |
Jan
(568) |
Feb
(434) |
Mar
(1004) |
Apr
(823) |
May
(767) |
Jun
(763) |
Jul
(854) |
Aug
(862) |
Sep
(560) |
Oct
(853) |
Nov
(763) |
Dec
(731) |
2006 |
Jan
(776) |
Feb
(608) |
Mar
(657) |
Apr
(424) |
May
(559) |
Jun
(440) |
Jul
(448) |
Aug
(58) |
Sep
|
Oct
(17) |
Nov
(16) |
Dec
(8) |
2007 |
Jan
(1) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
(3) |
Jun
(3) |
Jul
(3) |
Aug
(16) |
Sep
(10) |
Oct
(4) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <leg...@at...> - 2003-11-02 16:09:14
|
The following comment has been added to this issue: Author: Michail Jekimov Created: Sun, 2 Nov 2003 10:08 AM Body: Hello again, the dialect approach works fine, but unfortunately only for functions which accept not more than one parameter. With other functions Hibernate throws a QueryException with 'undefined alias' as a message. May be there could be a more general solution with something like SQLToken that would be passed unchanged to the database? Michail --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-158 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-158 Summary: Customizable SQL Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: TURIN ACCOUNT Created: Tue, 8 Jul 2003 3:38 PM Updated: Tue, 8 Jul 2003 3:38 PM Description: Ability to be able to get the SQL Hibernate would send to the database for a given query, be able to look at it and possibly tweak it (as a String) and then allow Hibernate to continue - sending the SQL on its way to the database. This allows for subtle hints and other database tricks one is often forced to do when you don't "own" the datamodel. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-02 09:06:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sun, 2 Nov 2003 3:06 AM Thanks, I have applied this patch. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-436 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-436 Summary: Divide QueryCache in multiple regions Type: Improvement Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 rc1 Assignee: Gavin King Reporter: Mikheil Kapanadze Created: Thu, 30 Oct 2003 9:06 AM Updated: Sun, 2 Nov 2003 3:06 AM Description: Hibernate uses one instance of query cache for all cached queries. In some cases user may want to store query results in the different caches instead of using "main" one. Here is a description of the major changes 1. There were 2 caches in QueryCache.java - query cache itself and timestamp cache. The last one was moved to the separate class, because we didn't divide that cache. 2. cacheRegion property was added to the Query and QueryParameter classes 3. There is a new method, getQueryCache(String cacheRegion) in SessionFactoryImpl. It returns query cache, stored in the internal map or creates new one and puts it there. It also destroys all these caches in the close() method. 4. There are some minor changes, too. For example, default query cache's region name was changed to net.sf.hibernate.cache.QueryCache. This was done as object cache's region name equals to classname and there may be conflict in naming if someone has QueryCache class (without package) in his code. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-01 12:16:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sat, 1 Nov 2003 6:16 AM This is fixed in the 2.1 package and we are almost ready to go final with this, so I doubt there will be another release of 2.0.x. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-446 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-446 Summary: The demo.sh and demo.bat scripts refer to non-existent jars Type: Bug Status: Closed Priority: Minor Resolution: WON'T FIX Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Craig Day Created: Sat, 1 Nov 2003 2:07 AM Updated: Sat, 1 Nov 2003 6:16 AM Environment: all Description: The demo.sh and demo.bat scripts refer to non-existent jars. At this point I cannot tell whether I need to go off and get cglib and/or bcel to get hibernate to work or attempt to use the provided lib cglib-asm??? cheers craig --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-01 09:28:14
|
The following comment has been added to this issue: Author: Craig Day Created: Sat, 1 Nov 2003 3:28 AM Body: I now realize that i dont need further cglib or bcel libs to run hibernate. Would recommend that the demo scripts be fixed anyway, or removed if no longer used. cheers craig --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-446 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-446 Summary: The demo.sh and demo.bat scripts refer to non-existent jars Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Craig Day Created: Sat, 1 Nov 2003 2:07 AM Updated: Sat, 1 Nov 2003 2:07 AM Environment: all Description: The demo.sh and demo.bat scripts refer to non-existent jars. At this point I cannot tell whether I need to go off and get cglib and/or bcel to get hibernate to work or attempt to use the provided lib cglib-asm??? cheers craig --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-01 08:08:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-446 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-446 Summary: The demo.sh and demo.bat scripts refer to non-existent jars Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Craig Day Created: Sat, 1 Nov 2003 2:07 AM Updated: Sat, 1 Nov 2003 2:07 AM Environment: all Description: The demo.sh and demo.bat scripts refer to non-existent jars. At this point I cannot tell whether I need to go off and get cglib and/or bcel to get hibernate to work or attempt to use the provided lib cglib-asm??? cheers craig --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-01 01:47:13
|
Message: The following issue has been closed. Resolver: Gavin King Date: Fri, 31 Oct 2003 7:46 PM Ooops! Missed that one. Thanks. I've fixed this and a similar problem with non-insertable properties in CVS. Might have to do a 2.1beta5b release uggh. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-445 Summary: Can't delete object with property that is not nullable and not updateable Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 rc1 Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 3:21 PM Updated: Fri, 31 Oct 2003 7:46 PM Environment: WebLogic 8.1, Windows XP, Microsoft SQL Server Description: When attempting to delete an object with a property that is not nullable and also not updateable, Hibernate throws an exception like: java.lang.NullPointerException: not-null property references a null or transient value: role at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences([Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;ZLjava.lang.Object;[Z[Ljava.lang.String;)V(SessionImpl.java:900) at net.sf.hibernate.impl.SessionImpl.doDelete(Ljava.lang.Object;Lnet.sf.hibernate.impl.SessionImpl$EntityEntry;Lnet.sf.hibernate.persister.ClassPersister;)V(SessionImpl.java:1120) at net.sf.hibernate.impl.SessionImpl.delete(Ljava.lang.Object;)V(SessionImpl.java:1056) This problem occurs when the deleted object's property value is not null. But the value is not copied to SessionImpl.doDelete.entry.deletedState, because the property is not updateable. The patch nullable.diff-u (attached) helps, I find. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-01 00:32:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Fri, 31 Oct 2003 6:31 PM This occurs because your get/set pair is overloaded, and diff JVMs return reflected methods in diff orders. Hibernate does not support overloaded get/set pairs. If it is a problem consider using access="direct" in 2.1. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-443 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-443 Summary: JRE incompatibility, gives no persister for : java.lang.Boolean Type: Bug Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Sunil Reddy Created: Fri, 31 Oct 2003 1:26 PM Updated: Fri, 31 Oct 2003 6:31 PM Environment: Windows 2000, going against DB2 7.0, Hibernate 2.0.3, Websphere 5.0, Sun JDK 1.3.1_01. Description: Topic: JRE incompatibility, gives no persister for : java.lang.Long Hi Gavin, Thanks for your reply, i think Hibernate is excellent, i am struggling with this problem whole week, i have tried everything from recompile hibernate to traversing trees but the bug exists whenever i switch from Ibm jre to Sun jre. I don't know where i am making a mistake, here is a recreation of the problem : Classes : "Derivation" is a choice of "Aggregation" or "Formula", which are lists of "Item". "Aggregation" has method attribute of type min or max. "Item" can be a "Constant" or "Operator". DTD is as follows : <!ELEMENT Derivation (Formula | Aggregation)> <!ATTLIST Derivation Type (aggregation | formula) #REQUIRED > <!ELEMENT Aggregation (Item+)> <!ATTLIST Aggregation Method (max | min) #REQUIRED > <!ELEMENT Formula (Item+)> <!ELEMENT Item EMPTY> <!ATTLIST Item Type (constant | operator | reference) #REQUIRED Value CDATA #REQUIRED > Derivation.java : public String getType () //can be aggregation or formula public void setType (String enumValue) public Formula getFormula () public void setFormula (Formula obj) public void setFormula (XmlElement xml) public Aggregation getAggregation () public void setAggregation (Aggregation obj) public void setAggregation (XmlElement xml) Aggregation.java : public String getMethod () //can be max or min public void setMethod (String enumValue) public java.util.List getItem () public void setItem (java.util.List newList) Formula.java public java.util.List getItem () public void setItem (java.util.List newList) Item.java public String getType () //can be constant or operator public void setType (String enumValue) //building session factory Properties prop = new Properties(); prop.load( new FileInputStream("hibernate.properties") ); Configuration cfg = new Configuration(); cfg.addClass(example.Aggregation.class); cfg.addClass(example.Derivation.class); cfg.addClass(example.Formula.class); cfg.addClass(example.Item.class); cfg.setProperties(prop); sessionFactory = cfg.buildSessionFactory(); //main SampleApp sa = new SampleApp(); sa.session = sessionFactory.openSession(); Derivation d = (Derivation) obj; //created this object with sample data shown below sa.session.save(d); sa.session.flush(); sa.session.connection().commit(); sa.session.close(); //sample data <Derivation Type="aggregation"> <Aggregation Method="max"> <Item Type="constant" Value="5"/> <Item Type="constant" Value="24"/> <Item Type="constant" Value="18"/> </Aggregation> </Derivation> //exception i get with Sun 1.3.1_01 or 1.3.1_09 or 1.4.2 versions but not with Ibm jre is 13:59:37,846 DEBUG SessionImpl:413 - opened session 13:59:37,846 DEBUG SessionImpl:656 - saving [example.Derivation#<null>] 13:59:37,846 DEBUG Cascades:336 - processing cascades for: example.Derivation 13:59:37,846 DEBUG Cascades:87 - cascading to saveOrUpdate() net.sf.hibernate.MappingException: No persister for: java.lang.Boolean at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:420) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2302) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2309) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1195) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:88) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:258) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:341) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:693) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:605) at example.SampleApp.main(SampleApp.java:89) //Mappings for the above classes are : <hibernate-mapping> <class name="example.Derivation" table="ex_derivation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <many-to-one name="formula" class="example.Formula" column="formula_id" cascade="all"/> <many-to-one name="aggregation" class="example.Aggregation" column="aggregation_id" cascade="all"/> </class> <class name="example.Formula" table="ex_formula"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <list name="item" table="ex_item" cascade="all"> <key column="formula_id"/> <index column="formula_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Aggregation" table="ex_aggregation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="method"/> <list name="item" table="ex_item" cascade="all"> <key column="aggregation_id"/> <index column="aggregation_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Item" table="ex_item"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <property name="value"/> </class> </hibernate-mapping> --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 23:35:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Fri, 31 Oct 2003 5:34 PM This is not true. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-444 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-444 Summary: Session.load(Object, Serializable) does not load non-null collection properties Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: Paul Ferraro Created: Fri, 31 Oct 2003 1:38 PM Updated: Fri, 31 Oct 2003 5:34 PM Description: Given the following persistent class: public class MyObject { private Integer id; private Set otherObjectSet = new HashSet(); public Integer getId() { return id; } public void setId(Integer id) { this.id = id } public Set getOtherObjectSet() { return otherObjectSet; } public void setOtherObjectSet(Set set) { otherObjectSet = set } } with the following mapping: <class name="MyObject" table="my_object" dynamic-update="true"> <id name="id" column="my_object_id" type="int"> <generator class="native"/> </id> <set name="otherObjectSet" table="my_object_mapping" cascade="none"> <key column="my_object_id"/> <many-to-many class="OtherObject" column="other_object_id"/> </set> </class> The following code misbehaves: Integer id = new Integer(1); MyObject object = new MyObject(); // otherObjectSet is initialized to empty set session.load(object, id); object.getOtherObjectSet() // Will always be empty - collection was not loaded however, Integer id = new Integer(1); MyObject object = (MyObject) session.load(MyObject.class, id); object.getOtherObjectSet() // Will return properly associated OtherObjects If I remove the " = new HashSet()" from the property declaration of set, then both methods return the proper values for getOtherObjectSet(). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 21:27:14
|
The following comment has been added to this issue: Author: John Kristian Created: Fri, 31 Oct 2003 3:26 PM Body: The second attachment named nullable.diff-u is the one that I find helpful. The first does not help. (Sorry about that.) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-445 Summary: Can't delete object with property that is not nullable and not updateable Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 3:21 PM Updated: Fri, 31 Oct 2003 3:24 PM Environment: WebLogic 8.1, Windows XP, Microsoft SQL Server Description: When attempting to delete an object with a property that is not nullable and also not updateable, Hibernate throws an exception like: java.lang.NullPointerException: not-null property references a null or transient value: role at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences([Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;ZLjava.lang.Object;[Z[Ljava.lang.String;)V(SessionImpl.java:900) at net.sf.hibernate.impl.SessionImpl.doDelete(Ljava.lang.Object;Lnet.sf.hibernate.impl.SessionImpl$EntityEntry;Lnet.sf.hibernate.persister.ClassPersister;)V(SessionImpl.java:1120) at net.sf.hibernate.impl.SessionImpl.delete(Ljava.lang.Object;)V(SessionImpl.java:1056) This problem occurs when the deleted object's property value is not null. But the value is not copied to SessionImpl.doDelete.entry.deletedState, because the property is not updateable. The patch nullable.diff-u (attached) helps, I find. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 21:25:13
|
The following issue has been updated: Updater: John Kristian (mailto:jkr...@do...) Date: Fri, 31 Oct 2003 3:24 PM Changes: Attachment changed to nullable.diff-u --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-445 Summary: Can't delete object with property that is not nullable and not updateable Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 3:21 PM Updated: Fri, 31 Oct 2003 3:24 PM Environment: WebLogic 8.1, Windows XP, Microsoft SQL Server Description: When attempting to delete an object with a property that is not nullable and also not updateable, Hibernate throws an exception like: java.lang.NullPointerException: not-null property references a null or transient value: role at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences([Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;ZLjava.lang.Object;[Z[Ljava.lang.String;)V(SessionImpl.java:900) at net.sf.hibernate.impl.SessionImpl.doDelete(Ljava.lang.Object;Lnet.sf.hibernate.impl.SessionImpl$EntityEntry;Lnet.sf.hibernate.persister.ClassPersister;)V(SessionImpl.java:1120) at net.sf.hibernate.impl.SessionImpl.delete(Ljava.lang.Object;)V(SessionImpl.java:1056) This problem occurs when the deleted object's property value is not null. But the value is not copied to SessionImpl.doDelete.entry.deletedState, because the property is not updateable. The patch nullable.diff-u (attached) helps, I find. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 21:23:14
|
The following issue has been updated: Updater: John Kristian (mailto:jkr...@do...) Date: Fri, 31 Oct 2003 3:21 PM Changes: Attachment changed to nullable.diff-u --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-445 Summary: Can't delete object with property that is not nullable and not updateable Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 3:21 PM Updated: Fri, 31 Oct 2003 3:21 PM Environment: WebLogic 8.1, Windows XP, Microsoft SQL Server Description: When attempting to delete an object with a property that is not nullable and also not updateable, Hibernate throws an exception like: java.lang.NullPointerException: not-null property references a null or transient value: role at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences([Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;ZLjava.lang.Object;[Z[Ljava.lang.String;)V(SessionImpl.java:900) at net.sf.hibernate.impl.SessionImpl.doDelete(Ljava.lang.Object;Lnet.sf.hibernate.impl.SessionImpl$EntityEntry;Lnet.sf.hibernate.persister.ClassPersister;)V(SessionImpl.java:1120) at net.sf.hibernate.impl.SessionImpl.delete(Ljava.lang.Object;)V(SessionImpl.java:1056) This problem occurs when the deleted object's property value is not null. But the value is not copied to SessionImpl.doDelete.entry.deletedState, because the property is not updateable. The patch nullable.diff-u (attached) helps, I find. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 21:21:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-445 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-445 Summary: Can't delete object with property that is not nullable and not updateable Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 3:21 PM Updated: Fri, 31 Oct 2003 3:21 PM Environment: WebLogic 8.1, Windows XP, Microsoft SQL Server Description: When attempting to delete an object with a property that is not nullable and also not updateable, Hibernate throws an exception like: java.lang.NullPointerException: not-null property references a null or transient value: role at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences([Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;ZLjava.lang.Object;[Z[Ljava.lang.String;)V(SessionImpl.java:900) at net.sf.hibernate.impl.SessionImpl.doDelete(Ljava.lang.Object;Lnet.sf.hibernate.impl.SessionImpl$EntityEntry;Lnet.sf.hibernate.persister.ClassPersister;)V(SessionImpl.java:1120) at net.sf.hibernate.impl.SessionImpl.delete(Ljava.lang.Object;)V(SessionImpl.java:1056) This problem occurs when the deleted object's property value is not null. But the value is not copied to SessionImpl.doDelete.entry.deletedState, because the property is not updateable. The patch nullable.diff-u (attached) helps, I find. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 19:38:13
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-444 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-444 Summary: Session.load(Object, Serializable) does not load non-null collection properties Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: Paul Ferraro Created: Fri, 31 Oct 2003 1:38 PM Updated: Fri, 31 Oct 2003 1:38 PM Description: Given the following persistent class: public class MyObject { private Integer id; private Set otherObjectSet = new HashSet(); public Integer getId() { return id; } public void setId(Integer id) { this.id = id } public Set getOtherObjectSet() { return otherObjectSet; } public void setOtherObjectSet(Set set) { otherObjectSet = set } } with the following mapping: <class name="MyObject" table="my_object" dynamic-update="true"> <id name="id" column="my_object_id" type="int"> <generator class="native"/> </id> <set name="otherObjectSet" table="my_object_mapping" cascade="none"> <key column="my_object_id"/> <many-to-many class="OtherObject" column="other_object_id"/> </set> </class> The following code misbehaves: Integer id = new Integer(1); MyObject object = new MyObject(); // otherObjectSet is initialized to empty set session.load(object, id); object.getOtherObjectSet() // Will always be empty - collection was not loaded however, Integer id = new Integer(1); MyObject object = (MyObject) session.load(MyObject.class, id); object.getOtherObjectSet() // Will return properly associated OtherObjects If I remove the " = new HashSet()" from the property declaration of set, then both methods return the proper values for getOtherObjectSet(). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 19:28:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-443 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-443 Summary: JRE incompatibility, gives no persister for : java.lang.Boolean Type: Bug Status: Unassigned Priority: Critical Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Sunil Reddy Created: Fri, 31 Oct 2003 1:26 PM Updated: Fri, 31 Oct 2003 1:26 PM Environment: Windows 2000, going against DB2 7.0, Hibernate 2.0.3, Websphere 5.0, Sun JDK 1.3.1_01. Description: Topic: JRE incompatibility, gives no persister for : java.lang.Long Hi Gavin, Thanks for your reply, i think Hibernate is excellent, i am struggling with this problem whole week, i have tried everything from recompile hibernate to traversing trees but the bug exists whenever i switch from Ibm jre to Sun jre. I don't know where i am making a mistake, here is a recreation of the problem : Classes : "Derivation" is a choice of "Aggregation" or "Formula", which are lists of "Item". "Aggregation" has method attribute of type min or max. "Item" can be a "Constant" or "Operator". DTD is as follows : <!ELEMENT Derivation (Formula | Aggregation)> <!ATTLIST Derivation Type (aggregation | formula) #REQUIRED > <!ELEMENT Aggregation (Item+)> <!ATTLIST Aggregation Method (max | min) #REQUIRED > <!ELEMENT Formula (Item+)> <!ELEMENT Item EMPTY> <!ATTLIST Item Type (constant | operator | reference) #REQUIRED Value CDATA #REQUIRED > Derivation.java : public String getType () //can be aggregation or formula public void setType (String enumValue) public Formula getFormula () public void setFormula (Formula obj) public void setFormula (XmlElement xml) public Aggregation getAggregation () public void setAggregation (Aggregation obj) public void setAggregation (XmlElement xml) Aggregation.java : public String getMethod () //can be max or min public void setMethod (String enumValue) public java.util.List getItem () public void setItem (java.util.List newList) Formula.java public java.util.List getItem () public void setItem (java.util.List newList) Item.java public String getType () //can be constant or operator public void setType (String enumValue) //building session factory Properties prop = new Properties(); prop.load( new FileInputStream("hibernate.properties") ); Configuration cfg = new Configuration(); cfg.addClass(example.Aggregation.class); cfg.addClass(example.Derivation.class); cfg.addClass(example.Formula.class); cfg.addClass(example.Item.class); cfg.setProperties(prop); sessionFactory = cfg.buildSessionFactory(); //main SampleApp sa = new SampleApp(); sa.session = sessionFactory.openSession(); Derivation d = (Derivation) obj; //created this object with sample data shown below sa.session.save(d); sa.session.flush(); sa.session.connection().commit(); sa.session.close(); //sample data <Derivation Type="aggregation"> <Aggregation Method="max"> <Item Type="constant" Value="5"/> <Item Type="constant" Value="24"/> <Item Type="constant" Value="18"/> </Aggregation> </Derivation> //exception i get with Sun 1.3.1_01 or 1.3.1_09 or 1.4.2 versions but not with Ibm jre is 13:59:37,846 DEBUG SessionImpl:413 - opened session 13:59:37,846 DEBUG SessionImpl:656 - saving [example.Derivation#<null>] 13:59:37,846 DEBUG Cascades:336 - processing cascades for: example.Derivation 13:59:37,846 DEBUG Cascades:87 - cascading to saveOrUpdate() net.sf.hibernate.MappingException: No persister for: java.lang.Boolean at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:420) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2302) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2309) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1195) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:88) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:258) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:341) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:693) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:605) at example.SampleApp.main(SampleApp.java:89) //Mappings for the above classes are : <hibernate-mapping> <class name="example.Derivation" table="ex_derivation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <many-to-one name="formula" class="example.Formula" column="formula_id" cascade="all"/> <many-to-one name="aggregation" class="example.Aggregation" column="aggregation_id" cascade="all"/> </class> <class name="example.Formula" table="ex_formula"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <list name="item" table="ex_item" cascade="all"> <key column="formula_id"/> <index column="formula_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Aggregation" table="ex_aggregation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="method"/> <list name="item" table="ex_item" cascade="all"> <key column="aggregation_id"/> <index column="aggregation_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Item" table="ex_item"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <property name="value"/> </class> </hibernate-mapping> --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 17:30:16
|
The following issue has been updated: Updater: John Kristian (mailto:jkr...@do...) Date: Fri, 31 Oct 2003 11:30 AM Changes: Attachment changed to transient.diff-u --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-442&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-442 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-442 Summary: Better diagnosis of invalid value of not-null property Type: Improvement Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 11:29 AM Updated: Fri, 31 Oct 2003 11:30 AM Description: In 2.1beta5, please provide better diagnostic information when an object fails to flush because one of its properties is null or refers to a transient object. Please differentiate these cases, in the thrown exception. In the case of a reference to a transient object, please throw TransientObjectException, not NullPointerException. In either case, please identify the object or object class that contains the erroneous property. I propose the patch transient.diff-u (attached). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 17:30:16
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-442 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-442 Summary: Better diagnosis of invalid value of not-null property Type: Improvement Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: John Kristian Created: Fri, 31 Oct 2003 11:29 AM Updated: Fri, 31 Oct 2003 11:29 AM Description: In 2.1beta5, please provide better diagnostic information when an object fails to flush because one of its properties is null or refers to a transient object. Please differentiate these cases, in the thrown exception. In the case of a reference to a transient object, please throw TransientObjectException, not NullPointerException. In either case, please identify the object or object class that contains the erroneous property. I propose the patch transient.diff-u (attached). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 14:44:14
|
The following comment has been added to this issue: Author: Jeff Rhines Created: Fri, 31 Oct 2003 8:44 AM Body: From the javadoc: "Cancel execution of the current query. May be called from one thread to stop execution of a query in another thread. Use with care!" What kind of care needs to be taken? Are there cases where this should not be used? Is it not safe in some respect? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-439 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-439 Summary: Ability to cancel query from a separate thread Type: New Feature Status: Closed Priority: Minor Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 rc1 Versions: 2.0.3 Assignee: Reporter: Jeff Rhines Created: Thu, 30 Oct 2003 6:09 PM Updated: Thu, 30 Oct 2003 11:40 PM Environment: Hib2.0.3/My App/JDK1.4.2/Win2000/Dell PC/Grey Cubical Walls/etc. Description: Need a way to allow a user to cancel a running query. Tried Session.close() to pull the connection out from under the query, but received a ConcurrentModificationException on SessionImpl:1949. Reasonable, as the documentation claims Session implementations are not required to be thread safe. So, it would be nice to have a feature so one thread could cancel a query being actively run by another thread. Maybe similar to (or using?) java.sql.Statement.cancel()? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 14:36:17
|
The following comment has been added to this issue: Author: Michail Jekimov Created: Fri, 31 Oct 2003 8:35 AM Body: Hi Max, thanks a lot for the tip - the subclassing of a particular dialect is a really cool idea! --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-158 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-158 Summary: Customizable SQL Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: TURIN ACCOUNT Created: Tue, 8 Jul 2003 3:38 PM Updated: Tue, 8 Jul 2003 3:38 PM Description: Ability to be able to get the SQL Hibernate would send to the database for a given query, be able to look at it and possibly tweak it (as a String) and then allow Hibernate to continue - sending the SQL on its way to the database. This allows for subtle hints and other database tricks one is often forced to do when you don't "own" the datamodel. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 12:40:14
|
The following comment has been added to this issue: Author: Maarten Coene Created: Fri, 31 Oct 2003 6:39 AM Body: thx for the help. just trying to help to improve hibernate... Unfortunately, this last solution would introduce database-specific code in my build.xml file (I'm using the schemaexport ant task to create the tables). I've put a lot of effort to keep the build.xml antfile database independent because we must be able to deploy our application to different systems with different databases very quick and easy without having to modify a lot of files. The only thing that should be changed here is the hibernate configuration file which contains the dialect, driver, database_url, ... Maybe I can use a property file to indicate which SQL delimiter the schemaexport task should use, but that's introducing an extra dependency between that propertyfile and the hibernate configuration file: changing the dialect will also require to change the extra property. Or maybe I can check the value of the dialect property in my build.xml file to see if it's MySQL (yuck, but it will probably work). Anyway, I would prefer a solutions which is easier to maintain ... regards, Maarten Coene --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-441 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-441 Summary: Allow dialect specific table options in create table scripts Type: Improvement Status: Closed Priority: Major Resolution: WON'T FIX Project: Hibernate2 Assignee: Reporter: Maarten Coene Created: Fri, 31 Oct 2003 4:24 AM Updated: Fri, 31 Oct 2003 4:27 AM Environment: all Description: Hi, I need support for table_options in the MySQL create table syntax. The MySQL create syntax looks like: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [select_statement] I don't know if ohter databases can have table_options in their create scripts. The reason I need this is that I want to create tables using the SchemaExport tool and these tables must have the InnoDB type, this means I have to create SQL commands like: CREATE mytable (...) TYPE=INNODB; I want to solve my problem by creating my own dialect (e.g. InnoDbMySQLDialect extends MySQLDialect) but I didn't find a way to specify these table_options with the current implementation. To allow these table_options, I propose the following mimimal changes to your code: 1. add this method to Dialect.java: public String getTableOptions() { return ""; } 2. change the sqlCreateString(Dialect dialect, Mapping p) method of Table.java (add this to the end of the method): buf.append(StringHelper.CLOSE_PAREN); buf.append(" "); // ADD THIS LINE buf.append(dialect.getTableOptions()); // ADD THIS LINE return buf.toString(); This way, I can easily create my own dialect: public class InnoDbMySQLDialect extends MySQLDialect { public String getTableOptions() { return "TYPE=INNODB"; } } kind regards, Maarten Coene --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 11:35:14
|
The following comment has been added to this issue: Author: Gavin King Created: Fri, 31 Oct 2003 5:34 AM Body: This is JIRA, for bugs in Hibernate. Please use the user forum if you want advice on troubleshooting. P.S. If you are a new user, why are you using Hibernate 1.2. You should be using 2.1. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-16 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-16 Summary: session.find doesn't return any records while records exist in the database Type: Bug Status: Closed Priority: Blocker Resolution: REJECTED Project: Hibernate 1.2 Assignee: Reporter: Hans Keppens Created: Fri, 31 Oct 2003 5:00 AM Updated: Fri, 31 Oct 2003 5:14 AM Environment: Windows 2000 JBoss 3.2.1 + Tomcat 4.1.24 Hibernate 1.2 XDoclet for generating hibernate mapping xml files MS SQL database freeTDS driver cirrus.hibernate.sql.SybaseDialect DBCP connection pool Description: The problem is that session.find(<some query>) doesn't always return the rows I'm expecting. Apparantly, it is a timing issue, because sometimes it works fine (rows are returned), but in another run of the server, no rows are returned. The code never changes any values in the tables that are searched by session.find, so I would expect more deterministic behaviour... Some extra details: The case uses 4 classes: a class ScenarioList, a class ScenarioListData, a class LargeString and a class LargeStringPart. (LargeString and LargeStringPart are a kind of 'portable CLOB'...). Tables: SCENARIO_LIST ------------- ID: number(19) CONFIG_ID: number(19) ENTITY_NAME: varchar(50) LIST_NAME: varchar(200) SCENARIO_LIST_DATA ------------------ ID: number(19) LARGESTRING_ID: number(19) SCENARIO_LIST_ID: number(19) VIEW_NAME: varchar(200) LARGESTRING ----------- ID: number(19) LARGESTRING_TYPE: varchar(30) LARGESTRING_PART ---------------- ID: number(19) LARGESTRING_ID: number(19) PART_NUMBER: number(10) PART_VALUE: varchar(4000) These classes are linked to each other as follows (see below for the Hibernate classes). ScenarioList 1 --- * ScenarioListData ScenarioListData * --- 1 LargeString LargeString 1 --- * LargeStringPart For a given configId, entity and listName, I have a record in the database in the ScenarioList table and linked to it a record in the ScenarioListData table. Also, records in the LargeString and LargeStringPart tables exists. The following method SOMETIMES executes the code inside the "if (results.size() != 1)" block, and adds a warning to my logging: WARN direct query 1 results found, while results.size() = 0 public List getResults(long configId, String entity, String listName) throws HibernateException, SQLException { List result = session.find("from sl in class ScenarioList " + "where sl.configurationId = ? " + "and sl.entityName = ? " + "and sl.listName = ?", new Object[] { new Long(configId), entity, listName }, new NullableType[] { Hibernate.LONG, Hibernate.STRING, Hibernate.STRING }); if (result.size() != 1) { // trying direct SQL here, to prove session.find is wrong int count = 0; Connection con = session.connection(); PreparedStatement prepStat = null; ResultSet rs = null; try { prepStat = con.prepareStatement("select count(*) " + "from scenario_list " + "where config_id = ? " + "and entity_name = ? " + "and list_name = ?"); prepStat.setLong(1, configId); prepStat.setString(2, entity); prepStat.setString(3, listName); rs = prepStat.executeQuery(); if (rs.next()) { count = rs.getInt(1); } else { log.warn("direct query no count(*) data found!?"); } } finally { if (rs != null) { rs.close(); } if (prepStat != null) { prepStat.close(); } } if (count != result.size()) { log.warn("direct query " + count + " results found, while results.size() = " + result.size()); } return null; } return result; } Hibernate classes: /** * @hibernate.class table="SCENARIO_LIST" */ public class ScenarioList implements Serializable { private long id = -1; private long configurationId = -1; private String listName; private String entityName; private Set data; public ScenarioList() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST" */ public long getId() { return this.id; } /** * @hibernate.property * column="CONFIG_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getConfigurationId() { return this.configurationId; } /** * @hibernate.set * role="data" * lazy="true" * cascade="delete" * --readonly="false" * --sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.ScenarioListData" * @hibernate.collection-key * column="SCENARIO_LIST_ID" */ public Set getData() { return this.data; } /** * @hibernate.property * column="ENTITY_NAME" * type="java.lang.String" * length="50" * not-null="false" * unique="false" */ public String getEntityName() { return this.entityName; } /** * @hibernate.property * column="LIST_NAME" * type="java.lang.String" * length="200" * not-null="true" * unique="false" */ public String getListName() { return this.listName; } public void setConfigurationId(long configurationId) { this.configurationId = configurationId; } public void setData(Set data) { this.data = data; } public void setEntityName(String entityName) { this.entityName = entityName; } public void setId(long id) { this.id = id; } public void setListName(String listName) { this.listName = listName; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioList)) return false; ScenarioList castOther = (ScenarioList) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="SCENARIO_LIST_DATA" */ public class ScenarioListData { private long id = -1; private long scenarioListId; private String viewName; private LargeString dataXml; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST_DATA" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="SCENARIO_LIST_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getScenarioListId() { return this.scenarioListId; } public void setScenarioListId(long scenarioListId) { this.scenarioListId = scenarioListId; } /** * @hibernate.property * column="VIEW_NAME" * type="java.lang.String" * length="200" * not-null="false" * unique="false" */ public String getViewName() { return this.viewName; } public void setViewName(String viewName) { this.viewName = viewName; } /** * @hibernate.many-to-one * column="LARGESTRING_ID" * class="data4s.pinpoint.model.LargeString" * not-null="false" * unique="false" * cascade="delete" * --outer-join="false" */ public LargeString getDataXml() { return this.dataXml; } public void setDataXml(LargeString dataXml) { this.dataXml = dataXml; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioListData)) return false; ScenarioListData castOther = (ScenarioListData) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="LARGESTRING" */ public class LargeString implements Serializable { private static Log log = LogFactory.getLog(LargeString.class); private long id = -1; private String type; private Set parts; public LargeString() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_TYPE" * type="java.lang.String" * length="30" * not-null="true" * unique="false" */ public java.lang.String getType() { return this.type; } public void setType(java.lang.String type) { this.type = type; } /** * @hibernate.set * role="parts" * lazy="true" * cascade="delete" * --readonly="false" * sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.LargeStringPart" * @hibernate.collection-key * column="LARGESTRING_ID" */ public java.util.Set getParts() { return this.parts; } public void setParts(java.util.Set parts) { this.parts = parts; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeString)) return false; LargeString castOther = (LargeString) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public String getValue() { if (this.parts == null) { return null; } StringBuffer buf = new StringBuffer(); for (Iterator i = this.parts.iterator(); i.hasNext(); ) { LargeStringPart part = (LargeStringPart) i.next(); buf.append(part.getValue()); } return buf.toString(); } public void setValue(Session session, long largeStringId, String value) throws HibernateException, SQLException { // delete previous parts session.delete("from lsp in class LargeStringPart where lsp.largeStringId = ?", new Long(largeStringId), Hibernate.LONG); List valueParts = StringUtil.splitIntoParts(value, 2000); for (int i = 0; i < valueParts.size(); i++) { String valuePart = (String) valueParts.get(i); LargeStringPart part = new LargeStringPart(); part.setPartNumber(i); part.setValue(valuePart); part.setLargeStringId(largeStringId); session.saveOrUpdate(part); } } } /** * @hibernate.class table="LARGESTRING_PART" */ public class LargeStringPart implements Serializable, Comparable { private long id = -1; private long largeStringId; private String value; private int partNumber; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING_PART" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getLargeStringId() { return this.largeStringId; } public void setLargeStringId(long largeStringId) { this.largeStringId = largeStringId; } /** * @hibernate.property * column="PART_VALUE" * type="java.lang.String" * length="4000" * not-null="false" * unique="false" */ public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } /** * @hibernate.property * column="PART_NUMBER" * type="int" * not-null="false" * unique="false" */ public int getPartNumber() { return this.partNumber; } public void setPartNumber(int partNumber) { this.partNumber = partNumber; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeStringPart)) return false; LargeStringPart castOther = (LargeStringPart) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public int compareTo(Object other) { if (!(other instanceof LargeStringPart)) return -1; LargeStringPart castOther = (LargeStringPart) other; if (getPartNumber() < castOther.getPartNumber()) return -1; else if (getPartNumber() > castOther.getPartNumber()) return 1; return 0; } } Is this a known issue with 1.2? Regards, Hans --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 11:28:14
|
The following comment has been added to this issue: Author: Hans Keppens Created: Fri, 31 Oct 2003 5:27 AM Body: So, if it is not a Hibernate bug, what am I doing wrong? It seems like a very simple operation, but SOMETIMES (not always) the direct SQL finds records, while the session.find method doesn't. I don't change any code, one run is ok, the next one not... Really, I love and appreciate Hibernate, but I'm unable to find where the problem is. I reported it to this forum to ask input from the other users. Maybe I used the wrong issue type, but this is really blocking me. Maybe somebody could direct me to another forum/type that is more appropriate for my case? Best regards and keep up the good work, Hans --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-16 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-16 Summary: session.find doesn't return any records while records exist in the database Type: Bug Status: Closed Priority: Blocker Resolution: REJECTED Project: Hibernate 1.2 Assignee: Reporter: Hans Keppens Created: Fri, 31 Oct 2003 5:00 AM Updated: Fri, 31 Oct 2003 5:14 AM Environment: Windows 2000 JBoss 3.2.1 + Tomcat 4.1.24 Hibernate 1.2 XDoclet for generating hibernate mapping xml files MS SQL database freeTDS driver cirrus.hibernate.sql.SybaseDialect DBCP connection pool Description: The problem is that session.find(<some query>) doesn't always return the rows I'm expecting. Apparantly, it is a timing issue, because sometimes it works fine (rows are returned), but in another run of the server, no rows are returned. The code never changes any values in the tables that are searched by session.find, so I would expect more deterministic behaviour... Some extra details: The case uses 4 classes: a class ScenarioList, a class ScenarioListData, a class LargeString and a class LargeStringPart. (LargeString and LargeStringPart are a kind of 'portable CLOB'...). Tables: SCENARIO_LIST ------------- ID: number(19) CONFIG_ID: number(19) ENTITY_NAME: varchar(50) LIST_NAME: varchar(200) SCENARIO_LIST_DATA ------------------ ID: number(19) LARGESTRING_ID: number(19) SCENARIO_LIST_ID: number(19) VIEW_NAME: varchar(200) LARGESTRING ----------- ID: number(19) LARGESTRING_TYPE: varchar(30) LARGESTRING_PART ---------------- ID: number(19) LARGESTRING_ID: number(19) PART_NUMBER: number(10) PART_VALUE: varchar(4000) These classes are linked to each other as follows (see below for the Hibernate classes). ScenarioList 1 --- * ScenarioListData ScenarioListData * --- 1 LargeString LargeString 1 --- * LargeStringPart For a given configId, entity and listName, I have a record in the database in the ScenarioList table and linked to it a record in the ScenarioListData table. Also, records in the LargeString and LargeStringPart tables exists. The following method SOMETIMES executes the code inside the "if (results.size() != 1)" block, and adds a warning to my logging: WARN direct query 1 results found, while results.size() = 0 public List getResults(long configId, String entity, String listName) throws HibernateException, SQLException { List result = session.find("from sl in class ScenarioList " + "where sl.configurationId = ? " + "and sl.entityName = ? " + "and sl.listName = ?", new Object[] { new Long(configId), entity, listName }, new NullableType[] { Hibernate.LONG, Hibernate.STRING, Hibernate.STRING }); if (result.size() != 1) { // trying direct SQL here, to prove session.find is wrong int count = 0; Connection con = session.connection(); PreparedStatement prepStat = null; ResultSet rs = null; try { prepStat = con.prepareStatement("select count(*) " + "from scenario_list " + "where config_id = ? " + "and entity_name = ? " + "and list_name = ?"); prepStat.setLong(1, configId); prepStat.setString(2, entity); prepStat.setString(3, listName); rs = prepStat.executeQuery(); if (rs.next()) { count = rs.getInt(1); } else { log.warn("direct query no count(*) data found!?"); } } finally { if (rs != null) { rs.close(); } if (prepStat != null) { prepStat.close(); } } if (count != result.size()) { log.warn("direct query " + count + " results found, while results.size() = " + result.size()); } return null; } return result; } Hibernate classes: /** * @hibernate.class table="SCENARIO_LIST" */ public class ScenarioList implements Serializable { private long id = -1; private long configurationId = -1; private String listName; private String entityName; private Set data; public ScenarioList() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST" */ public long getId() { return this.id; } /** * @hibernate.property * column="CONFIG_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getConfigurationId() { return this.configurationId; } /** * @hibernate.set * role="data" * lazy="true" * cascade="delete" * --readonly="false" * --sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.ScenarioListData" * @hibernate.collection-key * column="SCENARIO_LIST_ID" */ public Set getData() { return this.data; } /** * @hibernate.property * column="ENTITY_NAME" * type="java.lang.String" * length="50" * not-null="false" * unique="false" */ public String getEntityName() { return this.entityName; } /** * @hibernate.property * column="LIST_NAME" * type="java.lang.String" * length="200" * not-null="true" * unique="false" */ public String getListName() { return this.listName; } public void setConfigurationId(long configurationId) { this.configurationId = configurationId; } public void setData(Set data) { this.data = data; } public void setEntityName(String entityName) { this.entityName = entityName; } public void setId(long id) { this.id = id; } public void setListName(String listName) { this.listName = listName; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioList)) return false; ScenarioList castOther = (ScenarioList) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="SCENARIO_LIST_DATA" */ public class ScenarioListData { private long id = -1; private long scenarioListId; private String viewName; private LargeString dataXml; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST_DATA" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="SCENARIO_LIST_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getScenarioListId() { return this.scenarioListId; } public void setScenarioListId(long scenarioListId) { this.scenarioListId = scenarioListId; } /** * @hibernate.property * column="VIEW_NAME" * type="java.lang.String" * length="200" * not-null="false" * unique="false" */ public String getViewName() { return this.viewName; } public void setViewName(String viewName) { this.viewName = viewName; } /** * @hibernate.many-to-one * column="LARGESTRING_ID" * class="data4s.pinpoint.model.LargeString" * not-null="false" * unique="false" * cascade="delete" * --outer-join="false" */ public LargeString getDataXml() { return this.dataXml; } public void setDataXml(LargeString dataXml) { this.dataXml = dataXml; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioListData)) return false; ScenarioListData castOther = (ScenarioListData) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="LARGESTRING" */ public class LargeString implements Serializable { private static Log log = LogFactory.getLog(LargeString.class); private long id = -1; private String type; private Set parts; public LargeString() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_TYPE" * type="java.lang.String" * length="30" * not-null="true" * unique="false" */ public java.lang.String getType() { return this.type; } public void setType(java.lang.String type) { this.type = type; } /** * @hibernate.set * role="parts" * lazy="true" * cascade="delete" * --readonly="false" * sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.LargeStringPart" * @hibernate.collection-key * column="LARGESTRING_ID" */ public java.util.Set getParts() { return this.parts; } public void setParts(java.util.Set parts) { this.parts = parts; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeString)) return false; LargeString castOther = (LargeString) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public String getValue() { if (this.parts == null) { return null; } StringBuffer buf = new StringBuffer(); for (Iterator i = this.parts.iterator(); i.hasNext(); ) { LargeStringPart part = (LargeStringPart) i.next(); buf.append(part.getValue()); } return buf.toString(); } public void setValue(Session session, long largeStringId, String value) throws HibernateException, SQLException { // delete previous parts session.delete("from lsp in class LargeStringPart where lsp.largeStringId = ?", new Long(largeStringId), Hibernate.LONG); List valueParts = StringUtil.splitIntoParts(value, 2000); for (int i = 0; i < valueParts.size(); i++) { String valuePart = (String) valueParts.get(i); LargeStringPart part = new LargeStringPart(); part.setPartNumber(i); part.setValue(valuePart); part.setLargeStringId(largeStringId); session.saveOrUpdate(part); } } } /** * @hibernate.class table="LARGESTRING_PART" */ public class LargeStringPart implements Serializable, Comparable { private long id = -1; private long largeStringId; private String value; private int partNumber; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING_PART" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getLargeStringId() { return this.largeStringId; } public void setLargeStringId(long largeStringId) { this.largeStringId = largeStringId; } /** * @hibernate.property * column="PART_VALUE" * type="java.lang.String" * length="4000" * not-null="false" * unique="false" */ public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } /** * @hibernate.property * column="PART_NUMBER" * type="int" * not-null="false" * unique="false" */ public int getPartNumber() { return this.partNumber; } public void setPartNumber(int partNumber) { this.partNumber = partNumber; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeStringPart)) return false; LargeStringPart castOther = (LargeStringPart) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public int compareTo(Object other) { if (!(other instanceof LargeStringPart)) return -1; LargeStringPart castOther = (LargeStringPart) other; if (getPartNumber() < castOther.getPartNumber()) return -1; else if (getPartNumber() > castOther.getPartNumber()) return 1; return 0; } } Is this a known issue with 1.2? Regards, Hans --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 11:15:18
|
Message: The following issue has been closed. Resolver: Gavin King Date: Fri, 31 Oct 2003 5:14 AM Ummmmm are you /serious/? You honestly think I would believe that this is a bug in /Hibernate/??? Have you considered the fact that 1000s of other users do not report this behaviour - only *you*? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-16 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-16 Summary: session.find doesn't return any records while records exist in the database Type: Bug Status: Closed Priority: Blocker Resolution: REJECTED Project: Hibernate 1.2 Assignee: Reporter: Hans Keppens Created: Fri, 31 Oct 2003 5:00 AM Updated: Fri, 31 Oct 2003 5:14 AM Environment: Windows 2000 JBoss 3.2.1 + Tomcat 4.1.24 Hibernate 1.2 XDoclet for generating hibernate mapping xml files MS SQL database freeTDS driver cirrus.hibernate.sql.SybaseDialect DBCP connection pool Description: The problem is that session.find(<some query>) doesn't always return the rows I'm expecting. Apparantly, it is a timing issue, because sometimes it works fine (rows are returned), but in another run of the server, no rows are returned. The code never changes any values in the tables that are searched by session.find, so I would expect more deterministic behaviour... Some extra details: The case uses 4 classes: a class ScenarioList, a class ScenarioListData, a class LargeString and a class LargeStringPart. (LargeString and LargeStringPart are a kind of 'portable CLOB'...). Tables: SCENARIO_LIST ------------- ID: number(19) CONFIG_ID: number(19) ENTITY_NAME: varchar(50) LIST_NAME: varchar(200) SCENARIO_LIST_DATA ------------------ ID: number(19) LARGESTRING_ID: number(19) SCENARIO_LIST_ID: number(19) VIEW_NAME: varchar(200) LARGESTRING ----------- ID: number(19) LARGESTRING_TYPE: varchar(30) LARGESTRING_PART ---------------- ID: number(19) LARGESTRING_ID: number(19) PART_NUMBER: number(10) PART_VALUE: varchar(4000) These classes are linked to each other as follows (see below for the Hibernate classes). ScenarioList 1 --- * ScenarioListData ScenarioListData * --- 1 LargeString LargeString 1 --- * LargeStringPart For a given configId, entity and listName, I have a record in the database in the ScenarioList table and linked to it a record in the ScenarioListData table. Also, records in the LargeString and LargeStringPart tables exists. The following method SOMETIMES executes the code inside the "if (results.size() != 1)" block, and adds a warning to my logging: WARN direct query 1 results found, while results.size() = 0 public List getResults(long configId, String entity, String listName) throws HibernateException, SQLException { List result = session.find("from sl in class ScenarioList " + "where sl.configurationId = ? " + "and sl.entityName = ? " + "and sl.listName = ?", new Object[] { new Long(configId), entity, listName }, new NullableType[] { Hibernate.LONG, Hibernate.STRING, Hibernate.STRING }); if (result.size() != 1) { // trying direct SQL here, to prove session.find is wrong int count = 0; Connection con = session.connection(); PreparedStatement prepStat = null; ResultSet rs = null; try { prepStat = con.prepareStatement("select count(*) " + "from scenario_list " + "where config_id = ? " + "and entity_name = ? " + "and list_name = ?"); prepStat.setLong(1, configId); prepStat.setString(2, entity); prepStat.setString(3, listName); rs = prepStat.executeQuery(); if (rs.next()) { count = rs.getInt(1); } else { log.warn("direct query no count(*) data found!?"); } } finally { if (rs != null) { rs.close(); } if (prepStat != null) { prepStat.close(); } } if (count != result.size()) { log.warn("direct query " + count + " results found, while results.size() = " + result.size()); } return null; } return result; } Hibernate classes: /** * @hibernate.class table="SCENARIO_LIST" */ public class ScenarioList implements Serializable { private long id = -1; private long configurationId = -1; private String listName; private String entityName; private Set data; public ScenarioList() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST" */ public long getId() { return this.id; } /** * @hibernate.property * column="CONFIG_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getConfigurationId() { return this.configurationId; } /** * @hibernate.set * role="data" * lazy="true" * cascade="delete" * --readonly="false" * --sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.ScenarioListData" * @hibernate.collection-key * column="SCENARIO_LIST_ID" */ public Set getData() { return this.data; } /** * @hibernate.property * column="ENTITY_NAME" * type="java.lang.String" * length="50" * not-null="false" * unique="false" */ public String getEntityName() { return this.entityName; } /** * @hibernate.property * column="LIST_NAME" * type="java.lang.String" * length="200" * not-null="true" * unique="false" */ public String getListName() { return this.listName; } public void setConfigurationId(long configurationId) { this.configurationId = configurationId; } public void setData(Set data) { this.data = data; } public void setEntityName(String entityName) { this.entityName = entityName; } public void setId(long id) { this.id = id; } public void setListName(String listName) { this.listName = listName; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioList)) return false; ScenarioList castOther = (ScenarioList) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="SCENARIO_LIST_DATA" */ public class ScenarioListData { private long id = -1; private long scenarioListId; private String viewName; private LargeString dataXml; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST_DATA" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="SCENARIO_LIST_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getScenarioListId() { return this.scenarioListId; } public void setScenarioListId(long scenarioListId) { this.scenarioListId = scenarioListId; } /** * @hibernate.property * column="VIEW_NAME" * type="java.lang.String" * length="200" * not-null="false" * unique="false" */ public String getViewName() { return this.viewName; } public void setViewName(String viewName) { this.viewName = viewName; } /** * @hibernate.many-to-one * column="LARGESTRING_ID" * class="data4s.pinpoint.model.LargeString" * not-null="false" * unique="false" * cascade="delete" * --outer-join="false" */ public LargeString getDataXml() { return this.dataXml; } public void setDataXml(LargeString dataXml) { this.dataXml = dataXml; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioListData)) return false; ScenarioListData castOther = (ScenarioListData) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="LARGESTRING" */ public class LargeString implements Serializable { private static Log log = LogFactory.getLog(LargeString.class); private long id = -1; private String type; private Set parts; public LargeString() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_TYPE" * type="java.lang.String" * length="30" * not-null="true" * unique="false" */ public java.lang.String getType() { return this.type; } public void setType(java.lang.String type) { this.type = type; } /** * @hibernate.set * role="parts" * lazy="true" * cascade="delete" * --readonly="false" * sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.LargeStringPart" * @hibernate.collection-key * column="LARGESTRING_ID" */ public java.util.Set getParts() { return this.parts; } public void setParts(java.util.Set parts) { this.parts = parts; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeString)) return false; LargeString castOther = (LargeString) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public String getValue() { if (this.parts == null) { return null; } StringBuffer buf = new StringBuffer(); for (Iterator i = this.parts.iterator(); i.hasNext(); ) { LargeStringPart part = (LargeStringPart) i.next(); buf.append(part.getValue()); } return buf.toString(); } public void setValue(Session session, long largeStringId, String value) throws HibernateException, SQLException { // delete previous parts session.delete("from lsp in class LargeStringPart where lsp.largeStringId = ?", new Long(largeStringId), Hibernate.LONG); List valueParts = StringUtil.splitIntoParts(value, 2000); for (int i = 0; i < valueParts.size(); i++) { String valuePart = (String) valueParts.get(i); LargeStringPart part = new LargeStringPart(); part.setPartNumber(i); part.setValue(valuePart); part.setLargeStringId(largeStringId); session.saveOrUpdate(part); } } } /** * @hibernate.class table="LARGESTRING_PART" */ public class LargeStringPart implements Serializable, Comparable { private long id = -1; private long largeStringId; private String value; private int partNumber; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING_PART" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getLargeStringId() { return this.largeStringId; } public void setLargeStringId(long largeStringId) { this.largeStringId = largeStringId; } /** * @hibernate.property * column="PART_VALUE" * type="java.lang.String" * length="4000" * not-null="false" * unique="false" */ public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } /** * @hibernate.property * column="PART_NUMBER" * type="int" * not-null="false" * unique="false" */ public int getPartNumber() { return this.partNumber; } public void setPartNumber(int partNumber) { this.partNumber = partNumber; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeStringPart)) return false; LargeStringPart castOther = (LargeStringPart) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public int compareTo(Object other) { if (!(other instanceof LargeStringPart)) return -1; LargeStringPart castOther = (LargeStringPart) other; if (getPartNumber() < castOther.getPartNumber()) return -1; else if (getPartNumber() > castOther.getPartNumber()) return 1; return 0; } } Is this a known issue with 1.2? Regards, Hans --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 11:02:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-16 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-16 Summary: session.find doesn't return any records while records exist in the database Type: Bug Status: Unassigned Priority: Blocker Project: Hibernate 1.2 Assignee: Reporter: Hans Keppens Created: Fri, 31 Oct 2003 5:00 AM Updated: Fri, 31 Oct 2003 5:00 AM Environment: Windows 2000 JBoss 3.2.1 + Tomcat 4.1.24 Hibernate 1.2 XDoclet for generating hibernate mapping xml files MS SQL database freeTDS driver cirrus.hibernate.sql.SybaseDialect DBCP connection pool Description: The problem is that session.find(<some query>) doesn't always return the rows I'm expecting. Apparantly, it is a timing issue, because sometimes it works fine (rows are returned), but in another run of the server, no rows are returned. The code never changes any values in the tables that are searched by session.find, so I would expect more deterministic behaviour... Some extra details: The case uses 4 classes: a class ScenarioList, a class ScenarioListData, a class LargeString and a class LargeStringPart. (LargeString and LargeStringPart are a kind of 'portable CLOB'...). Tables: SCENARIO_LIST ------------- ID: number(19) CONFIG_ID: number(19) ENTITY_NAME: varchar(50) LIST_NAME: varchar(200) SCENARIO_LIST_DATA ------------------ ID: number(19) LARGESTRING_ID: number(19) SCENARIO_LIST_ID: number(19) VIEW_NAME: varchar(200) LARGESTRING ----------- ID: number(19) LARGESTRING_TYPE: varchar(30) LARGESTRING_PART ---------------- ID: number(19) LARGESTRING_ID: number(19) PART_NUMBER: number(10) PART_VALUE: varchar(4000) These classes are linked to each other as follows (see below for the Hibernate classes). ScenarioList 1 --- * ScenarioListData ScenarioListData * --- 1 LargeString LargeString 1 --- * LargeStringPart For a given configId, entity and listName, I have a record in the database in the ScenarioList table and linked to it a record in the ScenarioListData table. Also, records in the LargeString and LargeStringPart tables exists. The following method SOMETIMES executes the code inside the "if (results.size() != 1)" block, and adds a warning to my logging: WARN direct query 1 results found, while results.size() = 0 public List getResults(long configId, String entity, String listName) throws HibernateException, SQLException { List result = session.find("from sl in class ScenarioList " + "where sl.configurationId = ? " + "and sl.entityName = ? " + "and sl.listName = ?", new Object[] { new Long(configId), entity, listName }, new NullableType[] { Hibernate.LONG, Hibernate.STRING, Hibernate.STRING }); if (result.size() != 1) { // trying direct SQL here, to prove session.find is wrong int count = 0; Connection con = session.connection(); PreparedStatement prepStat = null; ResultSet rs = null; try { prepStat = con.prepareStatement("select count(*) " + "from scenario_list " + "where config_id = ? " + "and entity_name = ? " + "and list_name = ?"); prepStat.setLong(1, configId); prepStat.setString(2, entity); prepStat.setString(3, listName); rs = prepStat.executeQuery(); if (rs.next()) { count = rs.getInt(1); } else { log.warn("direct query no count(*) data found!?"); } } finally { if (rs != null) { rs.close(); } if (prepStat != null) { prepStat.close(); } } if (count != result.size()) { log.warn("direct query " + count + " results found, while results.size() = " + result.size()); } return null; } return result; } Hibernate classes: /** * @hibernate.class table="SCENARIO_LIST" */ public class ScenarioList implements Serializable { private long id = -1; private long configurationId = -1; private String listName; private String entityName; private Set data; public ScenarioList() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST" */ public long getId() { return this.id; } /** * @hibernate.property * column="CONFIG_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getConfigurationId() { return this.configurationId; } /** * @hibernate.set * role="data" * lazy="true" * cascade="delete" * --readonly="false" * --sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.ScenarioListData" * @hibernate.collection-key * column="SCENARIO_LIST_ID" */ public Set getData() { return this.data; } /** * @hibernate.property * column="ENTITY_NAME" * type="java.lang.String" * length="50" * not-null="false" * unique="false" */ public String getEntityName() { return this.entityName; } /** * @hibernate.property * column="LIST_NAME" * type="java.lang.String" * length="200" * not-null="true" * unique="false" */ public String getListName() { return this.listName; } public void setConfigurationId(long configurationId) { this.configurationId = configurationId; } public void setData(Set data) { this.data = data; } public void setEntityName(String entityName) { this.entityName = entityName; } public void setId(long id) { this.id = id; } public void setListName(String listName) { this.listName = listName; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioList)) return false; ScenarioList castOther = (ScenarioList) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="SCENARIO_LIST_DATA" */ public class ScenarioListData { private long id = -1; private long scenarioListId; private String viewName; private LargeString dataXml; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="SCENARIO_LIST_DATA" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="SCENARIO_LIST_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getScenarioListId() { return this.scenarioListId; } public void setScenarioListId(long scenarioListId) { this.scenarioListId = scenarioListId; } /** * @hibernate.property * column="VIEW_NAME" * type="java.lang.String" * length="200" * not-null="false" * unique="false" */ public String getViewName() { return this.viewName; } public void setViewName(String viewName) { this.viewName = viewName; } /** * @hibernate.many-to-one * column="LARGESTRING_ID" * class="data4s.pinpoint.model.LargeString" * not-null="false" * unique="false" * cascade="delete" * --outer-join="false" */ public LargeString getDataXml() { return this.dataXml; } public void setDataXml(LargeString dataXml) { this.dataXml = dataXml; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof ScenarioListData)) return false; ScenarioListData castOther = (ScenarioListData) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } } /** * @hibernate.class table="LARGESTRING" */ public class LargeString implements Serializable { private static Log log = LogFactory.getLog(LargeString.class); private long id = -1; private String type; private Set parts; public LargeString() { } /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_TYPE" * type="java.lang.String" * length="30" * not-null="true" * unique="false" */ public java.lang.String getType() { return this.type; } public void setType(java.lang.String type) { this.type = type; } /** * @hibernate.set * role="parts" * lazy="true" * cascade="delete" * --readonly="false" * sort="natural" * --order-by="columnName" * @hibernate.collection-one-to-many * class="data4s.pinpoint.model.LargeStringPart" * @hibernate.collection-key * column="LARGESTRING_ID" */ public java.util.Set getParts() { return this.parts; } public void setParts(java.util.Set parts) { this.parts = parts; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeString)) return false; LargeString castOther = (LargeString) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public String getValue() { if (this.parts == null) { return null; } StringBuffer buf = new StringBuffer(); for (Iterator i = this.parts.iterator(); i.hasNext(); ) { LargeStringPart part = (LargeStringPart) i.next(); buf.append(part.getValue()); } return buf.toString(); } public void setValue(Session session, long largeStringId, String value) throws HibernateException, SQLException { // delete previous parts session.delete("from lsp in class LargeStringPart where lsp.largeStringId = ?", new Long(largeStringId), Hibernate.LONG); List valueParts = StringUtil.splitIntoParts(value, 2000); for (int i = 0; i < valueParts.size(); i++) { String valuePart = (String) valueParts.get(i); LargeStringPart part = new LargeStringPart(); part.setPartNumber(i); part.setValue(valuePart); part.setLargeStringId(largeStringId); session.saveOrUpdate(part); } } } /** * @hibernate.class table="LARGESTRING_PART" */ public class LargeStringPart implements Serializable, Comparable { private long id = -1; private long largeStringId; private String value; private int partNumber; /** * @hibernate.id * column="ID" * type="long" * length="9" * unsaved-value="-1" * generator-class="data4s.pinpoint.hibernate.IdentifierGenerator" * generator-class-parameter-1="LARGESTRING_PART" */ public long getId() { return this.id; } public void setId(long id) { this.id = id; } /** * @hibernate.property * column="LARGESTRING_ID" * type="long" * length="9" * not-null="false" * unique="false" */ public long getLargeStringId() { return this.largeStringId; } public void setLargeStringId(long largeStringId) { this.largeStringId = largeStringId; } /** * @hibernate.property * column="PART_VALUE" * type="java.lang.String" * length="4000" * not-null="false" * unique="false" */ public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } /** * @hibernate.property * column="PART_NUMBER" * type="int" * not-null="false" * unique="false" */ public int getPartNumber() { return this.partNumber; } public void setPartNumber(int partNumber) { this.partNumber = partNumber; } public String toString() { return "not implemented"; } public boolean equals(Object other) { if (!(other instanceof LargeStringPart)) return false; LargeStringPart castOther = (LargeStringPart) other; return new EqualsBuilder().append(this.id, castOther.id).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(id).toHashCode(); } public int compareTo(Object other) { if (!(other instanceof LargeStringPart)) return -1; LargeStringPart castOther = (LargeStringPart) other; if (getPartNumber() < castOther.getPartNumber()) return -1; else if (getPartNumber() > castOther.getPartNumber()) return 1; return 0; } } Is this a known issue with 1.2? Regards, Hans --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 11:00:14
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Fri, 31 Oct 2003 5:00 AM Body: Please provide the property names, instead of just inserting "..." ;) (a complete hbm.xml would be great ,) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-440 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-440 Summary: Direct collection property access Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 5 Assignee: Reporter: Alexey Kaigorodov Created: Fri, 31 Oct 2003 3:26 AM Updated: Fri, 31 Oct 2003 3:26 AM Description: <bag name="..." access="field"> ... </bag> causes exception unless exists getter net.sf.hibernate.MappingException: Problem trying to set property type by reflection at net.sf.hibernate.mapping.Value.setTypeByReflection(Value.java:103) at net.sf.hibernate.cfg.Binder.createProperty(Binder.java:953) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:946) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:313) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1143) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:243) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:266) at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:349) at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:320) ... Caused by: net.sf.hibernate.PropertyNotFoundException: Could not find a getter for ... in class ... -- With best regards, Alexey --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-31 10:50:14
|
The following comment has been added to this issue: Author: Gavin King Created: Fri, 31 Oct 2003 4:49 AM Body: There is another way. You can hack the SQL delimiter option. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-441 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-441 Summary: Allow dialect specific table options in create table scripts Type: Improvement Status: Closed Priority: Major Resolution: WON'T FIX Project: Hibernate2 Assignee: Reporter: Maarten Coene Created: Fri, 31 Oct 2003 4:24 AM Updated: Fri, 31 Oct 2003 4:27 AM Environment: all Description: Hi, I need support for table_options in the MySQL create table syntax. The MySQL create syntax looks like: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [select_statement] I don't know if ohter databases can have table_options in their create scripts. The reason I need this is that I want to create tables using the SchemaExport tool and these tables must have the InnoDB type, this means I have to create SQL commands like: CREATE mytable (...) TYPE=INNODB; I want to solve my problem by creating my own dialect (e.g. InnoDbMySQLDialect extends MySQLDialect) but I didn't find a way to specify these table_options with the current implementation. To allow these table_options, I propose the following mimimal changes to your code: 1. add this method to Dialect.java: public String getTableOptions() { return ""; } 2. change the sqlCreateString(Dialect dialect, Mapping p) method of Table.java (add this to the end of the method): buf.append(StringHelper.CLOSE_PAREN); buf.append(" "); // ADD THIS LINE buf.append(dialect.getTableOptions()); // ADD THIS LINE return buf.toString(); This way, I can easily create my own dialect: public class InnoDbMySQLDialect extends MySQLDialect { public String getTableOptions() { return "TYPE=INNODB"; } } kind regards, Maarten Coene --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |