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-07-30 02:55:15
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 29 Jul 2003 9:54 PM Done (in CVS) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?= key=3DHB-216 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-216 Summary: Support for SELECT FOR UPDATE in SAPDB Type: Improvement Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components:=20 core Fix Fors: 2.0.2 Versions: 2.0.2 Assignee:=20 Reporter: Philippe Chal=C3=A9at Created: Mon, 28 Jul 2003 10:27 AM Updated: Tue, 29 Jul 2003 9:54 PM Environment: SAPDB 7.4 Description: Using SAPDB 7.4, it could be interesting to support SELECT FOR UPDATE accor= ding to the locking options described in SAPDB documentation : http://www.sapdb.org/7.4/htmhelp/7d/75d34a6a210b4b95f232e5f9acd232/content.= htm --------------------------------------------------------------------- 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-07-30 01:38:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 29 Jul 2003 8:36 PM As per the documentation and FAQ, classes with embedded composite ids must implement equals()/hashCode(). Also, I changed to unsaved-value="any", for your example code. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-214 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-214 Summary: Deadlock in processing "composite-id -> key-many-to-one" Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Assignee: Reporter: Shining Created: Mon, 28 Jul 2003 5:28 AM Updated: Tue, 29 Jul 2003 8:36 PM Environment: Windows2000 Professional with SP3, SQL Server 2000, Microsoft SQLServer 2000 JDBC Driver, SUN JDK 1.4.1_02, Elcipse 2.1 Description: I want use multi-primary-key and foriegn-key as primary-key in my project. The insert and update operator can work correctly, but the load operator can not work correctly. After tracing the source code of hibernate, I think problem is the process of the <composition-id> with <key-many-to-one> element. I can not sure it is a bug or hibernate can not support my database schema. What can I do? My Sample is: -----------------------DataBase Schema--------------------------------- /*==============================================================*/ /* Table: TBL_DWZT_NCS */ /*==============================================================*/ create table TBL_DWZT_NCS ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCS_YEFX JDBZ not null, NCS_YE JE not null, constraint PK_TBL_DWZT_NCS primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM) ) go /*==============================================================*/ /* Table: TBL_DWZT_NCSHB */ /*==============================================================*/ create table TBL_DWZT_NCSHB ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCSHB_DM HB_DM not null, NCSHB_YE JE not null, constraint PK_TBL_DWZT_NCSHB primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM, NCSHB_DM) ) go alter table TBL_DWZT_NCSHB add constraint FK_DWZT_NCS_HB foreign key (ZT_BM, DW_BZDM, NCS_FLYS_BM) references TBL_DWZT_NCS (ZT_BM, DW_BZDM, NCS_FLYS_BM) on update cascade on delete cascade go -----------------------NCS.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCS" table="TBL_DWZT_NCS"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-property name="dw_bzdm" column="DW_BZDM"/> <key-property name="zt_bm" column="ZT_BM"/> <key-property name="flys_bm" column="NCS_FLYS_BM"/> </composite-id> <property name="yefx" column="NCS_YEFX" type="int"/> <property name="YE" column="NCS_YE" type="double"/> <set name="hbs" cascade="save-update"> <key> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key> <one-to-many class="jdo.NCSHB"/> </set> </class> </hibernate-mapping> -----------------------NCSHB.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCSHB" table="TBL_DWZT_NCSHB"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-many-to-one name="ncs" class="jdo.NCS"> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key-many-to-one> <key-property name="hb_dm" column="NCSHB_DM"/> </composite-id> <property name="ye" column="NCSHB_YE" type="double"/> </class> </hibernate-mapping> ----------------------------NCS.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; import java.util.Set; import java.util.HashSet; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCS implements Serializable { private String dw_bzdm; private String zt_bm; private String flys_bm; private FLYS flys; private int yefx; private double ye; private Set hbs; /** * @return */ public String getDw_bzdm() { return dw_bzdm; } /** * @return */ public String getFlys_bm() { return flys_bm; } /** * @return */ public double getYE() { return ye; } /** * @return */ public int getYefx() { return yefx; } /** * @return */ public String getZt_bm() { return zt_bm; } /** * @param string */ public void setDw_bzdm(String string) { dw_bzdm = string; } /** * @param string */ public void setFlys_bm(String string) { flys_bm = string; } /** * @param d */ public void setYE(double d) { ye = d; } /** * @param string */ public void setYefx(int i) { yefx = i; } /** * @param string */ public void setZt_bm(String string) { zt_bm = string; } public Set getHbs() { return hbs; } void setHbs(Set hbs) { this.hbs = hbs; } void addHb(NCSHB ncshb) { if (hbs == null) hbs = new HashSet(); hbs.add(ncshb); } /** * @return */ public FLYS getFlys() { return flys; } /** * @param flys */ public void setFlys(FLYS flys) { this.flys = flys; } } ----------------------------NCSHB.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCSHB implements Serializable { private NCS ncs; private String hb_dm; private double ye; /** * @return */ public String getHb_dm() { return hb_dm; } /** * @return */ public double getYe() { return ye; } /** * @return */ public NCS getNcs() { return ncs; } /** * @param string */ public void setHb_dm(String string) { hb_dm = string; } /** * @param d */ public void setYe(double d) { ye = d; } /** * @param ncs */ public void setNcs(NCS ncs) { this.ncs = ncs; } } ----------------------------hibernate.properties----------------------- ###################### ### Query Language ### ###################### ## define query language constants / function names hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N' ## package imports #hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg ################# ### Platforms ### ################# ## MS SQL Server hibernate.dialect net.sf.hibernate.dialect.SybaseDialect hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver #hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_XTGL;SelectMethod=cursor hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_ZWGL;SelectMethod=cursor hibernate.connection.username sa hibernate.connection.password ################################# ### Hibernate Connection Pool ### ################################# #hibernate.connection.pool_size 1 #hibernate.statement_cache.size 25 ################################### ### Apache DBCP Connection Pool ### ################################### ## connection pool hibernate.dbcp.maxActive 100 hibernate.dbcp.whenExhaustedAction 1 hibernate.dbcp.maxWait 120000 hibernate.dbcp.maxIdle 10 ## prepared statement cache hibernate.dbcp.ps.maxActive 100 hibernate.dbcp.ps.whenExhaustedAction 1 hibernate.dbcp.ps.maxWait 120000 hibernate.dbcp.ps.maxIdle 100 ## optional query to validate pooled connections: #hibernate.dbcp.validationQuery select 1 from dual #hibernate.dbcp.testOnBorrow true #hibernate.dbcp.testOnReturn false ################################# ### Plugin ConnectionProvider ### ################################# ## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics) #hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.ProxoolConnectionProvider ####################### ### Transaction API ### ####################### ## the Transaction API abstracts application code from the underlying JTA or JDBC transactions #hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory #hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory ## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI ## default is java:comp/UserTransaction #jta.UserTransaction jta/usertransaction #jta.UserTransaction javax.transaction.UserTransaction #jta.UserTransaction UserTransaction ## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup ############################## ### Miscellaneous Settings ### ############################## ## print all generated SQL to the console hibernate.show_sql true ## specify a JDBC isolation level #hibernate.connection.isolation 4 ## set the JDBC fetch size #hibernate.jdbc.fetch_size 25 ## set the maximum JDBC 2 batch size (a nonzero value enables batching) hibernate.jdbc.batch_size 0 ## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default) #hibernate.jdbc.use_scrollable_resultset true ## use streams when writing binary types to / from JDBC hibernate.jdbc.use_streams_for_binary true ## specify a default schema for unqualified tablenames #hibernate.default_schema test ## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used) #hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt ## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default) #hibernate.use_outer_join false ## enable CGLIB reflection optimizer (enabled by default) #hibernate.cglib.use_reflection_optimizer false ############ ### JNDI ### ############ ## specify a JNDI name for the SessionFactory #hibernate.session_factory_name hibernate/session_factory ## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction; ## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which ## is the best approach in an application server #file system #hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory #hibernate.jndi.url file:/ #WebSphere #hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory #hibernate.jndi.url iiop://localhost:900/ ----------------------------Test.java---------------------------------- 1 try { 2 // configure the Configuration 3 ds = new Configuration() 4 .addClass(jdo.NCS.class) 5 .addClass(jdo.NCSHB.class); 6 7 // build a SessionFactory 8 sessions = ds.buildSessionFactory(); 9 10 Session sess = sessions.openSession(); 11 12 NCS ncs = null; 13 14 Iterator iter = sess.iterate("FROM NCS ncs"); 15 while (iter.hasNext()) { 16 ncs = (NCS) iter.next(); 17 sess.delete(ncs); 18 } 19 20 ncs = new NCS(); 21 ncs.setDw_bzdm("0001"); 22 ncs.setZt_bm("01"); 23 ncs.setFlys_bm("[][][][][][][][]"); 24 ncs.setYefx(1); 25 ncs.setYE(1000.00); 26 NCSHB ncshb = null; ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(1000.00); ncs.addHb(ncshb); sess.save(ncs); ncs = new NCS(); ncs.setDw_bzdm("0002"); ncs.setZt_bm("01"); ncs.setFlys_bm("[01][][][][][][][]"); ncs.setYefx(1); ncs.setYE(900.00); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(900.00); ncs.addHb(ncshb); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("USD"); ncshb.setYe(100.00); ncs.addHb(ncshb); sess.save(ncs); sess.delete(ncs); sess.flush(); sess.connection().commit(); sess.close(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } Deadlock occured in line 14, the session.iterator() ------------------------------Erro Message---------------------------- Hibernate: select ncs0_.DW_BZDM as x0_0_, ncs0_.ZT_BM as x0_1_, ncs0_.NCS_FLYS_BM as x0_2_ from TBL_DWZT_NCS ncs0_ Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? .............. --------------------------------------------------------------------- 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-07-30 01:36:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 29 Jul 2003 8:34 PM Now fixed in CVS. Thanks! (it was a simple little oversight) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-218 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-218 Summary: Interface as class type for <many-to-one/> property Type: New Feature Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.0.2 Versions: 2.0 final Assignee: Reporter: Chris Hane Created: Mon, 28 Jul 2003 2:21 PM Updated: Tue, 29 Jul 2003 8:34 PM Environment: java 1.3.1_04 Description: Is it legal to map a many-to-one class to an interface. I have done this with the father property (in the attached example), however, I am receiving errors when I try to load records where the parent property is not null. I have attached a set of files that demonstrate the error I am getting. To use: 1. run the sql script to build files and populate data Note: I'm using MySQL so you might have to change for a different DB 2. Change eg.test configuration properites to reflect your DB setup 3. Run eg.test Everything should work fine and "Detail B1 - F3" should be printed to the output 4. Now in eg.test, change the configuration to use eg.IFather instead of eg.Father 5. In IDetail, change the m-1 father property from eg.Father to eg.IFather 6. Re-run and you will get this error. Exception in thread "main" java.lang.IllegalArgumentException: No visible constructors in interface eg.IFather at net.sf.cglib.EnhancerGenerator.<init>(EnhancerGenerator.java:128) at net.sf.cglib.Enhancer.enhanceClassHelper(Enhancer.java:224) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:206) at net.sf.cglib.Enhancer.enhance(Enhancer.java:162) at net.sf.cglib.Enhancer.enhance(Enhancer.java:139) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:26) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.HibernateException: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:37) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:59) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at eq.test.main(test.java:43) Chris.... --------------------------------------------------------------------- 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-07-30 01:34:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 29 Jul 2003 8:33 PM This was already fixed in CVS. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-217 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-217 Summary: Criteria ignores discriminator, instantiates with wrong class Type: Bug Status: Closed Priority: Major Resolution: DUPLICATE Project: Hibernate2 Versions: 2.0.2 Assignee: Reporter: Anders Bengtsson Created: Mon, 28 Jul 2003 11:19 AM Updated: Tue, 29 Jul 2003 8:33 PM Description: When searching in a subclass with a Criteria, *all* rows in the table are returned, not only those belonging to the subclass. Example: Base class A, with subclasses B and C. Using session.createSearch(B.class).list() will incorrectly return all rows of both B and C, all of them instantiated as B's. Searching for A works, both B's and C's get instantiated the right way. It is only when searching for a subclass it seems to ignore the discriminator field. The corresponding search with session.createQuery("from B") works correctly too. --------------------------------------------------------------------- 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-07-29 21:32:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-220 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-220 Summary: hbm2java generates wrong getter for java.lang.Boolean Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: toolset Versions: 2.0.2 Assignee: Reporter: Colin Evans Created: Tue, 29 Jul 2003 4:32 PM Updated: Tue, 29 Jul 2003 4:32 PM Description: The hbm2java BasicRenderer generates an "is" getter method for fields of type java.lang.Boolean. It should only do this for primitive fields of type boolean, and this breaks some other bean-based frameworks (such as the JSTL EL tags). --------------------------------------------------------------------- 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-07-29 17:06:31
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-219 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-219 Summary: Add Session.isDirty(Object) method Type: New Feature Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.0.2 Assignee: Reporter: Stephen Molitor Created: Tue, 29 Jul 2003 12:03 PM Updated: Tue, 29 Jul 2003 12:03 PM Description: Add an 'isDirty(Object)' method to net.sf.hibernate.Session interface, and net.sf.hibernate.impl.SessionImpl. This method would expose the logic on lines 2175-2200 of SessionImpl.java. This would allow applications to check or perform operations on dirty objects before flushing changes. For example, this would allow an app to validate all dirty entities before flushing, and the validation method could invoke session methods or trigger lazy loads. All of the validation errors could be collected for reporting to the user. If there were validation errors, the app would not invoke flush. This would allow the app to forward back to the input page and display the *current* state (without flushing, since there were errors) of the session / db to the user. There could be other uses for an 'isDirty' method as well. Thanks for your consideration. Steve Molitor --------------------------------------------------------------------- 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-07-29 16:16:14
|
The following comment has been added to this issue: Author: Panagiotis Louridas Created: Tue, 29 Jul 2003 11:15 AM Body: Will you be uploading the patch to public CVS? (I am getting a 11 days old SessionImpl). Cheers, Panos. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-209 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-209 Summary: FlushMode.AUTO problem in joined subclass hierarchy Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Fix Fors: 2.0.2 Versions: 2.0.1 Assignee: Gavin King Reporter: Panagiotis Louridas Created: Tue, 22 Jul 2003 8:09 AM Updated: Sun, 27 Jul 2003 7:34 PM Environment: RedHat Linux 9.0, JVM 1.4.2 Description: Suppose we have a class hierarchy A <- B <- C. In my case the class hierarchy is mapped as a joined-subclass hierarchy, but my observations may hold in general. I use a Session with the default FlushMode setting (FlushMode.AUTO). I open the session, load an object of class B or C, perform some changes on it, do some queries and flush the session. When the session is flushed, only updates for the table pertaining to class A are issued by hibernate. If I manually flush just before the queries hibernate performs fine, issuing the proper updates for tables B and C. The same happens when I manually flush at the end of the transaction, after the queries, but having set the Session's flush mode to FlushMode.NEVER. --------------------------------------------------------------------- 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-07-29 05:57:14
|
The following issue has been updated: Updater: Shining (mailto:ns...@bb...) Date: Tue, 29 Jul 2003 12:57 AM Comment: To reduce the size, I removed the all the file in the lib directory. Changes: Attachment changed to HibernateTest.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-214&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-214 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-214 Summary: Deadlock in processing "composite-id -> key-many-to-one" Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Assignee: Reporter: Shining Created: Mon, 28 Jul 2003 5:28 AM Updated: Tue, 29 Jul 2003 12:57 AM Environment: Windows2000 Professional with SP3, SQL Server 2000, Microsoft SQLServer 2000 JDBC Driver, SUN JDK 1.4.1_02, Elcipse 2.1 Description: I want use multi-primary-key and foriegn-key as primary-key in my project. The insert and update operator can work correctly, but the load operator can not work correctly. After tracing the source code of hibernate, I think problem is the process of the <composition-id> with <key-many-to-one> element. I can not sure it is a bug or hibernate can not support my database schema. What can I do? My Sample is: -----------------------DataBase Schema--------------------------------- /*==============================================================*/ /* Table: TBL_DWZT_NCS */ /*==============================================================*/ create table TBL_DWZT_NCS ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCS_YEFX JDBZ not null, NCS_YE JE not null, constraint PK_TBL_DWZT_NCS primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM) ) go /*==============================================================*/ /* Table: TBL_DWZT_NCSHB */ /*==============================================================*/ create table TBL_DWZT_NCSHB ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCSHB_DM HB_DM not null, NCSHB_YE JE not null, constraint PK_TBL_DWZT_NCSHB primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM, NCSHB_DM) ) go alter table TBL_DWZT_NCSHB add constraint FK_DWZT_NCS_HB foreign key (ZT_BM, DW_BZDM, NCS_FLYS_BM) references TBL_DWZT_NCS (ZT_BM, DW_BZDM, NCS_FLYS_BM) on update cascade on delete cascade go -----------------------NCS.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCS" table="TBL_DWZT_NCS"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-property name="dw_bzdm" column="DW_BZDM"/> <key-property name="zt_bm" column="ZT_BM"/> <key-property name="flys_bm" column="NCS_FLYS_BM"/> </composite-id> <property name="yefx" column="NCS_YEFX" type="int"/> <property name="YE" column="NCS_YE" type="double"/> <set name="hbs" cascade="save-update"> <key> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key> <one-to-many class="jdo.NCSHB"/> </set> </class> </hibernate-mapping> -----------------------NCSHB.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCSHB" table="TBL_DWZT_NCSHB"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-many-to-one name="ncs" class="jdo.NCS"> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key-many-to-one> <key-property name="hb_dm" column="NCSHB_DM"/> </composite-id> <property name="ye" column="NCSHB_YE" type="double"/> </class> </hibernate-mapping> ----------------------------NCS.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; import java.util.Set; import java.util.HashSet; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCS implements Serializable { private String dw_bzdm; private String zt_bm; private String flys_bm; private FLYS flys; private int yefx; private double ye; private Set hbs; /** * @return */ public String getDw_bzdm() { return dw_bzdm; } /** * @return */ public String getFlys_bm() { return flys_bm; } /** * @return */ public double getYE() { return ye; } /** * @return */ public int getYefx() { return yefx; } /** * @return */ public String getZt_bm() { return zt_bm; } /** * @param string */ public void setDw_bzdm(String string) { dw_bzdm = string; } /** * @param string */ public void setFlys_bm(String string) { flys_bm = string; } /** * @param d */ public void setYE(double d) { ye = d; } /** * @param string */ public void setYefx(int i) { yefx = i; } /** * @param string */ public void setZt_bm(String string) { zt_bm = string; } public Set getHbs() { return hbs; } void setHbs(Set hbs) { this.hbs = hbs; } void addHb(NCSHB ncshb) { if (hbs == null) hbs = new HashSet(); hbs.add(ncshb); } /** * @return */ public FLYS getFlys() { return flys; } /** * @param flys */ public void setFlys(FLYS flys) { this.flys = flys; } } ----------------------------NCSHB.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCSHB implements Serializable { private NCS ncs; private String hb_dm; private double ye; /** * @return */ public String getHb_dm() { return hb_dm; } /** * @return */ public double getYe() { return ye; } /** * @return */ public NCS getNcs() { return ncs; } /** * @param string */ public void setHb_dm(String string) { hb_dm = string; } /** * @param d */ public void setYe(double d) { ye = d; } /** * @param ncs */ public void setNcs(NCS ncs) { this.ncs = ncs; } } ----------------------------hibernate.properties----------------------- ###################### ### Query Language ### ###################### ## define query language constants / function names hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N' ## package imports #hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg ################# ### Platforms ### ################# ## MS SQL Server hibernate.dialect net.sf.hibernate.dialect.SybaseDialect hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver #hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_XTGL;SelectMethod=cursor hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_ZWGL;SelectMethod=cursor hibernate.connection.username sa hibernate.connection.password ################################# ### Hibernate Connection Pool ### ################################# #hibernate.connection.pool_size 1 #hibernate.statement_cache.size 25 ################################### ### Apache DBCP Connection Pool ### ################################### ## connection pool hibernate.dbcp.maxActive 100 hibernate.dbcp.whenExhaustedAction 1 hibernate.dbcp.maxWait 120000 hibernate.dbcp.maxIdle 10 ## prepared statement cache hibernate.dbcp.ps.maxActive 100 hibernate.dbcp.ps.whenExhaustedAction 1 hibernate.dbcp.ps.maxWait 120000 hibernate.dbcp.ps.maxIdle 100 ## optional query to validate pooled connections: #hibernate.dbcp.validationQuery select 1 from dual #hibernate.dbcp.testOnBorrow true #hibernate.dbcp.testOnReturn false ################################# ### Plugin ConnectionProvider ### ################################# ## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics) #hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.ProxoolConnectionProvider ####################### ### Transaction API ### ####################### ## the Transaction API abstracts application code from the underlying JTA or JDBC transactions #hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory #hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory ## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI ## default is java:comp/UserTransaction #jta.UserTransaction jta/usertransaction #jta.UserTransaction javax.transaction.UserTransaction #jta.UserTransaction UserTransaction ## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup ############################## ### Miscellaneous Settings ### ############################## ## print all generated SQL to the console hibernate.show_sql true ## specify a JDBC isolation level #hibernate.connection.isolation 4 ## set the JDBC fetch size #hibernate.jdbc.fetch_size 25 ## set the maximum JDBC 2 batch size (a nonzero value enables batching) hibernate.jdbc.batch_size 0 ## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default) #hibernate.jdbc.use_scrollable_resultset true ## use streams when writing binary types to / from JDBC hibernate.jdbc.use_streams_for_binary true ## specify a default schema for unqualified tablenames #hibernate.default_schema test ## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used) #hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt ## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default) #hibernate.use_outer_join false ## enable CGLIB reflection optimizer (enabled by default) #hibernate.cglib.use_reflection_optimizer false ############ ### JNDI ### ############ ## specify a JNDI name for the SessionFactory #hibernate.session_factory_name hibernate/session_factory ## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction; ## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which ## is the best approach in an application server #file system #hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory #hibernate.jndi.url file:/ #WebSphere #hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory #hibernate.jndi.url iiop://localhost:900/ ----------------------------Test.java---------------------------------- 1 try { 2 // configure the Configuration 3 ds = new Configuration() 4 .addClass(jdo.NCS.class) 5 .addClass(jdo.NCSHB.class); 6 7 // build a SessionFactory 8 sessions = ds.buildSessionFactory(); 9 10 Session sess = sessions.openSession(); 11 12 NCS ncs = null; 13 14 Iterator iter = sess.iterate("FROM NCS ncs"); 15 while (iter.hasNext()) { 16 ncs = (NCS) iter.next(); 17 sess.delete(ncs); 18 } 19 20 ncs = new NCS(); 21 ncs.setDw_bzdm("0001"); 22 ncs.setZt_bm("01"); 23 ncs.setFlys_bm("[][][][][][][][]"); 24 ncs.setYefx(1); 25 ncs.setYE(1000.00); 26 NCSHB ncshb = null; ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(1000.00); ncs.addHb(ncshb); sess.save(ncs); ncs = new NCS(); ncs.setDw_bzdm("0002"); ncs.setZt_bm("01"); ncs.setFlys_bm("[01][][][][][][][]"); ncs.setYefx(1); ncs.setYE(900.00); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(900.00); ncs.addHb(ncshb); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("USD"); ncshb.setYe(100.00); ncs.addHb(ncshb); sess.save(ncs); sess.delete(ncs); sess.flush(); sess.connection().commit(); sess.close(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } Deadlock occured in line 14, the session.iterator() ------------------------------Erro Message---------------------------- Hibernate: select ncs0_.DW_BZDM as x0_0_, ncs0_.ZT_BM as x0_1_, ncs0_.NCS_FLYS_BM as x0_2_ from TBL_DWZT_NCS ncs0_ Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? .............. --------------------------------------------------------------------- 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-07-29 05:13:14
|
The following comment has been added to this issue: Author: Gavin King Created: Tue, 29 Jul 2003 12:12 AM Body: Please submit an actual main() method that reproduces this problem. ie. in an actual zip, NOT copy/pasting code. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-214 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-214 Summary: Deadlock in processing "composite-id -> key-many-to-one" Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Assignee: Reporter: Shining Created: Mon, 28 Jul 2003 5:28 AM Updated: Mon, 28 Jul 2003 5:28 AM Environment: Windows2000 Professional with SP3, SQL Server 2000, Microsoft SQLServer 2000 JDBC Driver, SUN JDK 1.4.1_02, Elcipse 2.1 Description: I want use multi-primary-key and foriegn-key as primary-key in my project. The insert and update operator can work correctly, but the load operator can not work correctly. After tracing the source code of hibernate, I think problem is the process of the <composition-id> with <key-many-to-one> element. I can not sure it is a bug or hibernate can not support my database schema. What can I do? My Sample is: -----------------------DataBase Schema--------------------------------- /*==============================================================*/ /* Table: TBL_DWZT_NCS */ /*==============================================================*/ create table TBL_DWZT_NCS ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCS_YEFX JDBZ not null, NCS_YE JE not null, constraint PK_TBL_DWZT_NCS primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM) ) go /*==============================================================*/ /* Table: TBL_DWZT_NCSHB */ /*==============================================================*/ create table TBL_DWZT_NCSHB ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCSHB_DM HB_DM not null, NCSHB_YE JE not null, constraint PK_TBL_DWZT_NCSHB primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM, NCSHB_DM) ) go alter table TBL_DWZT_NCSHB add constraint FK_DWZT_NCS_HB foreign key (ZT_BM, DW_BZDM, NCS_FLYS_BM) references TBL_DWZT_NCS (ZT_BM, DW_BZDM, NCS_FLYS_BM) on update cascade on delete cascade go -----------------------NCS.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCS" table="TBL_DWZT_NCS"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-property name="dw_bzdm" column="DW_BZDM"/> <key-property name="zt_bm" column="ZT_BM"/> <key-property name="flys_bm" column="NCS_FLYS_BM"/> </composite-id> <property name="yefx" column="NCS_YEFX" type="int"/> <property name="YE" column="NCS_YE" type="double"/> <set name="hbs" cascade="save-update"> <key> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key> <one-to-many class="jdo.NCSHB"/> </set> </class> </hibernate-mapping> -----------------------NCSHB.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCSHB" table="TBL_DWZT_NCSHB"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-many-to-one name="ncs" class="jdo.NCS"> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key-many-to-one> <key-property name="hb_dm" column="NCSHB_DM"/> </composite-id> <property name="ye" column="NCSHB_YE" type="double"/> </class> </hibernate-mapping> ----------------------------NCS.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; import java.util.Set; import java.util.HashSet; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCS implements Serializable { private String dw_bzdm; private String zt_bm; private String flys_bm; private FLYS flys; private int yefx; private double ye; private Set hbs; /** * @return */ public String getDw_bzdm() { return dw_bzdm; } /** * @return */ public String getFlys_bm() { return flys_bm; } /** * @return */ public double getYE() { return ye; } /** * @return */ public int getYefx() { return yefx; } /** * @return */ public String getZt_bm() { return zt_bm; } /** * @param string */ public void setDw_bzdm(String string) { dw_bzdm = string; } /** * @param string */ public void setFlys_bm(String string) { flys_bm = string; } /** * @param d */ public void setYE(double d) { ye = d; } /** * @param string */ public void setYefx(int i) { yefx = i; } /** * @param string */ public void setZt_bm(String string) { zt_bm = string; } public Set getHbs() { return hbs; } void setHbs(Set hbs) { this.hbs = hbs; } void addHb(NCSHB ncshb) { if (hbs == null) hbs = new HashSet(); hbs.add(ncshb); } /** * @return */ public FLYS getFlys() { return flys; } /** * @param flys */ public void setFlys(FLYS flys) { this.flys = flys; } } ----------------------------NCSHB.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCSHB implements Serializable { private NCS ncs; private String hb_dm; private double ye; /** * @return */ public String getHb_dm() { return hb_dm; } /** * @return */ public double getYe() { return ye; } /** * @return */ public NCS getNcs() { return ncs; } /** * @param string */ public void setHb_dm(String string) { hb_dm = string; } /** * @param d */ public void setYe(double d) { ye = d; } /** * @param ncs */ public void setNcs(NCS ncs) { this.ncs = ncs; } } ----------------------------hibernate.properties----------------------- ###################### ### Query Language ### ###################### ## define query language constants / function names hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N' ## package imports #hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg ################# ### Platforms ### ################# ## MS SQL Server hibernate.dialect net.sf.hibernate.dialect.SybaseDialect hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver #hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_XTGL;SelectMethod=cursor hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_ZWGL;SelectMethod=cursor hibernate.connection.username sa hibernate.connection.password ################################# ### Hibernate Connection Pool ### ################################# #hibernate.connection.pool_size 1 #hibernate.statement_cache.size 25 ################################### ### Apache DBCP Connection Pool ### ################################### ## connection pool hibernate.dbcp.maxActive 100 hibernate.dbcp.whenExhaustedAction 1 hibernate.dbcp.maxWait 120000 hibernate.dbcp.maxIdle 10 ## prepared statement cache hibernate.dbcp.ps.maxActive 100 hibernate.dbcp.ps.whenExhaustedAction 1 hibernate.dbcp.ps.maxWait 120000 hibernate.dbcp.ps.maxIdle 100 ## optional query to validate pooled connections: #hibernate.dbcp.validationQuery select 1 from dual #hibernate.dbcp.testOnBorrow true #hibernate.dbcp.testOnReturn false ################################# ### Plugin ConnectionProvider ### ################################# ## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics) #hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.ProxoolConnectionProvider ####################### ### Transaction API ### ####################### ## the Transaction API abstracts application code from the underlying JTA or JDBC transactions #hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory #hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory ## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI ## default is java:comp/UserTransaction #jta.UserTransaction jta/usertransaction #jta.UserTransaction javax.transaction.UserTransaction #jta.UserTransaction UserTransaction ## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup ############################## ### Miscellaneous Settings ### ############################## ## print all generated SQL to the console hibernate.show_sql true ## specify a JDBC isolation level #hibernate.connection.isolation 4 ## set the JDBC fetch size #hibernate.jdbc.fetch_size 25 ## set the maximum JDBC 2 batch size (a nonzero value enables batching) hibernate.jdbc.batch_size 0 ## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default) #hibernate.jdbc.use_scrollable_resultset true ## use streams when writing binary types to / from JDBC hibernate.jdbc.use_streams_for_binary true ## specify a default schema for unqualified tablenames #hibernate.default_schema test ## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used) #hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt ## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default) #hibernate.use_outer_join false ## enable CGLIB reflection optimizer (enabled by default) #hibernate.cglib.use_reflection_optimizer false ############ ### JNDI ### ############ ## specify a JNDI name for the SessionFactory #hibernate.session_factory_name hibernate/session_factory ## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction; ## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which ## is the best approach in an application server #file system #hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory #hibernate.jndi.url file:/ #WebSphere #hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory #hibernate.jndi.url iiop://localhost:900/ ----------------------------Test.java---------------------------------- 1 try { 2 // configure the Configuration 3 ds = new Configuration() 4 .addClass(jdo.NCS.class) 5 .addClass(jdo.NCSHB.class); 6 7 // build a SessionFactory 8 sessions = ds.buildSessionFactory(); 9 10 Session sess = sessions.openSession(); 11 12 NCS ncs = null; 13 14 Iterator iter = sess.iterate("FROM NCS ncs"); 15 while (iter.hasNext()) { 16 ncs = (NCS) iter.next(); 17 sess.delete(ncs); 18 } 19 20 ncs = new NCS(); 21 ncs.setDw_bzdm("0001"); 22 ncs.setZt_bm("01"); 23 ncs.setFlys_bm("[][][][][][][][]"); 24 ncs.setYefx(1); 25 ncs.setYE(1000.00); 26 NCSHB ncshb = null; ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(1000.00); ncs.addHb(ncshb); sess.save(ncs); ncs = new NCS(); ncs.setDw_bzdm("0002"); ncs.setZt_bm("01"); ncs.setFlys_bm("[01][][][][][][][]"); ncs.setYefx(1); ncs.setYE(900.00); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(900.00); ncs.addHb(ncshb); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("USD"); ncshb.setYe(100.00); ncs.addHb(ncshb); sess.save(ncs); sess.delete(ncs); sess.flush(); sess.connection().commit(); sess.close(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } Deadlock occured in line 14, the session.iterator() ------------------------------Erro Message---------------------------- Hibernate: select ncs0_.DW_BZDM as x0_0_, ncs0_.ZT_BM as x0_1_, ncs0_.NCS_FLYS_BM as x0_2_ from TBL_DWZT_NCS ncs0_ Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? .............. --------------------------------------------------------------------- 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-07-29 02:10:32
|
The following comment has been added to this issue: Author: Gavin King Created: Mon, 28 Jul 2003 9:03 PM Body: Please resubmit this as a patch! Its otherwise very difficult to see what you changed. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-215 Summary: Resolving XML external entities from a XML file enclosed in a jar Type: Patch Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: Emmanuel Ligne Created: Mon, 28 Jul 2003 6:14 AM Updated: Mon, 28 Jul 2003 6:14 AM Environment: Hibernate 2.0.1, windows 2000, jdk 1.4.1 Description: When specifying something like <!ENTITY frame SYSTEM "/mypath/Frame.xml">, if both enclosing and enclosed XML files are in jar file, Frame.xml is not searched in the enclosing file jar origin (as should be done regarding specif of relative URI search priority). Updated net.sf.hibernate.util.DTDEntityResolver as well as its users (ie XMLHelper and Configuration) so that optionnally a ClassLoader can be passed. This classloader is tried to load resources as stream given their systemId if the systemId is told to start with file:/// (ie relative uri). code for DTDEntityResolver : public class DTDEntityResolver implements EntityResolver { Log log = LogFactory.getLog(DTDEntityResolver.class); private final ClassLoader loader ; public DTDEntityResolver(ClassLoader loader) { super() ; this.loader = loader ; } private static final String URL = "http://hibernate.sourceforge.net/"; private static final String FILE = "file:///" ; public InputSource resolveEntity (String publicId, String systemId) { if ( systemId!=null) { if (systemId.startsWith(URL) ) { log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/"); // Search for DTD ClassLoader classLoader = this.getClass().getClassLoader(); InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) ); if (dtdStream==null) { log.debug(systemId + "not found in classpath"); return null; } else { log.debug("found " + systemId + " in classpath"); InputSource source = new InputSource(dtdStream); source.setPublicId(publicId); source.setSystemId(systemId); return source; } } else if (systemId.startsWith(FILE)) { InputStream childStream = loader.getResourceAsStream(systemId.substring(FILE.length())) ; if (childStream == null) return null ; else { log.debug("found " + systemId + " from classLoader"); InputSource source = new InputSource(childStream); source.setPublicId(publicId); source.setSystemId(systemId); return source; } } else return null ; } else { // use the default behaviour return null; } } } Impacted code in XMLHelper : Added constructor public static SAXReader createSAXReader(String file, ClassLoader cl) { SAXReader reader = new SAXReader(); reader.setEntityResolver(new DTDEntityResolver(cl)); reader.setErrorHandler( new ErrorLogger(file) ); reader.setMergeAdjacentText(true); reader.setValidation(true); return reader; } Modified DTD_RESOLVER instanciation : private static final EntityResolver DTD_RESOLVER = new DTDEntityResolver(XMLHelper.class.getClassLoader()); Configuration.java : Modified some addXXX methods to use the new feature of XMLHelper : public Configuration addInputStream(InputStream xmlInputStream, ClassLoader src) throws MappingException { try { add( XMLHelper.createSAXReader("XML InputStream", src).read( new InputSource(xmlInputStream) ) ); return this; } catch (MappingException me) { throw me; } catch (Exception e) { log.error("Could not configure datastore from input stream", e); throw new MappingException(e); } } /** * Read mappings from an application resource * @param path a resource * @param classLoader a <tt>ClassLoader</tt> to use */ public Configuration addResource(String path, ClassLoader classLoader) throws MappingException { log.info("Mapping resource: " + path); InputStream rsrc = classLoader.getResourceAsStream(path); if (rsrc==null) throw new MappingException("Resource: " + path + " not found"); return addInputStream(rsrc, classLoader); } /** * Read a mapping from an application resource, using a convention. * The class <tt>foo.bar.Foo</tt> is mapped by the file <tt>foo/bar/Foo.hbm.xml</tt>. * @param persistentClass the mapped class */ public Configuration addClass(Class persistentClass) throws MappingException { String fileName = persistentClass.getName().replace(StringHelper.DOT,'/') + ".hbm.xml"; log.info("Mapping resource: " + fileName); ClassLoader cl = persistentClass.getClassLoader() ; InputStream rsrc = cl.getResourceAsStream(fileName); if (rsrc==null) throw new MappingException("Resource: " + fileName + " not found"); return addInputStream(rsrc, cl); } /** * Read all mappings from a jar file * @param resource an application resource (a jar file) */ public Configuration addJar(String resource) throws MappingException { log.info("Searching for mapping documents in jar: " + resource); final JarFile jarFile; final ClassLoader cl ; try { cl = Thread.currentThread().getContextClassLoader() ; jarFile = new JarFile( cl.getResource(resource).getFile() ); } catch (IOException ioe) { log.error("Could not configure datastore from jar", ioe); throw new MappingException(ioe); } if (jarFile==null) throw new MappingException("Resource: " + resource + " not found"); Enumeration enum = jarFile.entries(); while( enum.hasMoreElements() ) { ZipEntry z = (ZipEntry) enum.nextElement(); if( z.getName().endsWith(".hbm.xml") ) { log.info( "Found mapping documents in jar: " + z.getName() ); try { addInputStream( jarFile.getInputStream(z), cl ); } catch (MappingException me) { throw me; } catch (Exception e) { log.error("Could not configure datastore from jar", e); throw new MappingException(e); } } } return this; } --------------------------------------------------------------------- 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-07-28 19:24:14
|
The following issue has been updated: Updater: Chris Hane (mailto:hib...@it...) Date: Mon, 28 Jul 2003 2:23 PM Comment: Example that causes this error to be raised. Changes: Attachment changed to eg.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-218&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-218 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-218 Summary: Interface as class type for <many-to-one/> property Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0 final Assignee: Reporter: Chris Hane Created: Mon, 28 Jul 2003 2:21 PM Updated: Mon, 28 Jul 2003 2:23 PM Environment: java 1.3.1_04 Description: Is it legal to map a many-to-one class to an interface. I have done this with the father property (in the attached example), however, I am receiving errors when I try to load records where the parent property is not null. I have attached a set of files that demonstrate the error I am getting. To use: 1. run the sql script to build files and populate data Note: I'm using MySQL so you might have to change for a different DB 2. Change eg.test configuration properites to reflect your DB setup 3. Run eg.test Everything should work fine and "Detail B1 - F3" should be printed to the output 4. Now in eg.test, change the configuration to use eg.IFather instead of eg.Father 5. In IDetail, change the m-1 father property from eg.Father to eg.IFather 6. Re-run and you will get this error. Exception in thread "main" java.lang.IllegalArgumentException: No visible constructors in interface eg.IFather at net.sf.cglib.EnhancerGenerator.<init>(EnhancerGenerator.java:128) at net.sf.cglib.Enhancer.enhanceClassHelper(Enhancer.java:224) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:206) at net.sf.cglib.Enhancer.enhance(Enhancer.java:162) at net.sf.cglib.Enhancer.enhance(Enhancer.java:139) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:26) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.HibernateException: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:37) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:59) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at eq.test.main(test.java:43) Chris.... --------------------------------------------------------------------- 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-07-28 19:22:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-218 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-218 Summary: Interface as class type for <many-to-one/> property Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0 final Assignee: Reporter: Chris Hane Created: Mon, 28 Jul 2003 2:21 PM Updated: Mon, 28 Jul 2003 2:21 PM Environment: java 1.3.1_04 Description: Is it legal to map a many-to-one class to an interface. I have done this with the father property (in the attached example), however, I am receiving errors when I try to load records where the parent property is not null. I have attached a set of files that demonstrate the error I am getting. To use: 1. run the sql script to build files and populate data Note: I'm using MySQL so you might have to change for a different DB 2. Change eg.test configuration properites to reflect your DB setup 3. Run eg.test Everything should work fine and "Detail B1 - F3" should be printed to the output 4. Now in eg.test, change the configuration to use eg.IFather instead of eg.Father 5. In IDetail, change the m-1 father property from eg.Father to eg.IFather 6. Re-run and you will get this error. Exception in thread "main" java.lang.IllegalArgumentException: No visible constructors in interface eg.IFather at net.sf.cglib.EnhancerGenerator.<init>(EnhancerGenerator.java:128) at net.sf.cglib.Enhancer.enhanceClassHelper(Enhancer.java:224) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:206) at net.sf.cglib.Enhancer.enhance(Enhancer.java:162) at net.sf.cglib.Enhancer.enhance(Enhancer.java:139) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:26) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.HibernateException: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:37) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:59) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at eq.test.main(test.java:43) Chris.... --------------------------------------------------------------------- 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-07-28 16:22:14
|
The following issue has been updated: Updater: Anders Bengtsson (mailto:ndr...@ya...) Date: Mon, 28 Jul 2003 11:21 AM Comment: A JUnit test reproducing the problem. 'testQuery' passes while 'testCriteria' fails. Changes: Attachment changed to criteriabug.tar.gz --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-217&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-217 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-217 Summary: Criteria ignores discriminator, instantiates with wrong class Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.0.2 Assignee: Reporter: Anders Bengtsson Created: Mon, 28 Jul 2003 11:19 AM Updated: Mon, 28 Jul 2003 11:21 AM Description: When searching in a subclass with a Criteria, *all* rows in the table are returned, not only those belonging to the subclass. Example: Base class A, with subclasses B and C. Using session.createSearch(B.class).list() will incorrectly return all rows of both B and C, all of them instantiated as B's. Searching for A works, both B's and C's get instantiated the right way. It is only when searching for a subclass it seems to ignore the discriminator field. The corresponding search with session.createQuery("from B") works correctly too. --------------------------------------------------------------------- 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-07-28 16:20:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-217 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-217 Summary: Criteria ignores discriminator, instantiates with wrong class Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.0.2 Assignee: Reporter: Anders Bengtsson Created: Mon, 28 Jul 2003 11:19 AM Updated: Mon, 28 Jul 2003 11:19 AM Description: When searching in a subclass with a Criteria, *all* rows in the table are returned, not only those belonging to the subclass. Example: Base class A, with subclasses B and C. Using session.createSearch(B.class).list() will incorrectly return all rows of both B and C, all of them instantiated as B's. Searching for A works, both B's and C's get instantiated the right way. It is only when searching for a subclass it seems to ignore the discriminator field. The corresponding search with session.createQuery("from B") works correctly too. --------------------------------------------------------------------- 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-07-28 15:28:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?= key=3DHB-216 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-216 Summary: Support for SELECT FOR UPDATE in SAPDB Type: Improvement Status: Unassigned Priority: Major Project: Hibernate2 Components:=20 core Versions: 2.0.2 Assignee:=20 Reporter: Philippe Chal=C3=A9at Created: Mon, 28 Jul 2003 10:27 AM Updated: Mon, 28 Jul 2003 10:27 AM Environment: SAPDB 7.4 Description: Using SAPDB 7.4, it could be interesting to support SELECT FOR UPDATE accor= ding to the locking options described in SAPDB documentation : http://www.sapdb.org/7.4/htmhelp/7d/75d34a6a210b4b95f232e5f9acd232/content.= htm --------------------------------------------------------------------- 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-07-28 15:17:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-7 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-7 Summary: Allow mapping class to more than one table/view Type: Improvement Status: Unassigned Priority: Major Project: Hibernate 1.2 Assignee: Reporter: Frank Calfo Created: Mon, 28 Jul 2003 10:16 AM Updated: Mon, 28 Jul 2003 10:16 AM Description: I have multiple views that return different results, but all share a common structure I have a class defined to represent one row from the view I can map this class to the view and use a hibernate query to get a collection of objects Now I want to be able to define the second query that returns data from the second view. It seems like I would need to be able to map the same class to a different view but I don't think that will be allowed in Hibernate. For example: Here's the common class mapped to the first view: <class name="ResultSetRow" table="VW_REQUESTS_MANAGER" mutable="false"> <id name="reqId" column="req_id" type="long" unsaved-value="null"> <generator class="assigned"/> </id> <property name="name" column="name" type="string"/> <property name="date" column="date" type="timestamp"/> <property name="type" column="type" type="string"/> </class> and here's the Hibernate query that returns a collection of objects for each row returned by the view: <query name="PendingRequests.ForManager"> from ResultSetRow as list where list.managerId = :manager_id </query> The key issues are these: 1) The structure of each result set will always be the same, only the contents will differ 2) A set of different database views will be created that share the same structure but return different content according to their purpose 3) I'd like to be able to share a common class instead of defining a different class for each different result set 4) I'd like to be able to create a set of mappings for each database view that returns the common class that defines the structure of the result set Can I use a common class and map it to different table/views - or does the rule that one class maps to only one table prevent it ? Thanks! --------------------------------------------------------------------- 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-07-28 11:20:29
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-215 Summary: Resolving XML external entities from a XML file enclosed in a jar Type: Patch Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: Emmanuel Ligne Created: Mon, 28 Jul 2003 6:14 AM Updated: Mon, 28 Jul 2003 6:14 AM Environment: Hibernate 2.0.1, windows 2000, jdk 1.4.1 Description: When specifying something like <!ENTITY frame SYSTEM "/mypath/Frame.xml">, if both enclosing and enclosed XML files are in jar file, Frame.xml is not searched in the enclosing file jar origin (as should be done regarding specif of relative URI search priority). Updated net.sf.hibernate.util.DTDEntityResolver as well as its users (ie XMLHelper and Configuration) so that optionnally a ClassLoader can be passed. This classloader is tried to load resources as stream given their systemId if the systemId is told to start with file:/// (ie relative uri). code for DTDEntityResolver : public class DTDEntityResolver implements EntityResolver { Log log = LogFactory.getLog(DTDEntityResolver.class); private final ClassLoader loader ; public DTDEntityResolver(ClassLoader loader) { super() ; this.loader = loader ; } private static final String URL = "http://hibernate.sourceforge.net/"; private static final String FILE = "file:///" ; public InputSource resolveEntity (String publicId, String systemId) { if ( systemId!=null) { if (systemId.startsWith(URL) ) { log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/"); // Search for DTD ClassLoader classLoader = this.getClass().getClassLoader(); InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) ); if (dtdStream==null) { log.debug(systemId + "not found in classpath"); return null; } else { log.debug("found " + systemId + " in classpath"); InputSource source = new InputSource(dtdStream); source.setPublicId(publicId); source.setSystemId(systemId); return source; } } else if (systemId.startsWith(FILE)) { InputStream childStream = loader.getResourceAsStream(systemId.substring(FILE.length())) ; if (childStream == null) return null ; else { log.debug("found " + systemId + " from classLoader"); InputSource source = new InputSource(childStream); source.setPublicId(publicId); source.setSystemId(systemId); return source; } } else return null ; } else { // use the default behaviour return null; } } } Impacted code in XMLHelper : Added constructor public static SAXReader createSAXReader(String file, ClassLoader cl) { SAXReader reader = new SAXReader(); reader.setEntityResolver(new DTDEntityResolver(cl)); reader.setErrorHandler( new ErrorLogger(file) ); reader.setMergeAdjacentText(true); reader.setValidation(true); return reader; } Modified DTD_RESOLVER instanciation : private static final EntityResolver DTD_RESOLVER = new DTDEntityResolver(XMLHelper.class.getClassLoader()); Configuration.java : Modified some addXXX methods to use the new feature of XMLHelper : public Configuration addInputStream(InputStream xmlInputStream, ClassLoader src) throws MappingException { try { add( XMLHelper.createSAXReader("XML InputStream", src).read( new InputSource(xmlInputStream) ) ); return this; } catch (MappingException me) { throw me; } catch (Exception e) { log.error("Could not configure datastore from input stream", e); throw new MappingException(e); } } /** * Read mappings from an application resource * @param path a resource * @param classLoader a <tt>ClassLoader</tt> to use */ public Configuration addResource(String path, ClassLoader classLoader) throws MappingException { log.info("Mapping resource: " + path); InputStream rsrc = classLoader.getResourceAsStream(path); if (rsrc==null) throw new MappingException("Resource: " + path + " not found"); return addInputStream(rsrc, classLoader); } /** * Read a mapping from an application resource, using a convention. * The class <tt>foo.bar.Foo</tt> is mapped by the file <tt>foo/bar/Foo.hbm.xml</tt>. * @param persistentClass the mapped class */ public Configuration addClass(Class persistentClass) throws MappingException { String fileName = persistentClass.getName().replace(StringHelper.DOT,'/') + ".hbm.xml"; log.info("Mapping resource: " + fileName); ClassLoader cl = persistentClass.getClassLoader() ; InputStream rsrc = cl.getResourceAsStream(fileName); if (rsrc==null) throw new MappingException("Resource: " + fileName + " not found"); return addInputStream(rsrc, cl); } /** * Read all mappings from a jar file * @param resource an application resource (a jar file) */ public Configuration addJar(String resource) throws MappingException { log.info("Searching for mapping documents in jar: " + resource); final JarFile jarFile; final ClassLoader cl ; try { cl = Thread.currentThread().getContextClassLoader() ; jarFile = new JarFile( cl.getResource(resource).getFile() ); } catch (IOException ioe) { log.error("Could not configure datastore from jar", ioe); throw new MappingException(ioe); } if (jarFile==null) throw new MappingException("Resource: " + resource + " not found"); Enumeration enum = jarFile.entries(); while( enum.hasMoreElements() ) { ZipEntry z = (ZipEntry) enum.nextElement(); if( z.getName().endsWith(".hbm.xml") ) { log.info( "Found mapping documents in jar: " + z.getName() ); try { addInputStream( jarFile.getInputStream(z), cl ); } catch (MappingException me) { throw me; } catch (Exception e) { log.error("Could not configure datastore from jar", e); throw new MappingException(e); } } } return this; } --------------------------------------------------------------------- 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-07-28 10: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-214 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-214 Summary: Deadlock in processing "composite-id -> key-many-to-one" Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Assignee: Reporter: Shining Created: Mon, 28 Jul 2003 5:28 AM Updated: Mon, 28 Jul 2003 5:28 AM Environment: Windows2000 Professional with SP3, SQL Server 2000, Microsoft SQLServer 2000 JDBC Driver, SUN JDK 1.4.1_02, Elcipse 2.1 Description: I want use multi-primary-key and foriegn-key as primary-key in my project. The insert and update operator can work correctly, but the load operator can not work correctly. After tracing the source code of hibernate, I think problem is the process of the <composition-id> with <key-many-to-one> element. I can not sure it is a bug or hibernate can not support my database schema. What can I do? My Sample is: -----------------------DataBase Schema--------------------------------- /*==============================================================*/ /* Table: TBL_DWZT_NCS */ /*==============================================================*/ create table TBL_DWZT_NCS ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCS_YEFX JDBZ not null, NCS_YE JE not null, constraint PK_TBL_DWZT_NCS primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM) ) go /*==============================================================*/ /* Table: TBL_DWZT_NCSHB */ /*==============================================================*/ create table TBL_DWZT_NCSHB ( ZT_BM char(10) not null, DW_BZDM char(40) not null, NCS_FLYS_BM FLYS_BM not null, NCSHB_DM HB_DM not null, NCSHB_YE JE not null, constraint PK_TBL_DWZT_NCSHB primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM, NCSHB_DM) ) go alter table TBL_DWZT_NCSHB add constraint FK_DWZT_NCS_HB foreign key (ZT_BM, DW_BZDM, NCS_FLYS_BM) references TBL_DWZT_NCS (ZT_BM, DW_BZDM, NCS_FLYS_BM) on update cascade on delete cascade go -----------------------NCS.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCS" table="TBL_DWZT_NCS"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-property name="dw_bzdm" column="DW_BZDM"/> <key-property name="zt_bm" column="ZT_BM"/> <key-property name="flys_bm" column="NCS_FLYS_BM"/> </composite-id> <property name="yefx" column="NCS_YEFX" type="int"/> <property name="YE" column="NCS_YE" type="double"/> <set name="hbs" cascade="save-update"> <key> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key> <one-to-many class="jdo.NCSHB"/> </set> </class> </hibernate-mapping> -----------------------NCSHB.hbm.xml------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="jdo.NCSHB" table="TBL_DWZT_NCSHB"> <!--<jcs-cache usage="read-write"/>--> <composite-id> <key-many-to-one name="ncs" class="jdo.NCS"> <column name="DW_BZDM"/> <column name="ZT_BM"/> <column name="NCS_FLYS_BM" /> </key-many-to-one> <key-property name="hb_dm" column="NCSHB_DM"/> </composite-id> <property name="ye" column="NCSHB_YE" type="double"/> </class> </hibernate-mapping> ----------------------------NCS.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; import java.util.Set; import java.util.HashSet; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCS implements Serializable { private String dw_bzdm; private String zt_bm; private String flys_bm; private FLYS flys; private int yefx; private double ye; private Set hbs; /** * @return */ public String getDw_bzdm() { return dw_bzdm; } /** * @return */ public String getFlys_bm() { return flys_bm; } /** * @return */ public double getYE() { return ye; } /** * @return */ public int getYefx() { return yefx; } /** * @return */ public String getZt_bm() { return zt_bm; } /** * @param string */ public void setDw_bzdm(String string) { dw_bzdm = string; } /** * @param string */ public void setFlys_bm(String string) { flys_bm = string; } /** * @param d */ public void setYE(double d) { ye = d; } /** * @param string */ public void setYefx(int i) { yefx = i; } /** * @param string */ public void setZt_bm(String string) { zt_bm = string; } public Set getHbs() { return hbs; } void setHbs(Set hbs) { this.hbs = hbs; } void addHb(NCSHB ncshb) { if (hbs == null) hbs = new HashSet(); hbs.add(ncshb); } /** * @return */ public FLYS getFlys() { return flys; } /** * @param flys */ public void setFlys(FLYS flys) { this.flys = flys; } } ----------------------------NCSHB.java---------------------------------- /* * Created on 2003-7-10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package jdo; import java.io.Serializable; /** * @author Administrator * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class NCSHB implements Serializable { private NCS ncs; private String hb_dm; private double ye; /** * @return */ public String getHb_dm() { return hb_dm; } /** * @return */ public double getYe() { return ye; } /** * @return */ public NCS getNcs() { return ncs; } /** * @param string */ public void setHb_dm(String string) { hb_dm = string; } /** * @param d */ public void setYe(double d) { ye = d; } /** * @param ncs */ public void setNcs(NCS ncs) { this.ncs = ncs; } } ----------------------------hibernate.properties----------------------- ###################### ### Query Language ### ###################### ## define query language constants / function names hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N' ## package imports #hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg ################# ### Platforms ### ################# ## MS SQL Server hibernate.dialect net.sf.hibernate.dialect.SybaseDialect hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver #hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_XTGL;SelectMethod=cursor hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_ZWGL;SelectMethod=cursor hibernate.connection.username sa hibernate.connection.password ################################# ### Hibernate Connection Pool ### ################################# #hibernate.connection.pool_size 1 #hibernate.statement_cache.size 25 ################################### ### Apache DBCP Connection Pool ### ################################### ## connection pool hibernate.dbcp.maxActive 100 hibernate.dbcp.whenExhaustedAction 1 hibernate.dbcp.maxWait 120000 hibernate.dbcp.maxIdle 10 ## prepared statement cache hibernate.dbcp.ps.maxActive 100 hibernate.dbcp.ps.whenExhaustedAction 1 hibernate.dbcp.ps.maxWait 120000 hibernate.dbcp.ps.maxIdle 100 ## optional query to validate pooled connections: #hibernate.dbcp.validationQuery select 1 from dual #hibernate.dbcp.testOnBorrow true #hibernate.dbcp.testOnReturn false ################################# ### Plugin ConnectionProvider ### ################################# ## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics) #hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider #hibernate.connection.provider_class net.sf.hibernate.connection.ProxoolConnectionProvider ####################### ### Transaction API ### ####################### ## the Transaction API abstracts application code from the underlying JTA or JDBC transactions #hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory #hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory ## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI ## default is java:comp/UserTransaction #jta.UserTransaction jta/usertransaction #jta.UserTransaction javax.transaction.UserTransaction #jta.UserTransaction UserTransaction ## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup #hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup ############################## ### Miscellaneous Settings ### ############################## ## print all generated SQL to the console hibernate.show_sql true ## specify a JDBC isolation level #hibernate.connection.isolation 4 ## set the JDBC fetch size #hibernate.jdbc.fetch_size 25 ## set the maximum JDBC 2 batch size (a nonzero value enables batching) hibernate.jdbc.batch_size 0 ## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default) #hibernate.jdbc.use_scrollable_resultset true ## use streams when writing binary types to / from JDBC hibernate.jdbc.use_streams_for_binary true ## specify a default schema for unqualified tablenames #hibernate.default_schema test ## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used) #hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt ## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default) #hibernate.use_outer_join false ## enable CGLIB reflection optimizer (enabled by default) #hibernate.cglib.use_reflection_optimizer false ############ ### JNDI ### ############ ## specify a JNDI name for the SessionFactory #hibernate.session_factory_name hibernate/session_factory ## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction; ## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which ## is the best approach in an application server #file system #hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory #hibernate.jndi.url file:/ #WebSphere #hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory #hibernate.jndi.url iiop://localhost:900/ ----------------------------Test.java---------------------------------- 1 try { 2 // configure the Configuration 3 ds = new Configuration() 4 .addClass(jdo.NCS.class) 5 .addClass(jdo.NCSHB.class); 6 7 // build a SessionFactory 8 sessions = ds.buildSessionFactory(); 9 10 Session sess = sessions.openSession(); 11 12 NCS ncs = null; 13 14 Iterator iter = sess.iterate("FROM NCS ncs"); 15 while (iter.hasNext()) { 16 ncs = (NCS) iter.next(); 17 sess.delete(ncs); 18 } 19 20 ncs = new NCS(); 21 ncs.setDw_bzdm("0001"); 22 ncs.setZt_bm("01"); 23 ncs.setFlys_bm("[][][][][][][][]"); 24 ncs.setYefx(1); 25 ncs.setYE(1000.00); 26 NCSHB ncshb = null; ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(1000.00); ncs.addHb(ncshb); sess.save(ncs); ncs = new NCS(); ncs.setDw_bzdm("0002"); ncs.setZt_bm("01"); ncs.setFlys_bm("[01][][][][][][][]"); ncs.setYefx(1); ncs.setYE(900.00); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("RMB"); ncshb.setYe(900.00); ncs.addHb(ncshb); ncshb = new NCSHB(); ncshb.setNcs(ncs); ncshb.setHb_dm("USD"); ncshb.setYe(100.00); ncs.addHb(ncshb); sess.save(ncs); sess.delete(ncs); sess.flush(); sess.connection().commit(); sess.close(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } Deadlock occured in line 14, the session.iterator() ------------------------------Erro Message---------------------------- Hibernate: select ncs0_.DW_BZDM as x0_0_, ncs0_.ZT_BM as x0_1_, ncs0_.NCS_FLYS_BM as x0_2_ from TBL_DWZT_NCS ncs0_ Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=? Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=? .............. --------------------------------------------------------------------- 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-07-28 00:35:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sun, 27 Jul 2003 7:34 PM Thanks!! This is the worst bug found in SessionImpl for many months! Now fixed in CVS. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-209 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-209 Summary: FlushMode.AUTO problem in joined subclass hierarchy Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Fix Fors: 2.0.2 Versions: 2.0.1 Assignee: Gavin King Reporter: Panagiotis Louridas Created: Tue, 22 Jul 2003 8:09 AM Updated: Sun, 27 Jul 2003 7:34 PM Environment: RedHat Linux 9.0, JVM 1.4.2 Description: Suppose we have a class hierarchy A <- B <- C. In my case the class hierarchy is mapped as a joined-subclass hierarchy, but my observations may hold in general. I use a Session with the default FlushMode setting (FlushMode.AUTO). I open the session, load an object of class B or C, perform some changes on it, do some queries and flush the session. When the session is flushed, only updates for the table pertaining to class A are issued by hibernate. If I manually flush just before the queries hibernate performs fine, issuing the proper updates for tables B and C. The same happens when I manually flush at the end of the transaction, after the queries, but having set the Session's flush mode to FlushMode.NEVER. --------------------------------------------------------------------- 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-07-28 00:30:16
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sun, 27 Jul 2003 7:29 PM Okay, I understand now. Hibernate does _not_ support "overriding" a property mapping on a <subclass> or <joined-subclass>. It may well be possible to do what you are trying to do with a CompositeUserType. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-213 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-213 Summary: Component attributes and class hierarchy polymorphism Type: Bug Status: Closed Priority: Minor Resolution: WON'T FIX Project: Hibernate2 Versions: 2.0.1 Assignee: Reporter: Shorn Tolley Created: Sun, 27 Jul 2003 2:18 AM Updated: Sun, 27 Jul 2003 7:29 PM Environment: Win2000, JDK 1.4.2, Hibernate 2.0.1 Description: Originally posted to the forum here: http://sourceforge.net/forum/forum.php?thread_id=907924&forum_id=128638 What we want to do is map the name attribute on each concrete sybtype of Contact to a different implementation (an individual name has two components parts [first and last name] whereas an entity name has only one). My basic problem is, Hibernate seems to understand the model when inserting (the right things get into the DB), but when I load() it brings back null in the name attribute. The odd thing is, I've added a debug statement to the setName() method and hibernate first sets the name attribute to the right thing (an IndividualName object with the right values) then (inside that same call to the load() method) sets the attribute to null, *on the same instance of ContactIndividual*. This is the model for what I'm trying to do: public abstract class Contact{ public abstract Name getName(); public abstract void setName(Name name); } public class ContactIndividual extends Contact {...} public class ContectEntity extends Contact {...} public class Name { } public class IndividualName extends Name {...} public class EntityName extends Name {...} --------------------------------------------------------------------- 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-07-27 08:51:14
|
The following issue has been updated: Updater: Shorn Tolley (mailto:Sho...@nr...) Date: Sun, 27 Jul 2003 3:50 AM Comment: This is a whole (Ant based) project that I use for testing these issues. It is stripped down to the bone. Remember that the model itself for this issue is not really very simple. If you want to run the project, just unzip it, make a HibernateSimpleTest_lib directory and chuck your JDBC jars in there, then edit hibernate.properties and run the Ant "run" target. Changes: Attachment changed to HibernateSimpleTest.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-213&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-213 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-213 Summary: Component attributes and class hierarchy polymorphism Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.0.1 Assignee: Reporter: Shorn Tolley Created: Sun, 27 Jul 2003 2:18 AM Updated: Sun, 27 Jul 2003 3:50 AM Environment: Win2000, JDK 1.4.2, Hibernate 2.0.1 Description: Originally posted to the forum here: http://sourceforge.net/forum/forum.php?thread_id=907924&forum_id=128638 What we want to do is map the name attribute on each concrete sybtype of Contact to a different implementation (an individual name has two components parts [first and last name] whereas an entity name has only one). My basic problem is, Hibernate seems to understand the model when inserting (the right things get into the DB), but when I load() it brings back null in the name attribute. The odd thing is, I've added a debug statement to the setName() method and hibernate first sets the name attribute to the right thing (an IndividualName object with the right values) then (inside that same call to the load() method) sets the attribute to null, *on the same instance of ContactIndividual*. This is the model for what I'm trying to do: public abstract class Contact{ public abstract Name getName(); public abstract void setName(Name name); } public class ContactIndividual extends Contact {...} public class ContectEntity extends Contact {...} public class Name { } public class IndividualName extends Name {...} public class EntityName extends Name {...} --------------------------------------------------------------------- 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-07-27 07:19:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-213 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-213 Summary: Component attributes and class hierarchy polymorphism Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.0.1 Assignee: Reporter: Shorn Tolley Created: Sun, 27 Jul 2003 2:18 AM Updated: Sun, 27 Jul 2003 2:18 AM Environment: Win2000, JDK 1.4.2, Hibernate 2.0.1 Description: Originally posted to the forum here: http://sourceforge.net/forum/forum.php?thread_id=907924&forum_id=128638 What we want to do is map the name attribute on each concrete sybtype of Contact to a different implementation (an individual name has two components parts [first and last name] whereas an entity name has only one). My basic problem is, Hibernate seems to understand the model when inserting (the right things get into the DB), but when I load() it brings back null in the name attribute. The odd thing is, I've added a debug statement to the setName() method and hibernate first sets the name attribute to the right thing (an IndividualName object with the right values) then (inside that same call to the load() method) sets the attribute to null, *on the same instance of ContactIndividual*. This is the model for what I'm trying to do: public abstract class Contact{ public abstract Name getName(); public abstract void setName(Name name); } public class ContactIndividual extends Contact {...} public class ContectEntity extends Contact {...} public class Name { } public class IndividualName extends Name {...} public class EntityName extends Name {...} --------------------------------------------------------------------- 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-07-27 06:27:14
|
The following comment has been added to this issue: Author: Gavin King Created: Sun, 27 Jul 2003 1:26 AM Body: Yes, very good idea! :) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-212 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-212 Summary: Nightly builds or tarballs from CVS Type: New Feature Status: Assigned Priority: Minor Project: Hibernate2 Components: core Fix Fors: 2.0.2 Versions: 2.0.1 Assignee: Christian Bauer Reporter: Christian Bauer Created: Fri, 25 Jul 2003 8:28 AM Updated: Fri, 25 Jul 2003 8:28 AM Environment: n/a Description: Check SF for nightly builds and/or CVS tarballs, link on the Hibernate wiki. --------------------------------------------------------------------- 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-07-27 06:27:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sun, 27 Jul 2003 1:26 AM Well, there was no response from the user and this is certainly not a bug i= n Hibernate. So closing this issue. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?= key=3DHB-210 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-210 Summary: JTA with Websphere 5.0 in WASD 5.0 environment Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components:=20 core Versions: 2.0.1 Assignee:=20 Reporter: gilles courtial Created: Wed, 23 Jul 2003 2:55 AM Updated: Sun, 27 Jul 2003 1:26 AM Environment: ide: WSAD 5.0 os: win2000 bd: Oracle 9.2i Description: I try to use JTA transaction in websphere environment.=20 My Hibernate.cfg.xml is: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =09<property name=3D"show_sql">true</property> =09<property name=3D"use_outer_join">true</property> =09<property name=3D"jdbc.batch_size">0</property> =09<property name=3D"query.substitutions">true 1, false 0, yes 'Y', no 'N'<= /property> =09<property name=3D"jndi.class">com.ibm.websphere.naming.WsnInitialContext= Factory</property> =09=09=09 =09<property name=3D"jndi.url">iiop://localhost:2809/</property> =09<property name=3D"connection.datasource">jdbc/OracleDS</property> =09<property name=3D"connection.username">easyejb</property> =09<property name=3D"connection.password">easyejb</property> =09<property name=3D"connection.provider_class">net.sf.hibernate.connection= .DatasourceConnectionProvider</property> =09<property name=3D"jdbc.use_streams_for_binary">true</property> =09<property name=3D"dialect">net.sf.hibernate.dialect.OracleDialect</prope= rty> =09<property name=3D"transaction.factory_class">net.sf.hibernate.transactio= n.JTATransactionFactory</property> =09<property name=3D"transaction.manager_lookup_class">net.sf.hibernate.tra= nsaction.WebSphereTransactionManagerLookup</property> =09 =09 My trace: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [22/07/03 18:11:59:188 CEST] 415086d4 DatasourceCon I net.sf.hibernate.conn= ection.DatasourceConnectionProvider Using datasource: jdbc/OracleDS [22/07/03 18:11:59:188 CEST] 415086d4 SessionFactor I net.sf.hibernate.impl= .SessionFactoryImpl Use outer join fetching: true [22/07/03 18:11:59:409 CEST] 415086d4 SessionFactor I net.sf.hibernate.impl= .SessionFactoryImpl Use scrollable result sets: true [22/07/03 18:11:59:409 CEST] 415086d4 SessionFactor I net.sf.hibernate.impl= .SessionFactoryImpl Transaction strategy: net.sf.hibernate.transaction.JTA= TransactionFactory [22/07/03 18:11:59:419 CEST] 415086d4 NamingHelper I net.sf.hibernate.util= .NamingHelper JNDI InitialContext properties:{java.naming.provider.url=3Di= iop://localhost:2809/, java.naming.factory.initial=3Dcom.ibm.websphere.nami= ng.WsnInitialContextFactory} [22/07/03 18:11:59:429 CEST] 415086d4 JTATransactio I net.sf.hibernate.tran= saction.JTATransactionFactory Locating TransactionManager using: net.sf.hi= bernate.transaction.WebSphereTransactionManagerLookup [22/07/03 18:11:59:439 CEST] 415086d4 WebSphereTran I net.sf.hibernate.tran= saction.WebSphereTransactionManagerLookup getTransactionManager [22/07/03 18:11:59:439 CEST] 415086d4 WebSphereTran I net.sf.hibernate.tran= saction.WebSphereTransactionManagerLookup WebSphere 5 18:11:59,459 3706 FATAL FwormDaoException (<init>, 27 ) - =09= - Dao - La cr=C3=A9ation du mapping pour hibernate a =C3=A9chou=C3=A9 18:11:59,469 3716 DEBUG FwormDaoException (<init>, 28 ) - net= .sf.hibernate.HibernateException: Could not obtain WebSphere JTSXA instance= : getTransactionManager =3D> I don't find the com.ibm.ejcs.jts.jta.JTSXA class in WSAD 5.0. In fact= i have only com.ibm.ejs.jts.jta.JTSXA in txPrivate.jar.=20 Do you have an idea of this problem ? thanks --------------------------------------------------------------------- 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-07-26 10:24:14
|
Message: The following issue has been closed. Resolver: Max Rydahl Andersen Date: Sat, 26 Jul 2003 5:23 AM Used the submitted task as inspiration - removed some assumptions in the task that tried to be intelligent on which files should be generated or not. This is not possible to do in the ant task without also implementing the logic already in hbm2java - thus I left it out from the task as we instead should extend hbm2java to handle it uniformly (if at all possible ;) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-138 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-138 Summary: Ant task for hbm2java Type: New Feature Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: toolset Fix Fors: 2.1 Assignee: Max Rydahl Andersen Reporter: Gavin King Created: Tue, 17 Jun 2003 7:30 AM Updated: Sat, 26 Jul 2003 5:23 AM Description: Would be very nice to wrap hbm2java in an Ant Task. --------------------------------------------------------------------- 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 |