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-10-23 01:21:52
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 7:35 PM ok, well anyway we are de-emphasizing JCS. So I'm closing this issue. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-148 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-148 Summary: Old JCS jar is faster than new one (?) Type: Task Status: Closed Priority: Major Resolution: WON'T FIX Project: Hibernate2 Versions: 2.0.1 Assignee: Gavin King Reporter: Gavin King Created: Fri, 20 Jun 2003 10:30 PM Updated: Wed, 22 Oct 2003 7:35 PM Description: A user reported that the build of JCS that ships with Hibernate2 is MUCH slower than the earlier build that we were using. We need to verify this and find out why.... --------------------------------------------------------------------- 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 |
The following comment has been added to this issue: Author: David Duffy Created: Wed, 22 Oct 2003 7:05 PM Body: Oh, and one more thing, I've litterally spent days isolating the problem down, stepping through all of my code and a lot of Hibernate's code. I may not know how to use Hibernate as well as I would like (and you must admit there is quite a learning curve, especially when under the pressures of dealines) but I make sure to the best of my ability to rule out problems in my own code before ever broaching the question about what is happening in Hibernate. This problem is not a result of "my code", it may be a result of my using Hibernate wrong, but as you can see from the forum discussion I first asked if that was the case and explained what I was doing, why, and what was happening. The consesus there was that Hibernate should not be putting a duplicate instance into the bag as a result of the call to saveOrUpdate. I tried stepping through Hibernate's code to see if I could figure out at what point during the saveOrUpdate call the duplicate instance got added and why but I did not succeed in that task, I did however succeed in determining that calling the .size() method on the bag causes what I called re-initialization of the collection and then saveOrUpdate does not add a duplicate instance. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 5:15 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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-10-23 00:47:23
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 7:31 PM I cannot reproduce this problem in Hibernate 2.1. Please resubmit an actual runnable test case. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-378 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-378 Summary: error generate SQL from a HQL who use LEFT JOIN(on more levels) Type: Bug Status: Closed Priority: Major Resolution: CANNOT REPRODUCE Project: Hibernate2 Components: core Versions: 2.0rc2 2.1 2.0 final 2.0.1 2.0.2 2.0.3 2.1 beta 1 2.1 beta 2 2.1 beta 3 2.1 final 2.1 beta 4 Assignee: Gavin King Reporter: Adrian Minciuna Created: Fri, 3 Oct 2003 9:51 AM Updated: Wed, 22 Oct 2003 7:31 PM Environment: Windows 2000 sp4, JDK 1.4.1_02 Description: Bug: i have 2 classes DACPerson and DACDepartment DACPerson has an inner object manager with DACPerson , and an object department with type DACDepartment. Thus, has 2 relations <many-to-one> I need an hql like this 1) using left join select als.name, als0.name, als1.name, als2.name from DACPerson as als left join als.manager as als0 left join als.manager.manager as als1 left join als.manager.department as als2 where als.pkid=als.hcod In this case hibernate generate a wrong SQL : select tstdacpe0_.PKID as x0_0_,tstdacde3_.NAME as x1_0_, tstdacpe2_.NAME as x2_0_, tstdacpe0_.NAME as x3_0_,tstdacpe1_.NAME as x4_0_ from PERSON2 tstdacpe0_ left outer join PERSON2 tstdacpe1_ on tstdacpe0_.MGR_ID=tstdacpe1_.PKID left outer join PERSON2 tstdacpe2_ on tstdacpe1_.MGR_ID=tstdacpe2_.PKID left outer join DEPT tstdacde3_ on tstdacpe1_.Dept_id=tstdacde3_.PKID where and and ((tstdacpe0_.PKID=tstdacpe0_.HCOD )) java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'and'. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)..... ------------------------------------------- Obs. if i try a HQL,a little bit simple ex: select als.name, als0.name, als1.name from DACPerson as als left join als.manager as als0 left join als.manager.department as als1 where als.pkid=als.hcod i get following error FINE: net.sf.hibernate.hql.QueryTranslator.compile() - unexpected query compilation problem java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1480) at java.lang.String.substring(String.java:1447) at net.sf.hibernate.sql.QuerySelect.toQueryString(QuerySelect.java:109) at net.sf.hibernate.hql.QueryTranslator.renderSQL(QueryTranslator.java:515) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:151) --------------------------------------------------------- 3) If i modify hql like this : select als.name, als0.name, als1.name, als2.name from DACPerson as als left join als.manager as als0 left join als0.manager as als1 left join als0.department as als2 where als.pkid=als.hcod and IT'S WORK fine --------------------------------------------------- Obs: i tested also on Hibern8 IDE --------------------------------------------------------------------- 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 |
The following comment has been added to this issue: Author: David Duffy Created: Wed, 22 Oct 2003 6:43 PM Body: What!? I built it with Ant 1.5.3 without incident, I ran it without incident, standalone, by itself, and got the error as expected. Then I zipped the entire src directory which contains ALL of the mapping files, including hibernate.cfg.xml and hibernate.properties (they are in the tests package with the testcase instead of the root). Would you like my build file too? I suspect that you compiled into some kind of "build" directory and your build didn't copy the xml files over with the classes. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 5:15 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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-10-22 22:58:23
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 5:38 PM The "hilo" strategy is cluster safe and has all these properties. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-421 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-421 Summary: id generator Type: New Feature Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Assignee: Reporter: Mukund Pragasam Created: Wed, 22 Oct 2003 4:22 PM Updated: Wed, 22 Oct 2003 5:38 PM Environment: id generation Description: I am using my own id generator which will 1) Be cluster safe. 2) Be efficient (like class="increment" - in memory operation to get the ID) 3) Provide a string or a long based on user call 4) Will not have any issue even if the DB Table has millions of rows. It uses a logic to store the block and block-size to generate ID. (similar to HILO - but can be used in Cluster) Can you please create a new class for id generators with all these new features? OR If you wish to assign this issue/new feature to me, I can develop it and send the code to you. Regards, Mukund. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 22:18:51
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-421 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-421 Summary: id generator Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Components: core Assignee: Reporter: Mukund Pragasam Created: Wed, 22 Oct 2003 4:22 PM Updated: Wed, 22 Oct 2003 4:22 PM Environment: id generation Description: I am using my own id generator which will 1) Be cluster safe. 2) Be efficient (like class="increment" - in memory operation to get the ID) 3) Provide a string or a long based on user call 4) Will not have any issue even if the DB Table has millions of rows. It uses a logic to store the block and block-size to generate ID. (similar to HILO - but can be used in Cluster) Can you please create a new class for id generators with all these new features? OR If you wish to assign this issue/new feature to me, I can develop it and send the code to you. Regards, Mukund. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 22:17:41
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 5:15 PM I also expect stripped-down code that isolates the problem to a few calls. Aside from anything else this demonstrates that you have at least spent some time ensuring that the bug is not in your code. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 5:15 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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 |
The following comment has been added to this issue: Author: Gavin King Created: Wed, 22 Oct 2003 4:45 PM Body: I need something that is actually runnable. I don't understand this code at all. What on earth are all the useless-looking calls to saveOrUpdate() for?? The object is already associated with the session! --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 4:41 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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 |
The following comment has been added to this issue: Author: Gavin King Created: Wed, 22 Oct 2003 5:12 PM Body: This code is completely un-runnable! Missing mapping files and all kinds of problems. Not to mention that your session handling is completely bizarre. I suggest you spend some time looking for a bug in your code instead of blaming Hibernate. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 4:52 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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-10-22 22:07:42
|
The following issue has been updated: Updater: Mukund Pragasam (mailto:muk...@gt...) Date: Wed, 22 Oct 2003 4:02 PM Comment: I have all the updated (.bat) files attached to this. You can review it and add it to the build. Changes: Attachment changed to bin.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-391&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-391 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-391 Summary: Udated bat files in the tools - defined HIBERNATE_HOME Type: Patch Status: Assigned Priority: Major Project: Hibernate2 Components: toolset Assignee: Christian Bauer Reporter: Mukund Pragasam Created: Fri, 10 Oct 2003 8:31 AM Updated: Wed, 22 Oct 2003 4:02 PM Environment: run the tools (like hbm2java) from any other IDE like JBuilder. Description: In the tools/bin we have class2hbm.bat ddl2hbm.bat hbm2java.bat setenv.bat all the above bat files need to know HIBERNATE_HOME they were using relative path to get it. When I run these tools from JBuilder, they were not working because of the relative path. I extracted hibernate-extensions-2.0.zip in the hibernate home directory. So I had the directory structure like avalon bin build.bat build.xml changelog.txt demo.bat demo.sh doc hibernate2.jar hibernate_logo.gif lgpl.txt lib readme.txt src tools I have modified the files to get HIBERNATE_HOME from the environment variables. For example if "%HIBERNATE_HOME%"=="" goto noHIBERNATEHome call %HIBERNATE_HOME%\tools\bin\setenv.bat java -cp %CP% net.sf.hibernate.tool.class2hbm.MapGenerator %* if not "%HIBERNATE_HOME%"=="" goto end :noHIBERNATEHome echo HIBERNATE_HOME is not set. Please set HIBERNATE_HOME. :end set HIBERNATE_HOME I can send this to the group and they can update this in their copy. I can send all the bat files with similar updates. I am not sure how this works. Will this be Assigned To me? or Do I need to send the modified bat files in a mail...? --------------------------------------------------------------------- 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 |
The following issue has been updated: Updater: David Duffy (mailto:dav...@ya...) Date: Wed, 22 Oct 2003 4:52 PM Comment: Updated test case to have its own main method using textui TestRunner. Changes: Attachment changed to updatedtestcasesrc.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 4:52 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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 |
The following issue has been updated: Updater: David Duffy (mailto:dav...@ya...) Date: Wed, 22 Oct 2003 4:41 PM Comment: Added supporting source code et. al. for the test case (and the test case file itself). Changes: Attachment changed to testcasesrc.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 4:41 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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-10-22 21:30:46
|
Message: The following issue has been re-assigned. Assignee: Gavin King (mailto:ga...@in...) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-417 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-417 Summary: Criteria API and key-many-to-one Type: Bug Status: Assigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Gavin King Reporter: Sebastien Cesbron Created: Wed, 22 Oct 2003 3:07 AM Updated: Wed, 22 Oct 2003 12:51 PM Environment: Win2k SQLServer with jTds driver Description: I have one class Bar with a primary key composed of a 'key-many-to-one' to a class Foo. I want to find a Bar instance with a Foo id so I have this criteria : Criteria criteria = session.createCriteria(Bar.class); criteria.createCriteria("foo").add(Expression.eq("id", new Integer(1))); Bar bar = (Bar) criteria.uniqueResult(); Then I have this sql statement select this.ID_FOO as ID_FOO0_, this.text as text0_ from BAR this where x0_.id=1 which fails because x0_ isn't defined. With an HQL query it works. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 21:20:27
|
The following comment has been added to this issue: Author: Gavin King Created: Wed, 22 Oct 2003 12:50 PM Body: oooh sorry I misread .... the problem is that the join is missing. Thanks, we'll fix this. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-417 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-417 Summary: Criteria API and key-many-to-one Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: Sebastien Cesbron Created: Wed, 22 Oct 2003 3:07 AM Updated: Wed, 22 Oct 2003 3:08 AM Environment: Win2k SQLServer with jTds driver Description: I have one class Bar with a primary key composed of a 'key-many-to-one' to a class Foo. I want to find a Bar instance with a Foo id so I have this criteria : Criteria criteria = session.createCriteria(Bar.class); criteria.createCriteria("foo").add(Expression.eq("id", new Integer(1))); Bar bar = (Bar) criteria.uniqueResult(); Then I have this sql statement select this.ID_FOO as ID_FOO0_, this.text as text0_ from BAR this where x0_.id=1 which fails because x0_ isn't defined. With an HQL query it works. --------------------------------------------------------------------- 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 |
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-420 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-420 Summary: Adding a new instance to a persistent bag and calling saveOrUpdate adds a duplicate instance to the bag but not the DB. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 3 2.1 beta 4 Assignee: Reporter: David Duffy Created: Wed, 22 Oct 2003 3:27 PM Updated: Wed, 22 Oct 2003 3:27 PM Environment: JDK1.4.2, Windows 2003 Server; JDK1.4.2, Windows 2000; JDK1.3.1 Windows 2000 Description: When a new (transient) instance of a persisted child is created and added to the "bag" of children on the parent and then the parent is re-persisted via Session.saveOrUpdate() a second instance of the child will be added to the "bag" but not to the database. However, calling the .size() method on the "bag" before calling saveOrUpdate() will cause the problem to disappear. A unit test class that demonstrates this is as follows: package com.fgl.ina.tests; import junit.framework.TestCase; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Session; import net.sf.hibernate.LockMode; import java.net.URL; import java.util.Properties; import java.util.ArrayList; //import java.util.Map; import java.util.Iterator; import java.io.BufferedInputStream; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import com.fgl.ina.stylecreation.Product; //import com.fgl.ina.stylecreation.details.ProductDescription; import com.fgl.ina.stylecreation.barcodes.ProductBarcode; import com.fgl.ina.stylecreation.lookups.BarcodeType; import com.fgl.ina.stylecreation.coloursize.ProductColourSizeHelper; import com.fgl.ina.stylecreation.coloursize.ProductColourAndSize; import com.fgl.ina.services.DataAccessService; import com.fgl.ina.mastertables.colours.Colour; import com.fgl.ina.mastertables.sizes.Size; /** * Tests Hibernate (sort of), or at least aspects that are of immediate concern at time of writing. * @author David Duffy */ public class HibernateTest extends TestCase { //TODO: make a test suite (or whatever it is) that will do the setup and teardown only once for all Hibernate tests private static final Log log = LogFactory.getLog(HibernateTest.class); private static final String TEST_CONFIG_PATH = "/com/fgl/ina/tests/hibernatetest.cfg.xml"; private static final String TEST_PROPERTIES_PATH = "/com/fgl/ina/tests/hibernatetest.properties"; private SessionFactory factory; public HibernateTest(String testName) { super(testName); } /** * Perform unit test set up before running test(s). */ protected void setUp() { Configuration configuration = null; URL configFileURL = null; try { configFileURL = Class.class.getResource(TEST_CONFIG_PATH); if (log.isDebugEnabled()) { log.debug("Initializing Hibernate from " + TEST_CONFIG_PATH + "..."); } BufferedInputStream bis = new BufferedInputStream(Class.class.getResourceAsStream(TEST_PROPERTIES_PATH)); Properties properties = new Properties(); properties.load(bis); bis.close(); configuration = (new Configuration().setProperties(properties)).configure(configFileURL); factory = configuration.buildSessionFactory(); } catch (Throwable t) { log.error("Exception while initializing Hibernate.", t); } } /** * Perform unit test tear down after running test(s). */ protected void tearDown() { try { if (factory != null) { factory.close(); } } catch (Throwable t) { log.error("Couldn't close session factory", t); } } // TODO: make setup/teardown do the supporting object creation when there is a suite that does the Hibernate config public void testAddingBarcodes() throws Exception { if (factory == null) { fail("SessionFactory == null"); } else { Session session = factory.openSession(); try { // create a new product, remove its descriptions temporarily and save it without them Product product = new Product(0); product.getDetails().setVendorNumber(1); product.getDetails().setVpn("unittestvpn"); // Map temp = product.getProductDescriptions(); product.setProductDescriptions(null); DataAccessService.saveOrUpdate(session, product); // start building up the colours and sizes... try { // get a valid colour Colour colour = (Colour)DataAccessService.get(session, Colour.class).get(0); // get a valid size Size size = (Size)DataAccessService.get(session, Size.class).get(0); // add the valid colour and size (references) to the product and save the product (again). product.getColours().add(colour); product.getSizes().add(size); DataAccessService.saveOrUpdate(session, product); // create a Collection for colour/size combinations and run the helper method to create the records // for the existing colours and sizes on the product product.setColourSizes(new ArrayList()); ProductColourSizeHelper.createColourSizesForColour(session, product, colour.getColourID()); // save the product now that it has colour and size combinations (in this test there is only one). DataAccessService.saveOrUpdate(session, product); // use this session to load the barcode barcodeType and then close the session. BarcodeType barcodeType = (BarcodeType)DataAccessService.get(session, BarcodeType.class, new Integer(1)); session.flush(); // redundant... session.close(); // open a new session and reload the product so that null Collections will get proxies... session = factory.openSession(); product = (Product)DataAccessService.get(session, Product.class, new Integer(product.getProductID())); session.close(); // get a new session so that the product instance spans multiple sessions just like in the real // scenario being debugged... session = factory.openSession(); // lock the product to the new session to reassociate it with the new session session.lock(product, LockMode.UPGRADE); // grab the colour and size combination, create a new barcode, and add it to the colour/size. ProductColourAndSize colourSize = (ProductColourAndSize)product.getColourSizes().iterator().next(); ProductBarcode barcode = new ProductBarcode("498765123452", colourSize, barcodeType); colourSize.addBarcode(barcode); // the "magic" line that makes all the difference... // colourSize.getBarcodes().size(); // save the product again... DataAccessService.saveOrUpdate(session, product); // test whether there is only one barcode in the collection (which there should be) assertTrue("barcodes.size() should == 1 but was actually " + colourSize.getBarcodes().size(), colourSize.getBarcodes().size() == 1); } catch (Exception e) { log.fatal("?", e); fail("exception"); } finally { if (product != null) { try { Iterator colourSizeIterator = product.getColourSizes().iterator(); while (colourSizeIterator.hasNext()) { ProductColourAndSize deleteMe = (ProductColourAndSize)colourSizeIterator.next(); colourSizeIterator.remove(); DataAccessService.delete(session, deleteMe); } DataAccessService.saveOrUpdate(session, product); } catch (Exception e) { log.warn("couldn't remove colours/sizes and resave product", e); } try { DataAccessService.delete(session, product); } catch (Exception e2) { log.error("cleanup failed: could not delete unittest product " + product.getProductID(), e2); } } } } catch (Exception e) { log.error("?", e); fail("exception"); } finally { if (session != null && session.isOpen()) { 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-10-22 18:56:46
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 1:16 PM Thanks (I didn't realize I had to apply the comments to the patch manually). I comitted this stuff. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-412 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-412 Summary: OSCache support for Hibernate 2.1 Type: Improvement Status: Closed Priority: Minor Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 beta 5 Versions: 2.1 Assignee: Gavin King Reporter: Mathias Bogaert Created: Mon, 20 Oct 2003 6:34 AM Updated: Wed, 22 Oct 2003 1:16 PM Environment: OSCache 2.0 and Hibernate 2.1 (CVS as from yesterday) Description: Attached is an example how to integrate OpenSymphony OSCache and Hibernate's 2.1 caching system. Because of the fact that the cache is not reponsible for refreshing, the nice fail-over feature of OSCache is not used (yet). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 18:35:21
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-419 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-419 Summary: Patches to make Hibernate use a custom persister Type: Patch Status: Unassigned Priority: Major Project: Hibernate2 Components: core Assignee: Reporter: Nick Johnson Created: Wed, 22 Oct 2003 10:18 AM Updated: Wed, 22 Oct 2003 10:18 AM Environment: JDK 1.4 on win32 Description: See HB-326 for a problem description. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 18:01:14
|
Message: The following issue has been re-assigned. Assignee: Max Rydahl Andersen (mailto:xa...@xa...) Assigner: Gavin King (mailto:ga...@in...) Date: Wed, 22 Oct 2003 12:53 PM Comment: Max, would you please apply this. TIA --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-419 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-419 Summary: Patches to make Hibernate use a custom persister Type: Patch Status: Assigned Priority: Major Project: Hibernate2 Components: core Assignee: Max Rydahl Andersen Reporter: Nick Johnson Created: Wed, 22 Oct 2003 10:18 AM Updated: Wed, 22 Oct 2003 12:53 PM Environment: JDK 1.4 on win32 Description: See HB-326 for a problem description. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 15:50:50
|
The following issue has been updated: Updater: Nick Johnson (mailto:njo...@ci...) Date: Wed, 22 Oct 2003 10:22 AM Comment: Patch to hibernate-mapping-2.0.dtd to allow for custom collection persisters to be configured. Changes: Attachment changed to hibernate-mapping-2.0.dtd.patch.txt --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-419&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-419 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-419 Summary: Patches to make Hibernate use a custom persister Type: Patch Status: Unassigned Priority: Major Project: Hibernate2 Components: core Assignee: Reporter: Nick Johnson Created: Wed, 22 Oct 2003 10:18 AM Updated: Wed, 22 Oct 2003 10:22 AM Environment: JDK 1.4 on win32 Description: See HB-326 for a problem description. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 15:37:55
|
The following issue has been updated: Updater: Nick Johnson (mailto:njo...@ci...) Date: Wed, 22 Oct 2003 10:22 AM Comment: Patch to SessionFactoryImpl.java to use the configured custom collection persisters if they're supplied. Changes: Attachment changed to SessionFactoryImpl.java.patch.txt --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-419&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-419 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-419 Summary: Patches to make Hibernate use a custom persister Type: Patch Status: Unassigned Priority: Major Project: Hibernate2 Components: core Assignee: Reporter: Nick Johnson Created: Wed, 22 Oct 2003 10:18 AM Updated: Wed, 22 Oct 2003 10:22 AM Environment: JDK 1.4 on win32 Description: See HB-326 for a problem description. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 14:10:51
|
The following comment has been added to this issue: Author: Gavin King Created: Wed, 22 Oct 2003 5:51 AM Body: Is SwarmCache incompatible with the very latest release of JavaGroups? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-47 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-47 Summary: Clustered Read/Write Caching Type: Patch Status: Closed Priority: Critical Resolution: FIXED Project: Hibernate2 Fix Fors: 2.1 beta 5 Assignee: Gavin King Reporter: Max Rydahl Andersen Created: Sat, 3 May 2003 10:30 AM Updated: Wed, 22 Oct 2003 3:23 AM Description: Clustered Read/Write Caching This patch adds the ability to do read-write caching in a clustered environment. This is accomplished by way of the SwarmCache caching engine. It in turn uses Javagroups to implement efficient, multicast-based cache communication. You can read a detailed description of SwarmCache at http://swarmcache.sf.net. Included in the patch is a readme that explains how it works and how to apply it. John Watkinson http://sourceforge.net/tracker/index.php?func=detail&aid=722039&group_id=40712&atid=428710 --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 14:03:05
|
The following comment has been added to this issue: Author: Mathias Bogaert Created: Wed, 22 Oct 2003 7:53 AM Body: Every constructed cache has it's own OSCache instance. This is the same as the 'region' in JCS. For the lock, add the line from my previous comment to the catch. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-412 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-412 Summary: OSCache support for Hibernate 2.1 Type: Improvement Status: Assigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 Assignee: Gavin King Reporter: Mathias Bogaert Created: Mon, 20 Oct 2003 6:34 AM Updated: Tue, 21 Oct 2003 1:53 AM Environment: OSCache 2.0 and Hibernate 2.1 (CVS as from yesterday) Description: Attached is an example how to integrate OpenSymphony OSCache and Hibernate's 2.1 caching system. Because of the fact that the cache is not reponsible for refreshing, the nice fail-over feature of OSCache is not used (yet). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 11:31:05
|
The following issue has been updated: Updater: Sebastien Cesbron (mailto:seb...@la...) Date: Wed, 22 Oct 2003 3:08 AM Comment: Source code of an example with two classes Foo and Bar Changes: Attachment changed to testHibernate.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-417&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-417 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-417 Summary: Criteria API and key-many-to-one Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: Sebastien Cesbron Created: Wed, 22 Oct 2003 3:07 AM Updated: Wed, 22 Oct 2003 3:08 AM Environment: Win2k SQLServer with jTds driver Description: I have one class Bar with a primary key composed of a 'key-many-to-one' to a class Foo. I want to find a Bar instance with a Foo id so I have this criteria : Criteria criteria = session.createCriteria(Bar.class); criteria.createCriteria("foo").add(Expression.eq("id", new Integer(1))); Bar bar = (Bar) criteria.uniqueResult(); Then I have this sql statement select this.ID_FOO as ID_FOO0_, this.text as text0_ from BAR this where x0_.id=1 which fails because x0_ isn't defined. With an HQL query it works. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 11:30:54
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 3:23 AM OK, I committed this code (the latest file versions from Oct 2). Thanks everyone. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-47 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-47 Summary: Clustered Read/Write Caching Type: Patch Status: Closed Priority: Critical Resolution: FIXED Project: Hibernate2 Fix Fors: 2.1 beta 5 Assignee: Gavin King Reporter: Max Rydahl Andersen Created: Sat, 3 May 2003 10:30 AM Updated: Wed, 22 Oct 2003 3:23 AM Description: Clustered Read/Write Caching This patch adds the ability to do read-write caching in a clustered environment. This is accomplished by way of the SwarmCache caching engine. It in turn uses Javagroups to implement efficient, multicast-based cache communication. You can read a detailed description of SwarmCache at http://swarmcache.sf.net. Included in the patch is a readme that explains how it works and how to apply it. John Watkinson http://sourceforge.net/tracker/index.php?func=detail&aid=722039&group_id=40712&atid=428710 --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-10-22 11:28:09
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 22 Oct 2003 5:24 AM Ummmm .... I have no idea what you expect us to do about this .... perhaps you should take this up with your database vendor. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-418 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-418 Summary: An large insert statement raise an java.lang.OutOfMemory Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 beta 3 Assignee: Reporter: Nicolas Berthet Created: Wed, 22 Oct 2003 3:20 AM Updated: Wed, 22 Oct 2003 5:24 AM Environment: hiberate 2.1b3, webwork 2, resin Description: I'm trying to insert a 5 Mo file (BinaryType) and it raise an OutOfMemory.. i'm unable to trace where it come from... the same process works for files until about 4 Mo --------------------------------------------------------------------- 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 |