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: Budhaditya (JIRA) <no...@at...> - 2006-05-16 14:45:19
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comments#action_23107 ] Budhaditya commented on HHH-1: ------------------------------ Hibernate Bulk Insert is not Working for me..... Hi, I am using hibernate version 3.1.2 spring version 2.0 In my test-beans.xml I have these following entries...... <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> ............ ............ <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> <prop key="hibernate.hbm2ddl.auto">create</prop> <prop key="hibernate.show_sql">false</prop> <prop key="hibernate.cache.use_second_level_cache">false</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_structured_entries">true</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.jdbc.batch_size">35</prop> </props> </property> .................... </bean> Now two important things to note here is 1. hibernate.cache.use_second_level_cache set to false 2. hibernate.jdbc.batch_size set to 35 Now I believe this is all the setting needed. My model names are Components and Process. for Bulk insert I was trying this.... for (int i = 0; i < 1000; i++) { hibernateTemplate.save(components.get(i)); } for (int i = 0; i < 1000; i++) { hibernateTemplate.save(processes.get(i)); } Instead of Single insert like this..... for (int i = 0; i < 1000; i++) { hibernateTemplate.save(components.get(i)); hibernateTemplate.save(processes.get(i)); } My problem is that both way the time taken is the same........... I tried putting trace on SQL database and I dint see any difference in queries also....... Can u please help me and tell me how do I make this Hibernate Bulk Insert Work???? Thanks and waitng in anticipation.... > Optimize Hibernate for the bulk insertion of related entities > ------------------------------------------------------------- > > Key: HHH-1 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1 > Project: Hibernate3 > Type: New Feature > Components: core > Environment: Hibernate 1.2, MySql 3.1 > Reporter: Bradley Leupen > Priority: Minor > > > It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. > Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-05-16 14:15:16
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1752?page=all ] Christian Bauer resolved HHH-1752: ---------------------------------- Resolution: Rejected http://forum.hibernate.org > org.hibernate.QueryException: could not resolve property > -------------------------------------------------------- > > Key: HHH-1752 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1752 > Project: Hibernate3 > Type: Bug > Components: query-hql > Versions: 3.1 > Environment: Linux, Struts > Reporter: SSD > Priority: Blocker > > Original Estimate: 3 weeks > Remaining: 3 weeks > > I am getting exception(could not resolve property) when I do the following query : > Query q1 = newSession.createQuery("from VsDomains domains where domains.dns_profile_id = :dns_profile") > But everything is fine when I do the one below : > Query q1 = newSession.createQuery("from VsDomains where dns_profile_id = :dns_profile_id"); > Why is this occuring ? > The VsDomains.hbm.xml file is as follows : > <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> > <!-- Generated May 12, 2006 11:21:53 AM by Hibernate Tools 3.1.0 beta3 --> > <hibernate-mapping> > <class name="VsDomains" table="VS_DOMAINS"> > <id name="assetId" type="java.lang.Long"> > <column name="ASSET_ID" precision="22" scale="0" /> > <generator class="assigned" /> > </id> > <many-to-one name="vsMdnsAccountT" class="VsMdnsAccountT" fetch="select"> > <column name="MDNS_ACCOUNT_NAME" length="100" /> > </many-to-one> > <many-to-one name="vsRegistrationProfileT" class="VsRegistrationProfileT" fetch="select"> > <column name="REG_PROFILE_ID" precision="22" scale="0" /> > </many-to-one> > .................................. > here is the property ---------> <property name="dnsProfileId" type="java.lang.Long"> > <column name="DNS_PROFILE_ID" precision="22" scale="0" not-null="false" /> > </property> > ---------------> > <property name="notes" type="string"> > <column name="NOTES" length="4000" /> > </property> > <property name="renewalDate" type="java.lang.Long"> > <column name="RENEWAL_DATE" precision="22" scale="0" /> > </property> > ... > Exception full stack: > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hibernate.transaction.JDBCTransaction> current autocommit status: false > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hibernate.jdbc.JDBCContext> after transaction begin > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <engine.query.QueryPlanCache> unable to locate HQL query plan in cache; generating (from VsDomains d where d.dns_profile_id = :dns_profile_id) > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.ast.QueryTranslatorImpl> parse() - HQL: from VsDomains d where d.dns_profile_id = :dns_profile_id > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.ast.AST> --- HQL AST --- > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.ast.ErrorCounter> throwQueryException() : no errors > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.antlr.HqlSqlBaseWalker> select << begin [level=1, statement=select] > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <ast.tree.FromElement> FromClause{level=1} : com.verisign.dbms.portal.VsDomains (d) -> vsdomains0_ > DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <ast.tree.FromReferenceNode> Resolved : d -> vsdomains0_.ASSET_ID > INFO 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <com.verisign.dbms> <kshobhana-lnx.corpc.vrsn.com><DBMS><><DBMS-DBMS><><><EditAdminDNSProfileAction: Exception during Modify @loc#1org.hibernate.QueryException: could not resolve property: dns_profile_id of: VsDomains [from VsDomains d where d.dns_profile_id = :dns_profile_id]> -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-05-16 14:15:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1755?page=all ] Christian Bauer resolved HHH-1755: ---------------------------------- Resolution: Rejected http://forum.hibernate.org/ > Associating tables from two different databases > ----------------------------------------------- > > Key: HHH-1755 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1755 > Project: Hibernate3 > Type: New Feature > Components: query-criteria > Versions: 3.2.0.cr2 > Environment: Oracle and SQL Server 2000 > Reporter: Mohammed Sadiq > > > Hi, > I am trying to build an environment where it is required to have more than one databases. > For example, let's take the case of a Masters and Transactions; I have country table at a databse named 'Masters' located in an Oracle server and another named 'Transactions' located in a SQL Server. > I have a table named 'Enquiry' located in the 'Transactions' database (SQL Server) and another table 'Country' located in the 'Masters' database (Oracle); now I need to associate a column 'Country_Id' of 'Enquiry' table to that of 'Country_Id' of 'Country' table and fetch the country name from that table. > How should I get it done. > I tried to build two Session from the two configuration files, but in vain. > Please help me to resolve this and please excuse me if I am posting an issue over an already available feature of Hibernate. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Mohammed S. (JIRA) <no...@at...> - 2006-05-16 06:04:14
|
Associating tables from two different databases ----------------------------------------------- Key: HHH-1755 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1755 Project: Hibernate3 Type: New Feature Components: query-criteria Versions: 3.2.0.cr2 Environment: Oracle and SQL Server 2000 Reporter: Mohammed Sadiq Hi, I am trying to build an environment where it is required to have more than one databases. For example, let's take the case of a Masters and Transactions; I have country table at a databse named 'Masters' located in an Oracle server and another named 'Transactions' located in a SQL Server. I have a table named 'Enquiry' located in the 'Transactions' database (SQL Server) and another table 'Country' located in the 'Masters' database (Oracle); now I need to associate a column 'Country_Id' of 'Enquiry' table to that of 'Country_Id' of 'Country' table and fetch the country name from that table. How should I get it done. I tried to build two Session from the two configuration files, but in vain. Please help me to resolve this and please excuse me if I am posting an issue over an already available feature of Hibernate. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Mark (JIRA) <no...@at...> - 2006-05-16 04:47:11
|
Classes in linked folders are not found --------------------------------------- Key: HBX-662 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-662 Project: Hibernate Tools Type: Bug Components: eclipse Versions: 3.1.beta5 Environment: Eclipse 3.1.1, JDK 1.4 Reporter: Mark "Hibernate Configurations" widget shows class not found for classes that are linked to an external directory. By External directory I mean a directory that is set as build location by using the "Link to folder in the file system" under Project Properties->"Java Build Path"->"Default output folder"->"Browse"->"Create new folder"->"Advanced" I can pick this path in the "Hibernate Console Configuration"->"Add JAR/Dir", but the class is not picked up. When I move the build directory to a directory that is physically located inside the Eclipse project tree it works. MARK -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Tobias (JIRA) <no...@at...> - 2006-05-16 04:23:11
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1189?page=comments#action_23104 ] Tobias commented on HHH-1189: ----------------------------- Unless this is fixed in the source you need to pull the sources, apply the fix youself and compile your own hibernate version. Another option is to let the superclass use a interface as the proxy. That would be a workaround. > interfaces for Proxies are not regonized as interfaces > ------------------------------------------------------ > > Key: HHH-1189 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1189 > Project: Hibernate3 > Type: Patch > Components: core > Versions: 3.1 rc3 > Environment: Discovered on Hibernate 3.0, still present in 3.1rc3 > Reporter: Tobias > Assignee: Steve Ebersole > Priority: Critical > > Original Estimate: 1 hour > Remaining: 1 hour > > In org.hibernate.tuple.PojoEntityTuplizer line 119 reads: > if ( !proxyInterface.isInterface() ) { > and should be > if ( !subclassClass.isInterface() ) { > So the code then would look like this: > Subclass subclass = ( Subclass ) iter.next(); > Class subclassProxy = subclass.getProxyInterface(); > Class subclassClass = subclass.getMappedClass(); > if ( subclassProxy!=null && !subclassClass.equals( subclassProxy ) ) { > if ( !subclassProxy.isInterface() ) { // HERE! > throw new MappingException( > "proxy must be either an interface, or the class itself: " + > subclass.getEntityName() > ); > } > proxyInterfaces.add( subclassProxy ); > } > After that change the specified interfaces for subclass proxies are regonized as such. Without this patch the superclass is checked, which may not have/be an interface as proxy class. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Carey E. (JIRA) <no...@at...> - 2006-05-16 01:44:12
|
Sequence support for DB2400Dialect ---------------------------------- Key: HHH-1754 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1754 Project: Hibernate3 Type: Improvement Components: core Versions: 3.1.3 Environment: Hibernate 3.1.3, IBM DB2 UDB for iSeries on i5/OS V5R3 Reporter: Carey Evans Priority: Minor Attachments: DB2400Dialect.java As of i5/OS V5R3 (the operating system previously known as OS/400), DB2 supports sequences, but DB2400Dialect doesn't include support for the new functionality. This support can be modelled on DB2Dialect, except that "values ..." must be written "select ... from sysibm.sysdummy1", and the syssequences view is in the qsys2 schema. I don't know what impact this change would have on older versions of OS/400 that don't support sequences. The attached DB2400Dialect source includes sequence support, with some additional minor corrections for timestamps on i5/OS. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Carey E. (JIRA) <no...@at...> - 2006-05-16 01:19:12
|
DB2Dialect.getCurrentTimestampSQLFunctionName() uses Oracle syntax ------------------------------------------------------------------ Key: HHH-1753 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1753 Project: Hibernate3 Type: Bug Components: core Versions: 3.1.3 Environment: Hibernate 3.1.3, DB2 UDB Express-C 8.1 on Windows XP Professional SP2 Reporter: Carey Evans Priority: Minor The DB2Dialect class overrides Dialect.getCurrentTimestampSQLFunctionName() to return "sysdate". However, DB2 supports the standard "current_timestamp" value, not the new value, which appears to be from Oracle: db2 => select sysdate from sysibm.sysdummy1 SQL0206N "SYSDATE" is not valid in the context where it is used. SQLSTATE=42703 db2 => select current_timestamp from sysibm.sysdummy1 1 -------------------------- 2006-05-16-13.13.47.625000 1 record(s) selected. It looks to me like the method should be removed from the DB2Dialect class. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: SSD (JIRA) <no...@at...> - 2006-05-16 00:10:17
|
org.hibernate.QueryException: could not resolve property -------------------------------------------------------- Key: HHH-1752 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1752 Project: Hibernate3 Type: Bug Components: query-hql Versions: 3.1 Environment: Linux, Struts Reporter: SSD Priority: Blocker I am getting exception(could not resolve property) when I do the following query : Query q1 = newSession.createQuery("from VsDomains domains where domains.dns_profile_id = :dns_profile") But everything is fine when I do the one below : Query q1 = newSession.createQuery("from VsDomains where dns_profile_id = :dns_profile_id"); Why is this occuring ? The VsDomains.hbm.xml file is as follows : <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated May 12, 2006 11:21:53 AM by Hibernate Tools 3.1.0 beta3 --> <hibernate-mapping> <class name="VsDomains" table="VS_DOMAINS"> <id name="assetId" type="java.lang.Long"> <column name="ASSET_ID" precision="22" scale="0" /> <generator class="assigned" /> </id> <many-to-one name="vsMdnsAccountT" class="VsMdnsAccountT" fetch="select"> <column name="MDNS_ACCOUNT_NAME" length="100" /> </many-to-one> <many-to-one name="vsRegistrationProfileT" class="VsRegistrationProfileT" fetch="select"> <column name="REG_PROFILE_ID" precision="22" scale="0" /> </many-to-one> .................................. here is the property ---------> <property name="dnsProfileId" type="java.lang.Long"> <column name="DNS_PROFILE_ID" precision="22" scale="0" not-null="false" /> </property> ---------------> <property name="notes" type="string"> <column name="NOTES" length="4000" /> </property> <property name="renewalDate" type="java.lang.Long"> <column name="RENEWAL_DATE" precision="22" scale="0" /> </property> ... Exception full stack: DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hibernate.transaction.JDBCTransaction> current autocommit status: false DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hibernate.jdbc.JDBCContext> after transaction begin DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <engine.query.QueryPlanCache> unable to locate HQL query plan in cache; generating (from VsDomains d where d.dns_profile_id = :dns_profile_id) DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.ast.QueryTranslatorImpl> parse() - HQL: from VsDomains d where d.dns_profile_id = :dns_profile_id DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.ast.AST> --- HQL AST --- DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.ast.ErrorCounter> throwQueryException() : no errors DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <hql.antlr.HqlSqlBaseWalker> select << begin [level=1, statement=select] DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <ast.tree.FromElement> FromClause{level=1} : com.verisign.dbms.portal.VsDomains (d) -> vsdomains0_ DEBUG 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <ast.tree.FromReferenceNode> Resolved : d -> vsdomains0_.ASSET_ID INFO 05/15/2006 17:08:02 <ExecuteThread: '59' for queue: 'default'> <com.verisign.dbms> <kshobhana-lnx.corpc.vrsn.com><DBMS><><DBMS-DBMS><><><EditAdminDNSProfileAction: Exception during Modify @loc#1org.hibernate.QueryException: could not resolve property: dns_profile_id of: VsDomains [from VsDomains d where d.dns_profile_id = :dns_profile_id]> -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Maarten W. (JIRA) <no...@at...> - 2006-05-16 00:02:21
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1751?page=all ] Maarten Winkels updated HHH-1751: --------------------------------- Attachment: scroll-fetch-collection.patch This patch seems to solve the problem. In short, it involves not ending the collection loading for collections that do not have the currently loaded entity as parent. Of course this rule can olny be invoked when a single entity is loaded, as the root entity with scrollable results. > Collection corruptly loaded when join fetching and scrolling (org.hibernate.impl.FetchingScrollableResultsImpl) > --------------------------------------------------------------------------------------------------------------- > > Key: HHH-1751 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1751 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.2.0.cr2 > Reporter: Maarten Winkels > Attachments: Child.java, HQLScrollFetchTest.java, Parent.java, ParentChild.hbm.xml, scroll-fetch-collection.patch > > > When scrolling a query that has a jon fetch on a collection (set), the collection is not loaded correctly. It appears that only the first item in the collection is correctly loaded. > Th attached tests show this behaviour, as well as a number of orderings in the query to show how the collection is corruptly loaded. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Maarten W. (JIRA) <no...@at...> - 2006-05-15 22:14:15
|
Collection corruptly loaded when join fetching and scrolling (org.hibernate.impl.FetchingScrollableResultsImpl) --------------------------------------------------------------------------------------------------------------- Key: HHH-1751 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1751 Project: Hibernate3 Type: Bug Components: core Versions: 3.2.0.cr2 Reporter: Maarten Winkels Attachments: Child.java, HQLScrollFetchTest.java, Parent.java, ParentChild.hbm.xml When scrolling a query that has a jon fetch on a collection (set), the collection is not loaded correctly. It appears that only the first item in the collection is correctly loaded. Th attached tests show this behaviour, as well as a number of orderings in the query to show how the collection is corruptly loaded. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Maarten W. (JIRA) <no...@at...> - 2006-05-15 22:14:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1751?page=all ] Maarten Winkels updated HHH-1751: --------------------------------- Attachment: Child.java > Collection corruptly loaded when join fetching and scrolling (org.hibernate.impl.FetchingScrollableResultsImpl) > --------------------------------------------------------------------------------------------------------------- > > Key: HHH-1751 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1751 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.2.0.cr2 > Reporter: Maarten Winkels > Attachments: Child.java, HQLScrollFetchTest.java, Parent.java, ParentChild.hbm.xml > > > When scrolling a query that has a jon fetch on a collection (set), the collection is not loaded correctly. It appears that only the first item in the collection is correctly loaded. > Th attached tests show this behaviour, as well as a number of orderings in the query to show how the collection is corruptly loaded. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christopher G. S. II (JIRA) <no...@at...> - 2006-05-15 20:05:33
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-302?page=comments#action_23102 ] Christopher G. Stach II commented on ANN-302: --------------------------------------------- In the final version, I don't really enjoy how they specified that it must only be used on Date or Calendar fields, yet left TIMESTAMP and java.sql.Timestamp in the TemporalType enum. > @Temporal should work on java.sql.Timestamp properties > ------------------------------------------------------ > > Key: ANN-302 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-302 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.1beta9 > Reporter: Christopher G. Stach II > Assignee: Emmanuel Bernard > > -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-05-15 19:34:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1258?page=comments#action_23101 ] Max Rydahl Andersen commented on HHH-1258: ------------------------------------------ Need to investigate: ReflectHelper.overridesEquals(clazz) is called evertyime a BasicLazyInitializer is created and this seem to affect high usage of 2nd lvl cache. (8254) > startup time improvements > ------------------------- > > Key: HHH-1258 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1258 > Project: Hibernate3 > Type: Improvement > Components: core > Versions: 3.1 rc3 > Reporter: Max Rydahl Andersen > Assignee: Max Rydahl Andersen > > > while doing some basic startup perf testing the following were found - this issue is mainly to track what I find, and then fix it: > Initial tests where 100 classes, 30 sec for buildSessionFactory > setting hibernate.cglib.use_reflection_optimizer false and it is 10 sec for buildSessionFactory. > (maybe we should autodetect which jdk we are running on and disable it per default for 1.4/1.5 - needs to validate runtime impact) > Another (22%) time stealer is the discovery of getter/setters - in worst case it iterates over all declared methods per property. > (alternatively we could cache/sort this list or make a more efficient implementation if a class only contain default property accessors) > Other 20% of the time is done in net.sf.cglib related classes for build time enhancement. > The rest of the time is Configuration creation (can be cached) and other iteration code. > (p.s. don't take the % numbers as hard values - these are definitly affected by how many methods/classes you have; this underlying tests > is done on pojos with a "high" method count (approx 100) -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Oleg S. K. (JIRA) <no...@at...> - 2006-05-15 19:32:21
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1189?page=comments#action_23099 ] Oleg S. Kobyzev commented on HHH-1189: -------------------------------------- Hi , I have the same issue in version 3.1.3. Could you please provide me an information about how this isssue can be fixed or how can I get round this issue. thank you in Advance! > interfaces for Proxies are not regonized as interfaces > ------------------------------------------------------ > > Key: HHH-1189 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1189 > Project: Hibernate3 > Type: Patch > Components: core > Versions: 3.1 rc3 > Environment: Discovered on Hibernate 3.0, still present in 3.1rc3 > Reporter: Tobias > Assignee: Steve Ebersole > Priority: Critical > > Original Estimate: 1 hour > Remaining: 1 hour > > In org.hibernate.tuple.PojoEntityTuplizer line 119 reads: > if ( !proxyInterface.isInterface() ) { > and should be > if ( !subclassClass.isInterface() ) { > So the code then would look like this: > Subclass subclass = ( Subclass ) iter.next(); > Class subclassProxy = subclass.getProxyInterface(); > Class subclassClass = subclass.getMappedClass(); > if ( subclassProxy!=null && !subclassClass.equals( subclassProxy ) ) { > if ( !subclassProxy.isInterface() ) { // HERE! > throw new MappingException( > "proxy must be either an interface, or the class itself: " + > subclass.getEntityName() > ); > } > proxyInterfaces.add( subclassProxy ); > } > After that change the specified interfaces for subclass proxies are regonized as such. Without this patch the superclass is checked, which may not have/be an interface as proxy class. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-05-15 19:32:18
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1724?page=all ] Max Rydahl Andersen closed HHH-1724: ------------------------------------ Resolution: Won't Fix decided not to change this since it was not aligned greatly before and we would not be able to provide a good backwards compatible workaround at the moment. > Critieria needs to be aligned with new aggreation type rules > ------------------------------------------------------------ > > Key: HHH-1724 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1724 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Max Rydahl Andersen > Assignee: Max Rydahl Andersen > Priority: Blocker > > > Criteria does not ask the dialect about the type + it does not always seem to know what the underlying field type is..... > created as blocker to make sure we either document or fix it. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andreas D. (JIRA) <no...@at...> - 2006-05-15 11:47:16
|
Exception ORA-01000 too many open cursors by generated="insert" --------------------------------------------------------------- Key: HHH-1750 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 Project: Hibernate3 Type: Bug Environment: Hibernate3, Oracle10g Reporter: Andreas Dornhof When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File causes an ORA-01000 "too many open cursors"... It is executed using the following Java code: SessionFactory sessionFactory; try { // Create the SessionFactory from hibernate.cfg.xml sessionFactory = new Configuration(). configure(). buildSessionFactory(); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); throw new ExceptionInInitializerError(ex); } try{ for (int i = 0; i <= 301; i++) { Session session = sessionFactory.getCurrentSession(); Transaction tx = session.beginTransaction(); Test test = new Test(); session.save(test); tx.commit(); } } catch (Exception e) { System.out.println(e.getMessage()+e.getClass().toString()); } And Mapping - File: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > <hibernate-mapping> <class name="src.persistence.Test" table="TEST" > <id name="id" type="java.lang.Long" column="ID" > <generator class="sequence"> <param name="sequence">TEST_SEQ</param> </generator> </id> <property name="created" column="CREATED" type="java.util.Date" not-null="true" insert="false" update="false" generated="insert" > </property> </class> </hibernate-mapping> -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Ignat Z. (JIRA) <no...@at...> - 2006-05-15 06:56:14
|
Convert discriminator field value into class name or class when discriminator field purposedly returned in query ---------------------------------------------------------------------------------------------------------------- Key: HHH-1749 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1749 Project: Hibernate3 Type: Improvement Versions: 3.0.5 Environment: Win XP SP2, JDK 1.5.0_05, Hibernate 3.0.5 Reporter: Ignat Zapolsky It is possible to obtain discriminator field by specifying it in query, it is possible to use it since hibernate automatically replaces entity.class with discriminator column and converts class into associated discriminator value. But retreival of such field is useless since user cannot obtain .class from returned discriminator value and Hibernate expects .class, not discriminator in queries. Sample query : select cat.class from my.Cat as cat where ... -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Winter L. (JIRA) <no...@at...> - 2006-05-15 00:50:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1293?page=comments#action_23098 ] Winter Lau commented on HHH-1293: --------------------------------- I found the problem already present in hibernate 3.2 rc2 without -server parameter. Environment: RedHat Enterprise Linux AS 4 Tomcat 5.5.17 SUN JDK 1.5.0_06 > java.lang.NoSuchMethodError: <persistent class>.getHibernateLazyInitializer() > ----------------------------------------------------------------------------- > > Key: HHH-1293 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1293 > Project: Hibernate3 > Type: Bug > Versions: 3.1.1 > Reporter: Andreas Schildbach > Priority: Blocker > Attachments: manysessions.tgz > > > As documented in > http://forum.hibernate.org/viewtopic.php?t=940119 > some people (including me) are getting this exception with the final release of Hibernate 3.1: > java.lang.NoSuchMethodError: de.schildbach.game.integration.HibernateGamePlayer.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer; > at de.schildbach.game.integration.HibernateGamePlayer$$EnhancerByCGLIB$$afecb986.getHibernateLazyInitializer(<generated>) > at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:274) > at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177) > at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:398) > at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96) > at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82) > at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:520) > at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:474) > at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:328) > at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123) > at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:202) > at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:169) > at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) > at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:869) > at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:838) > at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) > at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177) > at org.hibernate.collection.PersistentList.initializeFromCache(PersistentList.java:378) > at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1627) > at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) > at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) > at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109) > at org.hibernate.collection.PersistentList.size(PersistentList.java:91) > The exception varies with the actual persistent class in use. Most people seem to be using JDK 1.5 and Linux. Some reports say that the exception does not happen from the very start of the application, but it takes "several invocations"/"some time" until it appear, but then it appears very often. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Paul S. (JIRA) <no...@at...> - 2006-05-14 22:57:17
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1729?page=comments#action_23097 ] Paul Smith commented on HHH-1729: --------------------------------- Just wondering what the status of this issue is as it has a pretty heavy impact on our current project. Without it, we are forced to get all results to do any batch type updating which prevents us from implementing restartable batch updates. > Oracle9Dialect LockMode.UPGRADE conflicts with setMaxResults > ------------------------------------------------------------ > > Key: HHH-1729 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1729 > Project: Hibernate3 > Type: Bug > Versions: 3.1 > Environment: Hibernate 1.1, Oracle 10g release 2 (also tested with 10g release 1). > Reporter: Mark Lewis > Priority: Minor > > > When executing a simple HQL select from in Oracle, attempting to specify LockMode.UPGRADE to generate a "for update" clause while specifying a setMaxResults(10) causes an Oracle-00904: Invalid identifier exception. The same query works fine with several other tested dialects. > The reason is that the generated SQL refers to a column by its actual column name, instead of the column alias assigned to it. Consider the following example: > select * from ( select scheduleel0_.elementId as elementId22_ from ScheduleElement scheduleel0_ ) where rownum <= ? for update of scheduleel0_.elementId > This should be "for update of elementId22_", because "scheduleel0_.elementId" can't be referenced at this scope in the SQL. > I've dug through the code but I think the fix will require a more knowledge of Hibernate's guts than I've got. The offending SQL is inserted in org.hibernate.sql.ForUpdateFragment.toFragmentString(), but the ForUpdateFragment class doesn't know what the column aliases are for each real column, so it would need some way of getting that information. > The HQL which causes the problem is as follows: > from ScheduleElement as element where element.runnable=true and element.scheduleHead=true > (I don't think it matters, but ScheduleElement is the root of a class hierarchy defined using joined-subclass) > It is executed using the following Java code: > session.createQuery(seeAboveForTheQueryString) > .setLockMode("element", LockMode.UPGRADE) > .setMaxResults(10) > .list(); > Here is the bad SQL created from the HQL: > -- Selecting all columns and left joining on subclass tables omitted for brevity > select * from ( select scheduleel0_.elementId as elementId22_ from ScheduleElement scheduleel0_ ) where rownum <= ? for update of scheduleel0_.elementId -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Naaman L. (JIRA) <no...@at...> - 2006-05-14 14:30:11
|
The "Hibernate Settings" menu option only appears in the "Project Properties" menu via the "Project Explorer" view in the "Hibernate Console" perspective. ---------------------------------------------------------------------------------------------------------------------------------------------------------- Key: HBX-661 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-661 Project: Hibernate Tools Type: Bug Components: eclipse Versions: 3.1.beta5 Environment: - Eclipse 3.1.2 - Hibernate plugin version 3.1.0 beta 5 - WTP 1.0 - Spring IDE 1.3 - Oracle 10g - Hibernate 3.0.4 Reporter: Naaman Lifshitz Priority: Minor Attachments: screenshots.zip Please see here: http://forum.hibernate.org/viewtopic.php?t=958524&start=15 -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2006-05-13 22:37:11
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-46?page= =3Dcomments#action_23096 ]=20 Micha=C5=82 Borowiecki commented on EJB-46: -------------------------------------- The PreUpdate bug I referred to earlier is now EJB-180. > Property Validation should happen after PrePersist/PreUpdate > ------------------------------------------------------------ > > Key: EJB-46 > URL: http://opensource.atlassian.com/projects/hibernate/browse/E= JB-46 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.1beta2, 3.1beta1 > Environment: MySQL4, Sun JRE5, WinXP > Reporter: Johan Steiner > Attachments: EJB3EventListener.patch > > > Hi, > the description is from http://forum.hibernate.org/viewtopic.php?t=3D9449= 64 but I'm experiencing the exact same issue. > ********************* > Hibernate does property validation such as not null checking before it do= es the EJB3 callback to prepersist/preupdate. I'm not sure if there's a goo= d reason for this, but I think it would be particularly convenient if this = behavior was reversed. IMHO it seems to better fit the semantics of the PRE= callbacks, and it would allow callbacks to make modifications to the objec= ts before they are persisted or updated -- modifications that might in turn= effect the property validation Hibernate is doing. > The "audit" example in the entity manager documentation does make changes= to the object. What if these changes had effected the property validation = done before the callback occurred? What if the object was in an invalid sta= te before the callback, but a valid state after the callback? The latter ca= se is what I think would be conveniently handled if hibernate did its prope= rty validation after prepersist/preupdate. > Just two cents worth, obviously there are workarounds. This EJB3 stuff is= looking great. > Ryan > P.S. This might also allow those of us who assign our own IDs to objects = to do so automatically within a callback. > ********************* > In my case I'm working with an entity like: > public class MyEntity > { > =09@Basic(temporalType =3D TemporalType.TIMESTAMP) > =09@Column(name =3D "$createdOn", insertable =3D true, updatable =3D fals= e, nullable =3D false) > =09private Date firstPersistedOn =3D null; > =09@Basic(temporalType =3D TemporalType.TIMESTAMP) > =09@Column(name =3D "$modifiedOn", insertable =3D true, updatable =3D fal= se, nullable =3D true) > =09private Date lastPersistedOn =3D null; > =09@PrePersist > =09public void onPrePersist() > =09{ > =09=09firstPersistedOn =3D new Date(); > =09} > =09@PreUpdate > =09public void onPreUpdate() > =09{ > =09=09lastPersistedOn =3D new Date(); > =09} > } > Hibernate throws: > org.hibernate.PropertyValueException: not-null property references a null= or transient value: MyEntity.firstPersistedOn > =09at org.hibernate.engine.Nullability.checkNullability(Nullability.java:= 72) > =09at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrRepl= icate(AbstractSaveEventListener.java:262) > =09at org.hibernate.event.def.AbstractSaveEventListener.performSave(Abstr= actSaveEventListener.java:164) > =09at org.hibernate.event.def.AbstractSaveEventListener.saveWithGenerated= Id(AbstractSaveEventListener.java:114) > =09at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient= (DefaultMergeEventListener.java:167) > =09at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMe= rgeEventListener.java:113) > =09at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMe= rgeEventListener.java:60) > =09at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:540) > =09at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityMan= agerImpl.java:139) > Regards, > Johan --=20 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2006-05-13 22:35:12
|
org.hibernate.AssertionFailure: dirty, but no dirty properties -------------------------------------------------------------- Key: EJB-180 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB= -180 Project: Hibernate Entity Manager Type: Bug Environment: JBoss 4.0.4CR2 Reporter: Micha=C5=82 Borowiecki This exception is raised in the following scenario: 1. An entity is returned from a find operation. 2. It is modified. 3. EntityManager.merge is called on it. 4. In the PreUpdate callback the bean has its fields modified to the values= they had before step 2. 5. The DefaultFlushEntityEventListener determines that all the fields have = their values equal to those in the cache and raises the error: org.hibernate.AssertionFailure: dirty, but no dirty properties =09at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdat= e(DefaultFlushEntityEventListener.java:256) =09at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity= (DefaultFlushEntityEventListener.java:121) =09at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(A= bstractFlushingEventListener.java:195) =09at org.hibernate.event.def.AbstractFlushingEventListener.flushEverything= ToExecutions(AbstractFlushingEventListener.java:76) =09at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus= hEventListener.java:26) =09at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:988) =09at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:337) =09at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(Abstra= ctEntityManagerImpl.java:473) This bug is probably a reincarnation of EJB-29, however that report did not= have a comprehensive description so I decided to create a new one. --=20 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2006-05-13 22:01:21
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-46?pag= e=3Dall ] Micha=C5=82 Borowiecki updated EJB-46: --------------------------------- Attachment: EJB3EventListener.patch ebj3 event listeners currently perform lifecycle callbacks in the overriden= invokeSaveLifecycle method, which is only invoked after validation has suc= ceeded. I moved the callback invocation before validation by overriding the= saveWithGeneratedId method. This seems to have fixed the issue. I attach t= he patch. From what I could determine: The EJB3PersistEventListener is invoked when an enitity is persisted by a c= all to EntityManager.persist The EJB3MergeEventListener is invoked when an entity is persisted by a call= to EntityManager.merge on some other entity which has been set to cascade = on its relationship. I've also modified EJB3SaveEventListener and EJB3SaveOrUpdateEventListener = although I couldn't find the circumstances when they're used. However, sinc= e they all subclass AbstractSaveEventListener I figured it is better to mod= ify them accordingly.=20 Also I have overriden the saveWithRequestedId method on all four classes, a= lthough again I couldn't establish when the method is called. As for the PreUpdate callback I think it is called before validation, as it= should be. I set a non-nullible field to null, call merge on the entity and only set t= he field to a non-null value in PreUpdate and it works.=20 I did however find a bug in DefaultFlushEntityEventListener that is related= , in that it also stems from the assumption that the callbacks do not alter= the entity's persistant state. I will create a new issue for it. > Property Validation should happen after PrePersist/PreUpdate > ------------------------------------------------------------ > > Key: EJB-46 > URL: http://opensource.atlassian.com/projects/hibernate/browse/E= JB-46 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.1beta2, 3.1beta1 > Environment: MySQL4, Sun JRE5, WinXP > Reporter: Johan Steiner > Attachments: EJB3EventListener.patch > > > Hi, > the description is from http://forum.hibernate.org/viewtopic.php?t=3D9449= 64 but I'm experiencing the exact same issue. > ********************* > Hibernate does property validation such as not null checking before it do= es the EJB3 callback to prepersist/preupdate. I'm not sure if there's a goo= d reason for this, but I think it would be particularly convenient if this = behavior was reversed. IMHO it seems to better fit the semantics of the PRE= callbacks, and it would allow callbacks to make modifications to the objec= ts before they are persisted or updated -- modifications that might in turn= effect the property validation Hibernate is doing. > The "audit" example in the entity manager documentation does make changes= to the object. What if these changes had effected the property validation = done before the callback occurred? What if the object was in an invalid sta= te before the callback, but a valid state after the callback? The latter ca= se is what I think would be conveniently handled if hibernate did its prope= rty validation after prepersist/preupdate. > Just two cents worth, obviously there are workarounds. This EJB3 stuff is= looking great. > Ryan > P.S. This might also allow those of us who assign our own IDs to objects = to do so automatically within a callback. > ********************* > In my case I'm working with an entity like: > public class MyEntity > { > =09@Basic(temporalType =3D TemporalType.TIMESTAMP) > =09@Column(name =3D "$createdOn", insertable =3D true, updatable =3D fals= e, nullable =3D false) > =09private Date firstPersistedOn =3D null; > =09@Basic(temporalType =3D TemporalType.TIMESTAMP) > =09@Column(name =3D "$modifiedOn", insertable =3D true, updatable =3D fal= se, nullable =3D true) > =09private Date lastPersistedOn =3D null; > =09@PrePersist > =09public void onPrePersist() > =09{ > =09=09firstPersistedOn =3D new Date(); > =09} > =09@PreUpdate > =09public void onPreUpdate() > =09{ > =09=09lastPersistedOn =3D new Date(); > =09} > } > Hibernate throws: > org.hibernate.PropertyValueException: not-null property references a null= or transient value: MyEntity.firstPersistedOn > =09at org.hibernate.engine.Nullability.checkNullability(Nullability.java:= 72) > =09at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrRepl= icate(AbstractSaveEventListener.java:262) > =09at org.hibernate.event.def.AbstractSaveEventListener.performSave(Abstr= actSaveEventListener.java:164) > =09at org.hibernate.event.def.AbstractSaveEventListener.saveWithGenerated= Id(AbstractSaveEventListener.java:114) > =09at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient= (DefaultMergeEventListener.java:167) > =09at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMe= rgeEventListener.java:113) > =09at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMe= rgeEventListener.java:60) > =09at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:540) > =09at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityMan= agerImpl.java:139) > Regards, > Johan --=20 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Corey P. (JIRA) <no...@at...> - 2006-05-12 22:08:15
|
Setting a comment that contains a single quote on a query results in an unintuitive exception ---------------------------------------------------------------------------------------------- Key: HHH-1748 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1748 Project: Hibernate3 Type: Bug Components: query-hql Versions: 3.1.3 Environment: Hibernate 3.1.3 Oracle 10i Java 1.4.2_08 Centos 4 Reporter: Corey Puffalt I've been using the (relatively) new setComment() feature which I find very useful during development and testing. However, I've stumbled across an error when setting a comment that contains a single quote . For example: List parents = session.createQuery("...").setComment("get kitten's parents").list(); results in the following exception: Caused by: java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:259) at org.hibernate.pretty.Formatter.format(Formatter.java:112) at org.hibernate.jdbc.AbstractBatcher.format(AbstractBatcher.java:355) at org.hibernate.jdbc.AbstractBatcher.log(AbstractBatcher.java:346) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:422) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2145) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at mypkdg.MyClass.mymethod(MyClass.java:964) To get this particular error you also have to have the hibernate.format_sql property set to true (as you might guess from examining this stacktrace closely). While I don't have a problem with single quotes being prohibited in a comment if they can't be escaped I *do* have a problem with the exception above as it doesn't tell me what's wrong... Looks like a bug in the parser to me... Astute readers may ask what happens if I turn off sql formatting (hibernate.format_sql=false). In this case, I got an exception from the Oracle10i JDBC driver: Caused by: java.sql.SQLException: ORA-00911: invalid character at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039) at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329) at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139) at org.hibernate.loader.Loader.getResultSet(Loader.java:1669) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2145) ... 43 more Note that you'll also have to have the hibernate.use_sql_comments property set to true to reproduce this one. I guess there are two ways of fixing this problem: a) Explicitly prohibit "bad" characters like the single quote in comments and throw an appropriate exception. b) Handle single quotes properly in the org.hibernate.pretty.Formatter and also escape such characters (if possible) appropriately so they don't cause errors at the JDBC driver level. I assume this problem also affects comments set on Criterias and native SQL though I haven't verified this. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |