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: William R. L. <wr...@ex...> - 2003-09-27 18:29:21
|
On Sat, 27 Sep 2003, Juozas Baliuka wrote: > It must be bug in "SessionHolder". Hi, Juozas. That code below was actuallly incorrect in my last email, and I have corrected it in-line below: I am actually storing this.ftpSession instead of this.session (line 71 in the original quoted code below). As for the SessionHolder object, I'm using that so that I don't have hundreds of connections to the back-end PostgreSQL database. I've include the code beow -- it should connect to the database if needed and just return a connected net.sf.hibernate.Session object from its method. 01:public class SessionHolder 02:{ 03: private static final boolean DEBUG = true; 04: private static Session session; 05: 06: public static Session getSession() 07: { 08: SessionHolder.connect(); 09: 10: return(SessionHolder.session); 11: } 12: 13: public static void connect() 14: { 15: if (SessionHolder.session == null) 16: { 17: try 18: { 19: SessionFactory sessionFactory = new Configuration() 20: .configure().buildSessionFactory(); 21: SessionHolder.session = sessionFactory.openSession(); 22: } catch (HibernateException e) 23: { 24: if (SessionHolder.DEBUG) e.printStackTrace(); 25: } 26: } else 27: { 28: try 29: { 30: SessionHolder.session.reconnect(); 31: } catch (Exception e) {} 32: } 33: } 34: 35: public static void disconnect() 36: { 37: if (SessionHolder.session != null) 38: { 39: try 40: { 41: SessionHolder.session.close(); 42: SessionHolder.session.disconnect(); 43: } catch (HibernateException e) {} 44: } 45: } 46:} QHat do you think? Is there a better way that I should be doing this without rewriting a heck of a lot of code? I like the idea of having the session establishment self-contained within the SessionHolder object? Does this SessionHolder seem to be the culprit behind the ConcurrentModificationException issues? > > We seem to be having some problems like this in more than one section > > of code. I really don't understand it at all; we suspect some kind of > > JVM bug. Unfortunately, no-one has been able to deliver a testcase > > that will help me reproduce this on my machine. > > I can't really do much, until I can reproduce it. > > P.S. You might also get this if you share a session between two > > threads - but at least some occurrences of this problem do not seem to > > be caused by this.... > > >I'm receiving an Exception in a Hibernate application I've built, and > > >I'm a bit confused as to why this might be happening. The code at > > >where the Exception is thrown is quite simple, and I think this might > > >be a bug in Hibernate itself. I've searched Google for this to no > > >avail, and I'm using the latest recommended Hibernate release as > > >available on the site. > > >The exception I receive has a stacktrace as follows: > > > java.util.ConcurrentModificationException > > > at java.util.AbstractList$Itr.checkForComodification(Unknown Source) > > > at java.util.AbstractList$Itr.remove(Unknown Source) > > > at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101) > > > at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061) > > > at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005) > > > at net.sf.hibernate.transaction.JDBCTransaction.commit( > > > JDBCTransaction.java:57 > > > ) > > > at > org.express.ftpsrv.ConnectionHandler.<init>(ConnectionHandler.java:72) > > > at > org.express.ftpsrv.ConnectionListener.accept(ConnectionListener.java:56) > > > at > org.express.ftpsrv.ConnectionListener.main(ConnectionListener.java:19) > > > > > >And the code at ConnectionHandler.java:72 that causes this looks like: > > > > > > 52:this.ftpSession = new FtpSession(); > > > 53: > > > 54:/* ftpSession.setSessionId() does not operate on the unique > > > 55: * 'id' field that is also part of the ftpSession object. > > > 56: */ > > > 57:ftpSession.setSessionId(UniqueGenerator.makeUniqueNumber()); > > > 58: > > > 59:Date currentDate = new Date(); > > > 60:currentDate.setTime(System.currentTimeMillis()); > > > 61:this.ftpSession.setBegTime(currentDate); > > > 62: > > > 63:net.sf.hibernate.Session hSession = null; > > > 64:Transaction transaction = null; > > > 65: > > > 66:try > > > 67:{ > > > 68: hSession = SessionHolder.getSession(); > > > 69: > > > 70: transaction = hSession.beginTransaction(); > > > 71: hSession.save(this.ftpSession); > > > 72: transaction.commit(); > > > 73:} catch (HibernateException e) > > > 74:{ > > > 75: transaction.rollback(); > > > 76:} > > >I'd like to point out that this seems to be an intermittent thing, > > >occurring more often when I instantiate many objects quickly (the > > >quoted lines 52-72, above, are within a cronstructor in the Object). > > >Does anyone have any ideas as to what might be happening or where I > > >might look for additional information in order to track down this > > >bug? Thanks, in advance, for any response on this. -- _ __ __ ___ _| | William R. Lorenz <wr...@ex...> \ V V / '_| | http://www.clevelandlug.net/ ; "Every revolution was \./\./|_| |_| first a thought in one man's mind." - Ralph Waldo Emerson |
From: <leg...@at...> - 2003-09-27 13:38:11
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sat, 27 Sep 2003 8:35 AM Fixed. Thanks. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-338 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-338 Summary: NullPointerException at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 beta 4 Versions: 2.1 beta 3 Assignee: Gavin King Reporter: jason zhang Created: Tue, 16 Sep 2003 10:50 PM Updated: Sat, 27 Sep 2003 8:35 AM Environment: hibernate 2.1 beta 3. Window 2000 professional. JVM 1.4, Oracle 9. Description: I do not have this problem before when I use hibernate 2.0. yesterday I changed to 2.1 beta 3 and used <idbag>, I got this exception. This problem may be related to <idbag>. The exception is throwed just after the email is inserted. The email is a <idbag> mapped. Hibernate: insert into email (contactID, id, email, type) values (?, ?, ?, ?) Hibernate: select seq_email.nextval from dual java.lang.NullPointerException at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.collection.CollectionPersister.recreate(CollectionPersister.java:705) at net.sf.hibernate.impl.ScheduledCollectionRecreate.execute(ScheduledCollectionRecreate.java:22) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2278) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2238) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2178) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:56) at com.access.sync.framework.persistence.HibernatePersister.commit(HibernatePersister.java:311) at com.access.sync.framework.persistence.test.ContactPersisterTester.myTestSave(ContactPersisterTester.java:126) at com.access.sync.framework.persistence.test.ContactPersisterTester.testAll(ContactPersisterTester.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.doRun(TestRunner.java:109) at junit.textui.TestRunner.run(TestRunner.java:72) at junit.textui.TestRunner.run(TestRunner.java:57) --------------------------------------------------------------------- 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-09-27 11:28:20
|
Message: The following issue has been re-assigned. Assignee: Gavin King (mailto:ga...@in...) Assigner: Gavin King (mailto:ga...@in...) Date: Sat, 27 Sep 2003 6:27 AM Comment: will take a look at this... --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-351 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-351 Summary: Create schema to support mapping generation Type: New Feature Status: Assigned Priority: Minor Project: Hibernate2 Assignee: Gavin King Reporter: David Morris Created: Sun, 21 Sep 2003 10:24 AM Updated: Sat, 27 Sep 2003 6:27 AM Description: Create a Schema to better support mappings. This would allow the use of tools like JAXB to work with mapping files. --------------------------------------------------------------------- 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-09-27 11:28:20
|
The following issue has been updated: Updater: Gavin King (mailto:ga...@in...) Date: Sat, 27 Sep 2003 6:26 AM Changes: Comment changed from to --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-359&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-359 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-359 Summary: Ordered list example for the reference docs Type: Improvement Status: Assigned Priority: Trivial Project: Hibernate2 Assignee: Christian Bauer Reporter: Matt Hall Created: Tue, 23 Sep 2003 3:08 PM Updated: Sat, 27 Sep 2003 6:26 AM Environment: All Description: I wrote an example for ordered lists with the index column managed by hibernate. I had some problems figuring out the details and had to ask for help on the forum, hopefully this example in the collections mapping section of the docs will alleviate some confusion. The patch file is against the XML source file for the collections mapping chapter. --------------------------------------------------------------------- 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-09-27 11:26:20
|
Message: The following issue has been re-assigned. Assignee: Christian Bauer (mailto:chr...@hi...) Assigner: Gavin King (mailto:ga...@in...) Date: Sat, 27 Sep 2003 6:26 AM Comment: You want this? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-359 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-359 Summary: Ordered list example for the reference docs Type: Improvement Status: Assigned Priority: Trivial Project: Hibernate2 Assignee: Christian Bauer Reporter: Matt Hall Created: Tue, 23 Sep 2003 3:08 PM Updated: Sat, 27 Sep 2003 6:26 AM Environment: All Description: I wrote an example for ordered lists with the index column managed by hibernate. I had some problems figuring out the details and had to ask for help on the forum, hopefully this example in the collections mapping section of the docs will alleviate some confusion. The patch file is against the XML source file for the collections mapping chapter. --------------------------------------------------------------------- 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-09-27 11:22:30
|
Message: The following issue has been re-assigned. Assignee: Daniel Bradby (mailto:db...@ci...) Assigner: Gavin King (mailto:ga...@in...) Date: Sat, 27 Sep 2003 6:21 AM Comment: Daniel, would you please try this out? TIA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-365 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-365 Summary: TransactionManagerLookup for WebSphere 5.0 Type: Patch Status: Assigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 2.0.3 Assignee: Daniel Bradby Reporter: Ralf Taugerbeck Created: Fri, 26 Sep 2003 5:08 AM Updated: Sat, 27 Sep 2003 6:21 AM Environment: WebSphere 5.0 Description: The TransactionManagerLookup issue on WebSphere 5.0 was already resolved in HB-240 but IMO the code should look as shown in the attached Patch. BTW, there is no class "com.ibm.ejcs.jts.jta.JTSXA" in WAS 5.0 --------------------------------------------------------------------- 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-09-27 10:53:20
|
The following comment has been added to this issue: Author: Gavin King Created: Sat, 27 Sep 2003 5:52 AM Body: Please do not give me useless create tables SQL scripts! Your test should create its own schema and data. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-367 Summary: JCSCache.put java.lang.Error: update: last is null! Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 3 Assignee: Reporter: John Kristian Created: Fri, 26 Sep 2003 4:15 PM Updated: Fri, 26 Sep 2003 6:03 PM Environment: Windows XP, Microsoft SQL Server Description: With Hibernate `cvs checkout -r v21branch` (but not 2.0.2), the following errors occur. 14:05:11,046 ERROR [org.apache.jcs.engine.memory.lru.LRUMemoryCache] verifycache: map does NOT contain key, what the HECK! 14:05:11,046 ERROR [com.docent.lms.entities.tests.hibernate.Scan] testScan failed java.lang.Error: update: last is null! at org.apache.jcs.engine.memory.lru.LRUMemoryCache.update(LRUMemoryCache.java:140) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:241) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:200) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:311) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:279) at net.sf.hibernate.cache.JCSCache.put(JCSCache.java:34) at net.sf.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:86) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2191) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216) at net.sf.hibernate.loader.Loader.doFind(Loader.java:111) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:664) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:679) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:52) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:44) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:424) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2115) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.assemble(EntityType.java:113) at net.sf.hibernate.collection.Set.<init>(Set.java:94) at net.sf.hibernate.type.SetType.assembleCachedCollection(SetType.java:36) at net.sf.hibernate.collection.CollectionPersister.getCachedCollection(CollectionPersister.java:371) at net.sf.hibernate.type.PersistentCollectionType.getCollection(PersistentCollectionType.java:67) at net.sf.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentCollectionType.java:184) at net.sf.hibernate.type.PersistentCollectionType.assemble(PersistentCollectionType.java:134) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:54) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:46) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2100) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:129) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:67) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:87) at com.docent.lms.entities.tests.hibernate.Scan.scan(Scan.java:59) --------------------------------------------------------------------- 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-09-27 10:52:20
|
Message: The following issue has been closed. Resolver: Gavin King Date: Sat, 27 Sep 2003 5:50 AM Thanks. Fixed. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-364 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-364 Summary: One to One foreign Key issue Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Fix Fors: 2.1 beta 4 Versions: 2.0.3 Assignee: Reporter: Jon King Created: Thu, 25 Sep 2003 10:09 PM Updated: Sat, 27 Sep 2003 5:50 AM Environment: Windows 2000, Ant 1.5.4, Oracle 8i, Java 1.4 Description: I have a PURCHASE ORDER with a one to one relationship with a BUYER and SUPPLIER, I have set it up so the PK of the Purchase Order is the FK of the BUYER & SELLER tables but only the last one-to-one foreign key is ever created. <class name="domain.TxPurchaseOrder" table="TX_PURCHASE_ORDER"> .... <id column="PO_ID" name="id" type="long" unsaved-value="null"> <generator class="sequence" > <param name="sequence">TX_PURCHASE_ORDER_SEQ</param> </generator> </id> <one-to-one name="SellingParty" class="domain.TxPoSellingParty" cascade="all" constrained="true" /> <one-to-one name="BuyingParty" class="domain.TxPoBuyingParty" cascade="all" constrained="true"/> ... </class> In the Selling and Buying classes I have :- <id column="PO_ID" name="id" type="long" unsaved-value="null"> <generator class="foreign" /> </id> In the output I get: - [java] alter table TX_PURCHASE_ORDER add constraint FK8092ED8B48CAF5B foreign key (PO_ID) references TX_PO_BUYING_PARTY but the Selling Party does not get a foreign key. I would have expected both to get a foreign key contraint, have I done something wrong or is this correct ? --------------------------------------------------------------------- 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: Gavin K. <ga...@hi...> - 2003-09-27 10:49:45
|
We seem to be having some problems like this in more than one section of code. I really don't understand it at all; we suspect some kind of JVM bug. Unfortunately, no-one has been able to deliver a testcase that will help me reproduce this on my machine. I can't really do much, until I can reproduce it. P.S. You might also get this if you share a session between two threads - but at least some occurrences of this problem do not seem to be caused by this.... William R. Lorenz wrote: >Fellow Hibernaters, > >I'm receiving an Exception in a Hibernate application I've built, and I'm >a bit confused as to why this might be happening. The code at where the >Exception is thrown is quite simple, and I think this might be a bug in >Hibernate itself. I've searched Google for this to no avail, and I'm >using the latest recommended Hibernate release as available on the site. > >The exception I receive has a stacktrace as follows: > > java.util.ConcurrentModificationException > at java.util.AbstractList$Itr.checkForComodification(Unknown Source) > at java.util.AbstractList$Itr.remove(Unknown Source) > at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101) > at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061) > at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005) > at net.sf.hibernate.transaction.JDBCTransaction.commit( > JDBCTransaction.java:57 > ) > at org.express.ftpsrv.ConnectionHandler.<init>(ConnectionHandler.java:72) > at org.express.ftpsrv.ConnectionListener.accept(ConnectionListener.java:56) > at org.express.ftpsrv.ConnectionListener.main(ConnectionListener.java:19) > >And the code at ConnectionHandler.java:72 that causes this looks like: > > 52:this.ftpSession = new FtpSession(); > 53: > 54:/* ftpSession.setSessionId() does not operate on the unique > 55: * 'id' field that is also part of the ftpSession object. > 56: */ > 57:ftpSession.setSessionId(UniqueGenerator.makeUniqueNumber()); > 58: > 59:Date currentDate = new Date(); > 60:currentDate.setTime(System.currentTimeMillis()); > 61:this.ftpSession.setBegTime(currentDate); > 62: > 63:net.sf.hibernate.Session hSession = null; > 64:Transaction transaction = null; > 65: > 66:try > 67:{ > 68: hSession = SessionHolder.getSession(); > 69: > 70: transaction = hSession.beginTransaction(); > 71: hSession.save(this.session); > 72: transaction.commit(); > 73:} catch (HibernateException e) > 74:{ > 75: transaction.rollback(); > 76:} > >I'd like to point out that this seems to be an intermittent thing, >occurring more often when I instantiate many objects quickly (the quoted >lines 52-72, above, are within a cronstructor in the Object). > >Does anyone have any ideas as to what might be happening or where I might >look for additional information in order to track down this bug? > >Thanks, in advance, for any response on this. > >-- _ >__ __ ___ _| | William R. Lorenz <wr...@ex...> >\ V V / '_| | http://www.clevelandlug.net/ ; "Every revolution was > \./\./|_| |_| first a thought in one man's mind." - Ralph Waldo Emerson > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >hibernate-devel mailing list >hib...@li... >https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > |
From: William R. L. <wr...@ex...> - 2003-09-27 04:12:06
|
Fellow Hibernaters, I'm receiving an Exception in a Hibernate application I've built, and I'm a bit confused as to why this might be happening. The code at where the Exception is thrown is quite simple, and I think this might be a bug in Hibernate itself. I've searched Google for this to no avail, and I'm using the latest recommended Hibernate release as available on the site. The exception I receive has a stacktrace as follows: java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(Unknown Source) at java.util.AbstractList$Itr.remove(Unknown Source) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005) at net.sf.hibernate.transaction.JDBCTransaction.commit( JDBCTransaction.java:57 ) at org.express.ftpsrv.ConnectionHandler.<init>(ConnectionHandler.java:72) at org.express.ftpsrv.ConnectionListener.accept(ConnectionListener.java:56) at org.express.ftpsrv.ConnectionListener.main(ConnectionListener.java:19) And the code at ConnectionHandler.java:72 that causes this looks like: 52:this.ftpSession = new FtpSession(); 53: 54:/* ftpSession.setSessionId() does not operate on the unique 55: * 'id' field that is also part of the ftpSession object. 56: */ 57:ftpSession.setSessionId(UniqueGenerator.makeUniqueNumber()); 58: 59:Date currentDate = new Date(); 60:currentDate.setTime(System.currentTimeMillis()); 61:this.ftpSession.setBegTime(currentDate); 62: 63:net.sf.hibernate.Session hSession = null; 64:Transaction transaction = null; 65: 66:try 67:{ 68: hSession = SessionHolder.getSession(); 69: 70: transaction = hSession.beginTransaction(); 71: hSession.save(this.session); 72: transaction.commit(); 73:} catch (HibernateException e) 74:{ 75: transaction.rollback(); 76:} I'd like to point out that this seems to be an intermittent thing, occurring more often when I instantiate many objects quickly (the quoted lines 52-72, above, are within a cronstructor in the Object). Does anyone have any ideas as to what might be happening or where I might look for additional information in order to track down this bug? Thanks, in advance, for any response on this. -- _ __ __ ___ _| | William R. Lorenz <wr...@ex...> \ V V / '_| | http://www.clevelandlug.net/ ; "Every revolution was \./\./|_| |_| first a thought in one man's mind." - Ralph Waldo Emerson |
From: <leg...@at...> - 2003-09-26 23:04:20
|
The following issue has been updated: Updater: John Kristian (mailto:jkr...@do...) Date: Fri, 26 Sep 2003 6:03 PM Comment: test2.1beta3b.zip (attached) is a very similar test case executed with hibernate2.jar from release 2.1beta3b, instead of a hibernate2.jar built from the public CVS repository. (It also contains the improved createTables.sql). Changes: Attachment changed to test2.1beta3b.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-367 Summary: JCSCache.put java.lang.Error: update: last is null! Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 3 Assignee: Reporter: John Kristian Created: Fri, 26 Sep 2003 4:15 PM Updated: Fri, 26 Sep 2003 6:03 PM Environment: Windows XP, Microsoft SQL Server Description: With Hibernate `cvs checkout -r v21branch` (but not 2.0.2), the following errors occur. 14:05:11,046 ERROR [org.apache.jcs.engine.memory.lru.LRUMemoryCache] verifycache: map does NOT contain key, what the HECK! 14:05:11,046 ERROR [com.docent.lms.entities.tests.hibernate.Scan] testScan failed java.lang.Error: update: last is null! at org.apache.jcs.engine.memory.lru.LRUMemoryCache.update(LRUMemoryCache.java:140) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:241) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:200) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:311) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:279) at net.sf.hibernate.cache.JCSCache.put(JCSCache.java:34) at net.sf.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:86) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2191) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216) at net.sf.hibernate.loader.Loader.doFind(Loader.java:111) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:664) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:679) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:52) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:44) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:424) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2115) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.assemble(EntityType.java:113) at net.sf.hibernate.collection.Set.<init>(Set.java:94) at net.sf.hibernate.type.SetType.assembleCachedCollection(SetType.java:36) at net.sf.hibernate.collection.CollectionPersister.getCachedCollection(CollectionPersister.java:371) at net.sf.hibernate.type.PersistentCollectionType.getCollection(PersistentCollectionType.java:67) at net.sf.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentCollectionType.java:184) at net.sf.hibernate.type.PersistentCollectionType.assemble(PersistentCollectionType.java:134) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:54) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:46) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2100) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:129) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:67) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:87) at com.docent.lms.entities.tests.hibernate.Scan.scan(Scan.java:59) --------------------------------------------------------------------- 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-09-26 22:37:10
|
The following issue has been updated: Updater: John Kristian (mailto:jkr...@do...) Date: Fri, 26 Sep 2003 5:35 PM Comment: test2.zip contains a createTables.sql file that depends on tables that it doesn't create. Sorry about that. createTables.sql (attached) is better; use it instead of the one in test2.zip. Changes: Attachment changed to createTables.sql --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-367 Summary: JCSCache.put java.lang.Error: update: last is null! Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 3 Assignee: Reporter: John Kristian Created: Fri, 26 Sep 2003 4:15 PM Updated: Fri, 26 Sep 2003 5:35 PM Environment: Windows XP, Microsoft SQL Server Description: With Hibernate `cvs checkout -r v21branch` (but not 2.0.2), the following errors occur. 14:05:11,046 ERROR [org.apache.jcs.engine.memory.lru.LRUMemoryCache] verifycache: map does NOT contain key, what the HECK! 14:05:11,046 ERROR [com.docent.lms.entities.tests.hibernate.Scan] testScan failed java.lang.Error: update: last is null! at org.apache.jcs.engine.memory.lru.LRUMemoryCache.update(LRUMemoryCache.java:140) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:241) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:200) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:311) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:279) at net.sf.hibernate.cache.JCSCache.put(JCSCache.java:34) at net.sf.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:86) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2191) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216) at net.sf.hibernate.loader.Loader.doFind(Loader.java:111) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:664) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:679) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:52) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:44) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:424) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2115) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.assemble(EntityType.java:113) at net.sf.hibernate.collection.Set.<init>(Set.java:94) at net.sf.hibernate.type.SetType.assembleCachedCollection(SetType.java:36) at net.sf.hibernate.collection.CollectionPersister.getCachedCollection(CollectionPersister.java:371) at net.sf.hibernate.type.PersistentCollectionType.getCollection(PersistentCollectionType.java:67) at net.sf.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentCollectionType.java:184) at net.sf.hibernate.type.PersistentCollectionType.assemble(PersistentCollectionType.java:134) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:54) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:46) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2100) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:129) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:67) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:87) at com.docent.lms.entities.tests.hibernate.Scan.scan(Scan.java:59) --------------------------------------------------------------------- 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-09-26 21:28:19
|
The following issue has been updated: Updater: John Kristian (mailto:jkr...@do...) Date: Fri, 26 Sep 2003 4:27 PM Comment: test2.zip (attached) contains a fairly simple test case and detailed log file, which I hope will help isolate the problem. Part of the problem, it appears, is that Hibernate uses a RolePermissionAssociation$Id as a key for a JCS region map, but the Id refers to a Role whose id has not been loaded. Subsequently, Hibernate loads the Role id, which changes the RolePermissionAssociation Id.hashCode(), which causes the Id to be 'lost' in the JCS region map. Eventually, the JCS region contains several such lost keys in its map but nothing in its list (all entries were evicted because the map contains more keys than the cache size limit). At this point, JCS throws the problematic exception. I reported this bug previously, in HB-342. That issue was closed because Gavin was unable to reproduce the problem. This test case will be more helpful, I hope: I have eliminated some dependencies, and supplied more information which I hope will help reproduce the problem. Changes: Attachment changed to test2.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-367 Summary: JCSCache.put java.lang.Error: update: last is null! Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 3 Assignee: Reporter: John Kristian Created: Fri, 26 Sep 2003 4:15 PM Updated: Fri, 26 Sep 2003 4:27 PM Environment: Windows XP, Microsoft SQL Server Description: With Hibernate `cvs checkout -r v21branch` (but not 2.0.2), the following errors occur. 14:05:11,046 ERROR [org.apache.jcs.engine.memory.lru.LRUMemoryCache] verifycache: map does NOT contain key, what the HECK! 14:05:11,046 ERROR [com.docent.lms.entities.tests.hibernate.Scan] testScan failed java.lang.Error: update: last is null! at org.apache.jcs.engine.memory.lru.LRUMemoryCache.update(LRUMemoryCache.java:140) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:241) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:200) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:311) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:279) at net.sf.hibernate.cache.JCSCache.put(JCSCache.java:34) at net.sf.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:86) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2191) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216) at net.sf.hibernate.loader.Loader.doFind(Loader.java:111) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:664) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:679) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:52) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:44) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:424) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2115) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.assemble(EntityType.java:113) at net.sf.hibernate.collection.Set.<init>(Set.java:94) at net.sf.hibernate.type.SetType.assembleCachedCollection(SetType.java:36) at net.sf.hibernate.collection.CollectionPersister.getCachedCollection(CollectionPersister.java:371) at net.sf.hibernate.type.PersistentCollectionType.getCollection(PersistentCollectionType.java:67) at net.sf.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentCollectionType.java:184) at net.sf.hibernate.type.PersistentCollectionType.assemble(PersistentCollectionType.java:134) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:54) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:46) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2100) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:129) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:67) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:87) at com.docent.lms.entities.tests.hibernate.Scan.scan(Scan.java:59) --------------------------------------------------------------------- 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-09-26 21:15:20
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-367 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-367 Summary: JCSCache.put java.lang.Error: update: last is null! Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 3 Assignee: Reporter: John Kristian Created: Fri, 26 Sep 2003 4:15 PM Updated: Fri, 26 Sep 2003 4:15 PM Environment: Windows XP, Microsoft SQL Server Description: With Hibernate `cvs checkout -r v21branch` (but not 2.0.2), the following errors occur. 14:05:11,046 ERROR [org.apache.jcs.engine.memory.lru.LRUMemoryCache] verifycache: map does NOT contain key, what the HECK! 14:05:11,046 ERROR [com.docent.lms.entities.tests.hibernate.Scan] testScan failed java.lang.Error: update: last is null! at org.apache.jcs.engine.memory.lru.LRUMemoryCache.update(LRUMemoryCache.java:140) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:241) at org.apache.jcs.engine.control.CompositeCache.update(CompositeCache.java:200) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:311) at org.apache.jcs.access.CacheAccess.put(CacheAccess.java:279) at net.sf.hibernate.cache.JCSCache.put(JCSCache.java:34) at net.sf.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:86) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2191) at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216) at net.sf.hibernate.loader.Loader.doFind(Loader.java:111) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:664) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:679) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:52) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:44) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:424) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2115) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.assemble(EntityType.java:113) at net.sf.hibernate.collection.Set.<init>(Set.java:94) at net.sf.hibernate.type.SetType.assembleCachedCollection(SetType.java:36) at net.sf.hibernate.collection.CollectionPersister.getCachedCollection(CollectionPersister.java:371) at net.sf.hibernate.type.PersistentCollectionType.getCollection(PersistentCollectionType.java:67) at net.sf.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentCollectionType.java:184) at net.sf.hibernate.type.PersistentCollectionType.assemble(PersistentCollectionType.java:134) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:54) at net.sf.hibernate.impl.CacheEntry.assemble(CacheEntry.java:46) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2100) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1977) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1936) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:76) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:129) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:67) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:87) at com.docent.lms.entities.tests.hibernate.Scan.scan(Scan.java:59) --------------------------------------------------------------------- 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-09-26 13:15:57
|
The following comment has been added to this issue: Author: Eric Fenderbosch Created: Fri, 26 Sep 2003 8:15 AM Body: I read the other JIRA issue and it was rejected. I also read the old sourceforge forum thread and you state that it _should_ work the way I'm suggesting. Just curious what the reasoning is for not making this change. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-329 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-329 Summary: <property name="default_schema"> Does not propagate to non-Table types Type: Bug Status: Closed Priority: Minor Resolution: WON'T FIX Project: Hibernate2 Components: core Versions: 2.0.3 Assignee: Reporter: Eric Fenderbosch Created: Fri, 12 Sep 2003 12:44 PM Updated: Thu, 25 Sep 2003 3:35 PM Description: When specifing <property name="default_schema">eousr</property> in cfg.xml, this does not have any effect on sequence names. Example: <id name="id" type="java.lang.Long"> <column name="TARIFF_ID"/> <generator class="sequence"> <param name="sequence">tariff_seq</param> </generator> </id> However, if the schema is specified in the mapping using <hibernate-mapping schema="eousr"> or <class name="com.fedex.cc.objectlib.tariff.TariffState" table="TARIFF" schema="eousr"> then it works as expected. --------------------------------------------------------------------- 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-09-26 10:27:55
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-366 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-366 Summary: Length and precision of Numeric Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 3 Assignee: Reporter: xfgdf Created: Fri, 26 Sep 2003 5:27 AM Updated: Fri, 26 Sep 2003 5:27 AM Environment: Hibernate 2.1 beta 3 (7.9.2003) Description: The default mapping of java.util.BigDecimal is the Decimal hibernate type, which is translate in most dialect in "NUMBER(19, $l)". This don't allow us to specify the length of the number, only is precision. The main problem come from the default value of the length use is the Column.DEFAULT_PROPERTY_LENGTH=255. This make an invalid type because the precision can't be greater than the length (NUMERIC(19, 255)). It would be great to have a different default value for the length (something like 2), and also to be able to specify the precision in the mapping file (may be by something like <property name="price" length="19,4" />). Adrien --------------------------------------------------------------------- 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-09-26 10:27:55
|
The following comment has been added to this issue: Author: xfgdf Created: Fri, 26 Sep 2003 5:27 AM Body: Sorry, wrong project (bug re-enter in Hibernate2)... --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-12 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-12 Summary: Length and precision of Numeric Type: Bug Status: Unassigned Priority: Major Project: Hibernate 1.2 Assignee: Reporter: xfgdf Created: Fri, 26 Sep 2003 5:24 AM Updated: Fri, 26 Sep 2003 5:24 AM Environment: Hibernate 2.1 beta 3 (7.9.2003) Description: The default mapping of java.util.BigDecimal is the Decimal hibernate type, which is translate in most dialect in "NUMBER(19, $l)". This don't allow us to specify the length of the number, only is precision. The main problem come from the default value of the length use is the Column.DEFAULT_PROPERTY_LENGTH=255. This make an invalid type because the precision can't be greater than the length (NUMERIC(19, 255)). It would be great to have a different default value for the length (something like 2), and also to be able to specify the precision in the mapping file (may be by something like <property name="price" length="19,4" />). --------------------------------------------------------------------- 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-09-26 10:25:55
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-12 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-12 Summary: Length and precision of Numeric Type: Bug Status: Unassigned Priority: Major Project: Hibernate 1.2 Assignee: Reporter: xfgdf Created: Fri, 26 Sep 2003 5:24 AM Updated: Fri, 26 Sep 2003 5:24 AM Environment: Hibernate 2.1 beta 3 (7.9.2003) Description: The default mapping of java.util.BigDecimal is the Decimal hibernate type, which is translate in most dialect in "NUMBER(19, $l)". This don't allow us to specify the length of the number, only is precision. The main problem come from the default value of the length use is the Column.DEFAULT_PROPERTY_LENGTH=255. This make an invalid type because the precision can't be greater than the length (NUMERIC(19, 255)). It would be great to have a different default value for the length (something like 2), and also to be able to specify the precision in the mapping file (may be by something like <property name="price" length="19,4" />). --------------------------------------------------------------------- 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-09-26 10:10:54
|
The following issue has been updated: Updater: Ralf Taugerbeck (mailto:ral...@ab...) Date: Fri, 26 Sep 2003 5:09 AM Changes: Attachment changed to WebSphereTransactionManagerLookup.patch --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-365&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-365 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-365 Summary: TransactionManagerLookup for WebSphere 5.0 Type: Patch Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 2.0.3 Assignee: Reporter: Ralf Taugerbeck Created: Fri, 26 Sep 2003 5:08 AM Updated: Fri, 26 Sep 2003 5:09 AM Environment: WebSphere 5.0 Description: The TransactionManagerLookup issue on WebSphere 5.0 was already resolved in HB-240 but IMO the code should look as shown in the attached Patch. BTW, there is no class "com.ibm.ejcs.jts.jta.JTSXA" in WAS 5.0 --------------------------------------------------------------------- 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-09-26 10:08:55
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-365 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-365 Summary: TransactionManagerLookup for WebSphere 5.0 Type: Patch Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 2.0.3 Assignee: Reporter: Ralf Taugerbeck Created: Fri, 26 Sep 2003 5:08 AM Updated: Fri, 26 Sep 2003 5:08 AM Environment: WebSphere 5.0 Description: The TransactionManagerLookup issue on WebSphere 5.0 was already resolved in HB-240 but IMO the code should look as shown in the attached Patch. BTW, there is no class "com.ibm.ejcs.jts.jta.JTSXA" in WAS 5.0 --------------------------------------------------------------------- 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-09-26 09:51:56
|
The following comment has been added to this issue: Author: Ralf Taugerbeck Created: Fri, 26 Sep 2003 4:51 AM Body: The issue was fixed by HB-360 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-268 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-268 Summary: java.sql.Connection.getWarning() is not allowed on closed con. Type: Patch Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 Assignee: Reporter: Avoka Created: Sat, 16 Aug 2003 10:25 AM Updated: Sat, 16 Aug 2003 10:25 AM Description: Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactory Impl.java,v retrieving revision 1.26.2.3 diff -r1.26.2.3 SessionFactoryImpl.java 267c267 < --- > 299,300c299,302 < JDBCExceptionReporter.logWarnings( conn.getWarnings() ); < conn.clearWarnings(); --- > if(!conn.isClosed()) { > JDBCExceptionReporter.logWarnings( conn.getWarnings() ); > conn.clearWarnings(); > } --------------------------------------------------------------------- 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-09-26 08:54:07
|
The following comment has been added to this issue: Author: Gavin King Created: Fri, 26 Sep 2003 3:53 AM Body: Please submit a test case to reproduce this problem. TIA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-364 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-364 Summary: One to One foreign Key issue Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Jon King Created: Thu, 25 Sep 2003 10:09 PM Updated: Thu, 25 Sep 2003 10:09 PM Environment: Windows 2000, Ant 1.5.4, Oracle 8i, Java 1.4 Description: I have a PURCHASE ORDER with a one to one relationship with a BUYER and SUPPLIER, I have set it up so the PK of the Purchase Order is the FK of the BUYER & SELLER tables but only the last one-to-one foreign key is ever created. <class name="domain.TxPurchaseOrder" table="TX_PURCHASE_ORDER"> .... <id column="PO_ID" name="id" type="long" unsaved-value="null"> <generator class="sequence" > <param name="sequence">TX_PURCHASE_ORDER_SEQ</param> </generator> </id> <one-to-one name="SellingParty" class="domain.TxPoSellingParty" cascade="all" constrained="true" /> <one-to-one name="BuyingParty" class="domain.TxPoBuyingParty" cascade="all" constrained="true"/> ... </class> In the Selling and Buying classes I have :- <id column="PO_ID" name="id" type="long" unsaved-value="null"> <generator class="foreign" /> </id> In the output I get: - [java] alter table TX_PURCHASE_ORDER add constraint FK8092ED8B48CAF5B foreign key (PO_ID) references TX_PO_BUYING_PARTY but the Selling Party does not get a foreign key. I would have expected both to get a foreign key contraint, have I done something wrong or is this correct ? --------------------------------------------------------------------- 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-09-26 03:09:54
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-364 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-364 Summary: One to One foreign Key issue Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Jon King Created: Thu, 25 Sep 2003 10:09 PM Updated: Thu, 25 Sep 2003 10:09 PM Environment: Windows 2000, Ant 1.5.4, Oracle 8i, Java 1.4 Description: I have a PURCHASE ORDER with a one to one relationship with a BUYER and SUPPLIER, I have set it up so the PK of the Purchase Order is the FK of the BUYER & SELLER tables but only the last one-to-one foreign key is ever created. <class name="domain.TxPurchaseOrder" table="TX_PURCHASE_ORDER"> .... <id column="PO_ID" name="id" type="long" unsaved-value="null"> <generator class="sequence" > <param name="sequence">TX_PURCHASE_ORDER_SEQ</param> </generator> </id> <one-to-one name="SellingParty" class="domain.TxPoSellingParty" cascade="all" constrained="true" /> <one-to-one name="BuyingParty" class="domain.TxPoBuyingParty" cascade="all" constrained="true"/> ... </class> In the Selling and Buying classes I have :- <id column="PO_ID" name="id" type="long" unsaved-value="null"> <generator class="foreign" /> </id> In the output I get: - [java] alter table TX_PURCHASE_ORDER add constraint FK8092ED8B48CAF5B foreign key (PO_ID) references TX_PO_BUYING_PARTY but the Selling Party does not get a foreign key. I would have expected both to get a foreign key contraint, have I done something wrong or is this correct ? --------------------------------------------------------------------- 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-09-25 22:26:54
|
The following comment has been added to this issue: Author: Brian Bonner Created: Thu, 25 Sep 2003 5:26 PM Body: I did research on the knowledgebase. Apparently, there is an item in the support database that is close: http://www-1.ibm.com/support/docview.wss?rs=0&context=SSEPGG&q=%2bidentity&uid=swg21007891&loc=en_US&cs=utf-8&cc=US&lang=en ALTER TABLE <table> ALTER COLUMN <id col> RESTART WITH <nextval> So in my example: After I do my inserts from the CLP, if I execute: ALTER TABLE PARENTS ALTER COLUMN KEY_ID RESTART WITH 500 Hibernate will start with 500. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-362 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-362 Summary: Save with native ID on DB2 fails with duplicate row exception if data inserted behind hibernate Type: Bug Status: Closed Priority: Critical Resolution: REJECTED Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Brian Bonner Created: Thu, 25 Sep 2003 11:53 AM Updated: Thu, 25 Sep 2003 3:39 PM Environment: Win 2K SP4, JDK 1.4.2, Hibernate 2.0.3, DB2 7.2 UDB Description: If we restart the database manager (clean state), then execute the DDL generated by hibernate, and run the test case: TestHibernate records are inserted without problem. We can rerun the test case numerous times. If we restart the database manager, then insert data from a command line (behind hibernate): insert into parents values(1,'test','test','test','test',current timestamp); insert into children values (1,'bb','1); insert into children values (2,'cc','1); and run the test case, it fails. hibernate.properties, Mapping, generated DDL, Domain Source, Test Source follows. hibernate.connection.driver_class = COM.ibm.db2.jdbc.app.DB2Driver hibernate.dialect = net.sf.hibernate.dialect.DB2Dialect hibernate.connection.url = jdbc:db2:sample hibernate.connection.username = xyz hibernate.connection.password = pdq <?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="com.paraware.domain.Parent" table="parents"> <id name="keyId" type="int" unsaved-value="0"> <column name="key_id" not-null="true"/> <generator class="native"/> </id> <property name="userID" column="LogonID" type="string"/> <property name="userName" column="Name" type="string"/> <property name="password" type="string"/> <property name="emailAddress" type="string"/> <property name="lastLogon" type="timestamp"/> <set name="children" table="children" cascade="all" lazy="true" inverse="true"> <key column="key_id"/> <one-to-many class="com.paraware.domain.Child"/> </set> </class> </hibernate-mapping> <?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="com.paraware.domain.Child" table="children"> <id name="mouseId" type="int" unsaved-value="0"> <column name="mouse_id" not-null="true"/> <generator class="native"/> </id> <property name="name" column="name" type="string"/> <many-to-one name="parent" class="com.paraware.domain.Parent" column="key_id" /> </class> </hibernate-mapping> drop table parents; drop table children; create table parents ( key_id INTEGER not null generated by default as identity, LogonID VARCHAR(255), Name VARCHAR(255), password VARCHAR(255), emailAddress VARCHAR(255), lastLogon TIMESTAMP, primary key (key_id) ); create table children ( mouse_id INTEGER not null generated by default as identity, name VARCHAR(255), key_id INTEGER, primary key (mouse_id) ); alter table children add constraint FK62EA5DFFBC5E42FB foreign key (key_id) references parents; package com.paraware.domain; import java.util.Date; import java.util.Set; // ... public class Parent { private int keyId; private String userID; private String userName; private String password; private String emailAddress; private Date lastLogon; private Set children; public int getKeyId() { return keyId; } public void setKeyId(int keyId) { this.keyId = keyId; } public String getUserID() { return userID; } public void setUserID(String newUserID) { userID = newUserID; } public String getUserName() { return userName; } public void setUserName(String newUserName) { userName = newUserName; } public String getPassword() { return password; } public void setPassword(String newPassword) { password = newPassword; } public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String newEmailAddress) { emailAddress = newEmailAddress; } public Date getLastLogon() { return lastLogon; } public void setLastLogon(Date newLastLogon) { lastLogon = newLastLogon; } public Set getChildren() { return children; } public void setChildren(Set mouses) { this.children = mouses; } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || (obj.getClass() != this.getClass())) return false; // Must be the Parent Parent other = (Parent) obj; return userID == other.userID || userID != null && userID.equals(other.userID) && userName == other.userName || userName != null && userName.equals(other.userName); } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode() { int result = 17; result = userID == null ? result : 37 * result + userID.hashCode(); result = userName == null ? result : 37 * result + userName.hashCode(); return result; } } package com.paraware.domain; public class Child { private int mouseId; private String name; private Parent parent; public int getMouseId() { return mouseId; } public void setMouseId(int id) { this.mouseId = id; } public String getName() { return name; } public void setName(String newName) { name = newName; } public Parent getParent() { return parent; } public void setParent(Parent newUser) { parent = newUser; } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || (obj.getClass() != this.getClass())) return false; // Must be the Child Child other = (Child) obj; return name == other.name || name != null && name.equals(other.name); } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode() { int result = 17; result = name == null ? result : 37 * result + name.hashCode(); return result; } } package com.paraware; import java.sql.SQLException; import java.util.Date; import java.util.HashSet; import java.util.Set; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Transaction; import net.sf.hibernate.cfg.Configuration; import com.paraware.domain.Child; import com.paraware.domain.Parent; public class TestHibernate { public static void main(String args[]) throws HibernateException, SQLException { SessionFactory sessionFactory; Transaction transaction; Configuration cfg = new Configuration(); cfg.addClass(Parent.class); cfg.addClass(Child.class); sessionFactory = cfg.buildSessionFactory(); Session session = sessionFactory.openSession(); transaction = session.beginTransaction(); Parent newUser = new Parent(); newUser.setUserID("bnnn"); newUser.setUserName("Vivi"); newUser.setPassword("abcff"); newUser.setEmailAddress("vi...@co..."); newUser.setLastLogon(new Date()); session.save(newUser); Child ms1 = new Child(); ms1.setName("Mickey"); Child ms2 = new Child(); ms2.setName("Mouse"); Set mouseSet = new HashSet(); mouseSet.add(ms1); mouseSet.add(ms2); //set up association newUser.setChildren(mouseSet); //save foreign keys ms1.setParent(newUser); ms2.setParent(newUser); transaction.commit(); // close our session and release resources session.flush(); session.close(); } } --------------------------------------------------------------------- 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-09-25 22:13:55
|
The following comment has been added to this issue: Author: Brian Bonner Created: Thu, 25 Sep 2003 5:13 PM Body: Gavin, I will pursue with IBM. I wrote a test case with a similar result. I create the tables, I insert the values: insert into parents values(1,'test','test','test','test',current timestamp); insert into children values (1,'bb',1); insert into children values (2,'cc',1); and then I run: package com.paraware; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; /** * */ public class TestDB2 { /** * */ public TestDB2() { super(); // TODO Auto-generated constructor stub } public static void main(String[] args) { try { Driver driver = (Driver) Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance(); DriverManager.registerDriver(driver); Connection conn = DriverManager.getConnection("jdbc:db2:pbbtest", "user", "demo"); conn.setAutoCommit(false); conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); PreparedStatement stmt = conn.prepareStatement( "insert into parents (LogonID, Name, password, emailAddress, lastLogon, key_id) values (?, ?, ?, ?, ?, default)"); stmt.setString(1, "bnnn"); stmt.setString(2, "Vivi"); stmt.setString(3, "abcff"); stmt.setString(4, "vi...@co...m"); stmt.setTimestamp(5, new Timestamp(new Date().getTime())); stmt.executeUpdate(); stmt.close(); conn.commit(); conn.close(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } } and bang: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0803N One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "1" constrains table "USER.PARENTS" from having duplicate rows for those columns. SQLSTATE=23505 at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:269) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:206) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:457) at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.java:1429) at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeUpdate(DB2PreparedStatement.java:1021) at com.paraware.TestDB2.main(TestDB2.java:38) I'll open up a PMR with them on this. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-362 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-362 Summary: Save with native ID on DB2 fails with duplicate row exception if data inserted behind hibernate Type: Bug Status: Closed Priority: Critical Resolution: REJECTED Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Brian Bonner Created: Thu, 25 Sep 2003 11:53 AM Updated: Thu, 25 Sep 2003 3:39 PM Environment: Win 2K SP4, JDK 1.4.2, Hibernate 2.0.3, DB2 7.2 UDB Description: If we restart the database manager (clean state), then execute the DDL generated by hibernate, and run the test case: TestHibernate records are inserted without problem. We can rerun the test case numerous times. If we restart the database manager, then insert data from a command line (behind hibernate): insert into parents values(1,'test','test','test','test',current timestamp); insert into children values (1,'bb','1); insert into children values (2,'cc','1); and run the test case, it fails. hibernate.properties, Mapping, generated DDL, Domain Source, Test Source follows. hibernate.connection.driver_class = COM.ibm.db2.jdbc.app.DB2Driver hibernate.dialect = net.sf.hibernate.dialect.DB2Dialect hibernate.connection.url = jdbc:db2:sample hibernate.connection.username = xyz hibernate.connection.password = pdq <?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="com.paraware.domain.Parent" table="parents"> <id name="keyId" type="int" unsaved-value="0"> <column name="key_id" not-null="true"/> <generator class="native"/> </id> <property name="userID" column="LogonID" type="string"/> <property name="userName" column="Name" type="string"/> <property name="password" type="string"/> <property name="emailAddress" type="string"/> <property name="lastLogon" type="timestamp"/> <set name="children" table="children" cascade="all" lazy="true" inverse="true"> <key column="key_id"/> <one-to-many class="com.paraware.domain.Child"/> </set> </class> </hibernate-mapping> <?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="com.paraware.domain.Child" table="children"> <id name="mouseId" type="int" unsaved-value="0"> <column name="mouse_id" not-null="true"/> <generator class="native"/> </id> <property name="name" column="name" type="string"/> <many-to-one name="parent" class="com.paraware.domain.Parent" column="key_id" /> </class> </hibernate-mapping> drop table parents; drop table children; create table parents ( key_id INTEGER not null generated by default as identity, LogonID VARCHAR(255), Name VARCHAR(255), password VARCHAR(255), emailAddress VARCHAR(255), lastLogon TIMESTAMP, primary key (key_id) ); create table children ( mouse_id INTEGER not null generated by default as identity, name VARCHAR(255), key_id INTEGER, primary key (mouse_id) ); alter table children add constraint FK62EA5DFFBC5E42FB foreign key (key_id) references parents; package com.paraware.domain; import java.util.Date; import java.util.Set; // ... public class Parent { private int keyId; private String userID; private String userName; private String password; private String emailAddress; private Date lastLogon; private Set children; public int getKeyId() { return keyId; } public void setKeyId(int keyId) { this.keyId = keyId; } public String getUserID() { return userID; } public void setUserID(String newUserID) { userID = newUserID; } public String getUserName() { return userName; } public void setUserName(String newUserName) { userName = newUserName; } public String getPassword() { return password; } public void setPassword(String newPassword) { password = newPassword; } public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String newEmailAddress) { emailAddress = newEmailAddress; } public Date getLastLogon() { return lastLogon; } public void setLastLogon(Date newLastLogon) { lastLogon = newLastLogon; } public Set getChildren() { return children; } public void setChildren(Set mouses) { this.children = mouses; } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || (obj.getClass() != this.getClass())) return false; // Must be the Parent Parent other = (Parent) obj; return userID == other.userID || userID != null && userID.equals(other.userID) && userName == other.userName || userName != null && userName.equals(other.userName); } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode() { int result = 17; result = userID == null ? result : 37 * result + userID.hashCode(); result = userName == null ? result : 37 * result + userName.hashCode(); return result; } } package com.paraware.domain; public class Child { private int mouseId; private String name; private Parent parent; public int getMouseId() { return mouseId; } public void setMouseId(int id) { this.mouseId = id; } public String getName() { return name; } public void setName(String newName) { name = newName; } public Parent getParent() { return parent; } public void setParent(Parent newUser) { parent = newUser; } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || (obj.getClass() != this.getClass())) return false; // Must be the Child Child other = (Child) obj; return name == other.name || name != null && name.equals(other.name); } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode() { int result = 17; result = name == null ? result : 37 * result + name.hashCode(); return result; } } package com.paraware; import java.sql.SQLException; import java.util.Date; import java.util.HashSet; import java.util.Set; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Transaction; import net.sf.hibernate.cfg.Configuration; import com.paraware.domain.Child; import com.paraware.domain.Parent; public class TestHibernate { public static void main(String args[]) throws HibernateException, SQLException { SessionFactory sessionFactory; Transaction transaction; Configuration cfg = new Configuration(); cfg.addClass(Parent.class); cfg.addClass(Child.class); sessionFactory = cfg.buildSessionFactory(); Session session = sessionFactory.openSession(); transaction = session.beginTransaction(); Parent newUser = new Parent(); newUser.setUserID("bnnn"); newUser.setUserName("Vivi"); newUser.setPassword("abcff"); newUser.setEmailAddress("vi...@co..."); newUser.setLastLogon(new Date()); session.save(newUser); Child ms1 = new Child(); ms1.setName("Mickey"); Child ms2 = new Child(); ms2.setName("Mouse"); Set mouseSet = new HashSet(); mouseSet.add(ms1); mouseSet.add(ms2); //set up association newUser.setChildren(mouseSet); //save foreign keys ms1.setParent(newUser); ms2.setParent(newUser); transaction.commit(); // close our session and release resources session.flush(); session.close(); } } --------------------------------------------------------------------- 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 |