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-08-02 08:13:14
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Sat, 2 Aug 2003 3:12 AM
I suspected this ;)
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-223
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-223
Summary: Parent with Bag children returns duplicate children
Type: Bug
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Paul Rivers
Created: Fri, 1 Aug 2003 4:03 PM
Updated: Sat, 2 Aug 2003 3:12 AM
Environment: WindowsXP, 1.4.1_03, MySQL 4.0.13
Description:
I have a simple case - a parent, with children in a bag. It's a one-to-many mapping, the bag is lazy. I create a parent, add a child, and save them. At this point, there's only 1 child in the bag.
I start a new session, and load the parent - and now there's two children in the bag. They are both identical copies of the original child. When I check the database, there is only 1 child in the database.
If I'm doing something wrong, please let me know. I can't figure out what it would be - it's such a simple case. Below is the relevant code, if there's anything else I can do to help let me know:
------------------------------------------------------------
Parent mapping of the child:
<bag name="bagChildren" inverse="true" cascade="all" lazy="true">
<key column="parent_id"/>
<one-to-many class="hibernateexamples.BagChild"/>
</bag>
------------------------------------------------------------
Mapping of the child:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="hibernateexamples.BagChild" table="BagChild">
<id name="id" unsaved-value="-1">
<generator class="native" />
</id>
<property name="name" type="string" length="2147483647"/>
<many-to-one name="parent" column="parent_id" />
</class>
</hibernate-mapping>
------------------------------------------------------------
Test code:
public static void main(String[] args) throws Throwable {
//Recreate the database tables
CreateTablesMain.main(null);
Session session = DatabaseHelper.startSession();
Transaction transaction = null;
try {
transaction = session.beginTransaction();
Parent parent = new Parent("Parent Name", "The parent for testing Bag");
BagChild bagChild = new BagChild(parent, "Bag Child 1");
System.out.println("Size of bag before saved: " + parent.getBagChildren().size());
session.save(parent);
transaction.commit();
} finally {
// If the transaction wasn't already commited or rolled back, assume an error occured and roll it back
if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback();
session.close();
}
session = DatabaseHelper.startSession();
transaction = null;
try {
transaction = session.beginTransaction();
// Print bag children
Parent parent = (Parent) session.load(Parent.class, new Long(1));
Collection bagChildren = parent.getBagChildren();
System.out.println("Bag Size: " + bagChildren.size());
Iterator it = bagChildren.iterator();
while(it.hasNext()) {
BagChild child = (BagChild) it.next();
System.out.println(child.getId());
}
transaction.commit();
} finally {
// If the transaction wasn't already commited or rolled back, assume an error occured and roll it back
if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback();
session.close();
}
}
------------------------------------------------------------
Test code prints out:
Size of bag before saved: 1
Hibernate: insert into parent (name, description) values (?, ?)
Hibernate: SELECT LAST_INSERT_ID()
Hibernate: insert into BagChild (name, parent_id) values (?, ?)
Hibernate: SELECT LAST_INSERT_ID()
Hibernate: select parent0_.id as id, parent0_.name as name, parent0_.description as descript3_ from parent parent0_ where parent0_.id=?
Hibernate: select bagchild0_.id as id__, bagchild0_.id as id, bagchild0_.name as name, bagchild0_.parent_id as parent_id from BagChild bagchild0_ where bagchild0_.parent_id=?
Bag Size: 2
1
1
---------------------------------------------------------------------
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-08-02 07:41:14
|
The following comment has been added to this issue:
Author: Paul Rivers
Created: Sat, 2 Aug 2003 2:39 AM
Body:
My apologies - in creating the simple test case, I found that I had I had this code:
public void setParent(Parent parent) {
this.parent = parent;
parent.getBagChildren().add(this);
}
Which evidentally caused the newly loaded object to be added to it's parent's collection twice. Sorry!
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-223
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-223
Summary: Parent with Bag children returns duplicate children
Type: Bug
Status: Unassigned
Priority: Major
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Paul Rivers
Created: Fri, 1 Aug 2003 4:03 PM
Updated: Fri, 1 Aug 2003 4:03 PM
Environment: WindowsXP, 1.4.1_03, MySQL 4.0.13
Description:
I have a simple case - a parent, with children in a bag. It's a one-to-many mapping, the bag is lazy. I create a parent, add a child, and save them. At this point, there's only 1 child in the bag.
I start a new session, and load the parent - and now there's two children in the bag. They are both identical copies of the original child. When I check the database, there is only 1 child in the database.
If I'm doing something wrong, please let me know. I can't figure out what it would be - it's such a simple case. Below is the relevant code, if there's anything else I can do to help let me know:
------------------------------------------------------------
Parent mapping of the child:
<bag name="bagChildren" inverse="true" cascade="all" lazy="true">
<key column="parent_id"/>
<one-to-many class="hibernateexamples.BagChild"/>
</bag>
------------------------------------------------------------
Mapping of the child:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="hibernateexamples.BagChild" table="BagChild">
<id name="id" unsaved-value="-1">
<generator class="native" />
</id>
<property name="name" type="string" length="2147483647"/>
<many-to-one name="parent" column="parent_id" />
</class>
</hibernate-mapping>
------------------------------------------------------------
Test code:
public static void main(String[] args) throws Throwable {
//Recreate the database tables
CreateTablesMain.main(null);
Session session = DatabaseHelper.startSession();
Transaction transaction = null;
try {
transaction = session.beginTransaction();
Parent parent = new Parent("Parent Name", "The parent for testing Bag");
BagChild bagChild = new BagChild(parent, "Bag Child 1");
System.out.println("Size of bag before saved: " + parent.getBagChildren().size());
session.save(parent);
transaction.commit();
} finally {
// If the transaction wasn't already commited or rolled back, assume an error occured and roll it back
if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback();
session.close();
}
session = DatabaseHelper.startSession();
transaction = null;
try {
transaction = session.beginTransaction();
// Print bag children
Parent parent = (Parent) session.load(Parent.class, new Long(1));
Collection bagChildren = parent.getBagChildren();
System.out.println("Bag Size: " + bagChildren.size());
Iterator it = bagChildren.iterator();
while(it.hasNext()) {
BagChild child = (BagChild) it.next();
System.out.println(child.getId());
}
transaction.commit();
} finally {
// If the transaction wasn't already commited or rolled back, assume an error occured and roll it back
if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback();
session.close();
}
}
------------------------------------------------------------
Test code prints out:
Size of bag before saved: 1
Hibernate: insert into parent (name, description) values (?, ?)
Hibernate: SELECT LAST_INSERT_ID()
Hibernate: insert into BagChild (name, parent_id) values (?, ?)
Hibernate: SELECT LAST_INSERT_ID()
Hibernate: select parent0_.id as id, parent0_.name as name, parent0_.description as descript3_ from parent parent0_ where parent0_.id=?
Hibernate: select bagchild0_.id as id__, bagchild0_.id as id, bagchild0_.name as name, bagchild0_.parent_id as parent_id from BagChild bagchild0_ where bagchild0_.parent_id=?
Bag Size: 2
1
1
---------------------------------------------------------------------
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-08-02 01:53:14
|
The following comment has been added to this issue:
Author: Gavin King
Created: Fri, 1 Aug 2003 8:52 PM
Body:
PLease submit an actual executable test.
TIA
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-223
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-223
Summary: Parent with Bag children returns duplicate children
Type: Bug
Status: Unassigned
Priority: Major
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Paul Rivers
Created: Fri, 1 Aug 2003 4:03 PM
Updated: Fri, 1 Aug 2003 4:03 PM
Environment: WindowsXP, 1.4.1_03, MySQL 4.0.13
Description:
I have a simple case - a parent, with children in a bag. It's a one-to-many mapping, the bag is lazy. I create a parent, add a child, and save them. At this point, there's only 1 child in the bag.
I start a new session, and load the parent - and now there's two children in the bag. They are both identical copies of the original child. When I check the database, there is only 1 child in the database.
If I'm doing something wrong, please let me know. I can't figure out what it would be - it's such a simple case. Below is the relevant code, if there's anything else I can do to help let me know:
------------------------------------------------------------
Parent mapping of the child:
<bag name="bagChildren" inverse="true" cascade="all" lazy="true">
<key column="parent_id"/>
<one-to-many class="hibernateexamples.BagChild"/>
</bag>
------------------------------------------------------------
Mapping of the child:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="hibernateexamples.BagChild" table="BagChild">
<id name="id" unsaved-value="-1">
<generator class="native" />
</id>
<property name="name" type="string" length="2147483647"/>
<many-to-one name="parent" column="parent_id" />
</class>
</hibernate-mapping>
------------------------------------------------------------
Test code:
public static void main(String[] args) throws Throwable {
//Recreate the database tables
CreateTablesMain.main(null);
Session session = DatabaseHelper.startSession();
Transaction transaction = null;
try {
transaction = session.beginTransaction();
Parent parent = new Parent("Parent Name", "The parent for testing Bag");
BagChild bagChild = new BagChild(parent, "Bag Child 1");
System.out.println("Size of bag before saved: " + parent.getBagChildren().size());
session.save(parent);
transaction.commit();
} finally {
// If the transaction wasn't already commited or rolled back, assume an error occured and roll it back
if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback();
session.close();
}
session = DatabaseHelper.startSession();
transaction = null;
try {
transaction = session.beginTransaction();
// Print bag children
Parent parent = (Parent) session.load(Parent.class, new Long(1));
Collection bagChildren = parent.getBagChildren();
System.out.println("Bag Size: " + bagChildren.size());
Iterator it = bagChildren.iterator();
while(it.hasNext()) {
BagChild child = (BagChild) it.next();
System.out.println(child.getId());
}
transaction.commit();
} finally {
// If the transaction wasn't already commited or rolled back, assume an error occured and roll it back
if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback();
session.close();
}
}
------------------------------------------------------------
Test code prints out:
Size of bag before saved: 1
Hibernate: insert into parent (name, description) values (?, ?)
Hibernate: SELECT LAST_INSERT_ID()
Hibernate: insert into BagChild (name, parent_id) values (?, ?)
Hibernate: SELECT LAST_INSERT_ID()
Hibernate: select parent0_.id as id, parent0_.name as name, parent0_.description as descript3_ from parent parent0_ where parent0_.id=?
Hibernate: select bagchild0_.id as id__, bagchild0_.id as id, bagchild0_.name as name, bagchild0_.parent_id as parent_id from BagChild bagchild0_ where bagchild0_.parent_id=?
Bag Size: 2
1
1
---------------------------------------------------------------------
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-08-01 23:29:14
|
The following comment has been added to this issue:
Author: Christian Bauer
Created: Fri, 1 Aug 2003 6:28 PM
Body:
SF only offers a "full" tarball of all CVS modules...
If we want to have a tarball for each module, we have to update/host this ourself. I'm not sure we can handle that load. Propably OK to link to the nightly SF tarball?
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-212
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-212
Summary: Nightly builds or tarballs from CVS
Type: New Feature
Status: Assigned
Priority: Minor
Project: Hibernate2
Components:
core
Fix Fors:
2.0.2
Versions:
2.0.1
Assignee: Christian Bauer
Reporter: Christian Bauer
Created: Fri, 25 Jul 2003 8:28 AM
Updated: Fri, 25 Jul 2003 8:28 AM
Environment: n/a
Description:
Check SF for nightly builds and/or CVS tarballs, link on the Hibernate wiki.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-08-01 21:04:14
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-223 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-223 Summary: Parent with Bag children returns duplicate children Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: Paul Rivers Created: Fri, 1 Aug 2003 4:03 PM Updated: Fri, 1 Aug 2003 4:03 PM Environment: WindowsXP, 1.4.1_03, MySQL 4.0.13 Description: I have a simple case - a parent, with children in a bag. It's a one-to-many mapping, the bag is lazy. I create a parent, add a child, and save them. At this point, there's only 1 child in the bag. I start a new session, and load the parent - and now there's two children in the bag. They are both identical copies of the original child. When I check the database, there is only 1 child in the database. If I'm doing something wrong, please let me know. I can't figure out what it would be - it's such a simple case. Below is the relevant code, if there's anything else I can do to help let me know: ------------------------------------------------------------ Parent mapping of the child: <bag name="bagChildren" inverse="true" cascade="all" lazy="true"> <key column="parent_id"/> <one-to-many class="hibernateexamples.BagChild"/> </bag> ------------------------------------------------------------ Mapping of the child: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="hibernateexamples.BagChild" table="BagChild"> <id name="id" unsaved-value="-1"> <generator class="native" /> </id> <property name="name" type="string" length="2147483647"/> <many-to-one name="parent" column="parent_id" /> </class> </hibernate-mapping> ------------------------------------------------------------ Test code: public static void main(String[] args) throws Throwable { //Recreate the database tables CreateTablesMain.main(null); Session session = DatabaseHelper.startSession(); Transaction transaction = null; try { transaction = session.beginTransaction(); Parent parent = new Parent("Parent Name", "The parent for testing Bag"); BagChild bagChild = new BagChild(parent, "Bag Child 1"); System.out.println("Size of bag before saved: " + parent.getBagChildren().size()); session.save(parent); transaction.commit(); } finally { // If the transaction wasn't already commited or rolled back, assume an error occured and roll it back if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback(); session.close(); } session = DatabaseHelper.startSession(); transaction = null; try { transaction = session.beginTransaction(); // Print bag children Parent parent = (Parent) session.load(Parent.class, new Long(1)); Collection bagChildren = parent.getBagChildren(); System.out.println("Bag Size: " + bagChildren.size()); Iterator it = bagChildren.iterator(); while(it.hasNext()) { BagChild child = (BagChild) it.next(); System.out.println(child.getId()); } transaction.commit(); } finally { // If the transaction wasn't already commited or rolled back, assume an error occured and roll it back if(transaction != null && !transaction.wasCommitted() && !transaction.wasRolledBack()) transaction.rollback(); session.close(); } } ------------------------------------------------------------ Test code prints out: Size of bag before saved: 1 Hibernate: insert into parent (name, description) values (?, ?) Hibernate: SELECT LAST_INSERT_ID() Hibernate: insert into BagChild (name, parent_id) values (?, ?) Hibernate: SELECT LAST_INSERT_ID() Hibernate: select parent0_.id as id, parent0_.name as name, parent0_.description as descript3_ from parent parent0_ where parent0_.id=? Hibernate: select bagchild0_.id as id__, bagchild0_.id as id, bagchild0_.name as name, bagchild0_.parent_id as parent_id from BagChild bagchild0_ where bagchild0_.parent_id=? Bag Size: 2 1 1 --------------------------------------------------------------------- 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-08-01 14:06:14
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Fri, 1 Aug 2003 9:05 AM
As per the Hibernate HQL documentation, "id" is a special property name that *always* refers to the identifier property.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-222
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-222
Summary: id is transated the wrong way in OQL
Type: Bug
Status: Closed
Priority: Critical
Resolution: REJECTED
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: pk
Created: Fri, 1 Aug 2003 8:57 AM
Updated: Fri, 1 Aug 2003 9:05 AM
Environment: windows jdk1.3
Description:
this is part of the mapping
-----8<-----8<-----8<-----8<-----8<-----8<-------
<class name="be.benevita.bean.impl.MemberDossier" table="T_MEMBERDOSSIER">
<id name="HibernateID" column="HIBERNATE_ID" type="long">
<generator class="native"/>
</id>
<property name="id" column="DOSSIER_ID"/>
-----8<-----8<-----8<-----8<-----8<-----8<-------
when we execute the following oql
-----8<-----8<-----8<-----8<-----8<-----8<-------
from MemberDossier as memberDossier where memberDossier.id = :dossierName
-----8<-----8<-----8<-----8<-----8<-----8<-------
hibernate creates an SQL ".... where Hibernate0_.HIBERNATE_ID=? ..."
it should be: ".... where Hibernate0_.ID=? ..."
---------------------------------------------------------------------
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-08-01 14:03:14
|
Message:
The following issue has been resolved as FIXED.
Resolver: Gavin King
Date: Fri, 1 Aug 2003 9:03 AM
I have implemented an inelegant workaround for this design flaw.
I agree with your suggestion that optimally onFlushDirty() should return int[]. But this would break existing code.
So, what I've done that is a 90% fix is to recalculate dirtyProperties after onFlushDirty returns true. This *is* inefficient, but I can't see it really hurting performance much in practice.
I'm leaving this issue open, because this is not really a "perfect" fix.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-182
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-182
Summary: dirtyProperties array incorrect following Interceptor.onFlushDirty
Type: Bug
Status: Resolved
Priority: Major
Resolution: FIXED
Project: Hibernate2
Fix Fors:
2.0.2
Versions:
2.0.1
Assignee: Gavin King
Reporter: Tom Ward
Created: Fri, 11 Jul 2003 2:54 AM
Updated: Fri, 1 Aug 2003 9:03 AM
Description:
As Simon Spero noted in issue HB-4, in SessionImpl.flushEntities, the dirtyProperties array is calculated before Interceptor.onFlushDirty is called. As onFlushDirty has no way of reporting which of the currentState properties it has changed, if onFlushDirty does change a property, the dirtyProperties array will be incorrect. This seems to be an issue in the following scenario -
A superclass Super defines an id and a dateModified property, while a subclass Sub defines a commentText property. Sub is mapped as a joined-subclass of Super. An Interceptor is written to change the dateModified property in the currentState to the current date, whenever onFlushDirty is called.
The issue is this - if commentText is changed and the object is flushed, the Interceptor correctly modifies the dateModified. This change makes its way back to the instance of Sub, as expected. However, when the time comes to update the object in the database, only the commentText is updated. I believe that this is because as a joined-subclass, Sub is mapped across two tables, but the dirtyProperties array, calculcated before the call to onFlushDirty, only shows a change affecting one of these tables.
The ways I've found to work-around this are -
1) If using Interceptors, use a mapping strategy other than joined-subclasses.
2) Implement Interceptor.findDirty to return the properties you know will change in onFlushDirty (if other properties are dirty too). This seems very awkward.
For me, the ideal solution would be to change the return type of Interceptor.onFlushDirty to an int[], indicating the properties which have been changed. Then it would be a simple task to calculate the union of this array and dirtyProperties (and maybe even recheck the intersection).
I hope this is all helpful - I have read and re-read the javadocs to try and make sure I'm not missing anything, but it is still possible. I'll give as much help as I can trying to fix this.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-08-01 13:57:17
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-222 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-222 Summary: id is transated the wrong way in OQL Type: Bug Status: Unassigned Priority: Critical Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: pk Created: Fri, 1 Aug 2003 8:57 AM Updated: Fri, 1 Aug 2003 8:57 AM Environment: windows jdk1.3 Description: this is part of the mapping -----8<-----8<-----8<-----8<-----8<-----8<------- <class name="be.benevita.bean.impl.MemberDossier" table="T_MEMBERDOSSIER"> <id name="HibernateID" column="HIBERNATE_ID" type="long"> <generator class="native"/> </id> <property name="id" column="DOSSIER_ID"/> -----8<-----8<-----8<-----8<-----8<-----8<------- when we execute the following oql -----8<-----8<-----8<-----8<-----8<-----8<------- from MemberDossier as memberDossier where memberDossier.id = :dossierName -----8<-----8<-----8<-----8<-----8<-----8<------- hibernate creates an SQL ".... where Hibernate0_.HIBERNATE_ID=? ..." it should be: ".... where Hibernate0_.ID=? ..." --------------------------------------------------------------------- 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-08-01 08:36:14
|
Message:
The following issue has been re-assigned.
Assignee: Max Rydahl Andersen (mailto:xa...@xa...)
Assigner: Gavin King (mailto:ga...@in...)
Date: Fri, 1 Aug 2003 3:35 AM
Comment:
Max?
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-220
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-220
Summary: hbm2java generates wrong getter for java.lang.Boolean
Type: Bug
Status: Assigned
Priority: Minor
Project: Hibernate2
Components:
toolset
Versions:
2.0.2
Assignee: Max Rydahl Andersen
Reporter: Colin Evans
Created: Tue, 29 Jul 2003 4:32 PM
Updated: Fri, 1 Aug 2003 3:35 AM
Description:
The hbm2java BasicRenderer generates an "is" getter method for fields of type java.lang.Boolean. It should only do this for primitive fields of type boolean, and this breaks some other bean-based frameworks (such as the JSTL EL tags).
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-31 08:00:14
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Thu, 31 Jul 2003 2:59 AM
I have finally fixed this!
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-11
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-11
Summary: using path expression that dereferences a <key-many-to-one>
Type: Bug
Status: Closed
Priority: Major
Resolution: FIXED
Project: Hibernate2
Components:
core
Fix Fors:
2.0.2
Assignee:
Reporter: Max Rydahl Andersen
Created: Sat, 3 May 2003 10:01 AM
Updated: Thu, 31 Jul 2003 2:59 AM
Description:
using path expression that dereferences a <key-many-to-one>
As suggested in
https://sourceforge.net/forum/forum.php?thread_id=800929&forum_id=128638
I open a bug since we should be able to use
p.id.alertDefinition.clientSegmentationId
where id is a composite-id and alertDefinition a
key-many-to-one reference.
(Original SFBug#:http://sourceforge.net/tracker/index.php?func=detail&aid=675321&group_id=40712&atid=428708]
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-31 02:52:14
|
The following comment has been added to this issue:
Author: Gavin King
Created: Wed, 30 Jul 2003 9:50 PM
Body:
Now supports subqueries!
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-111
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-111
Summary: fields defined as formulas...
Type: New Feature
Status: In Progress
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.0rc2
Assignee: Gavin King
Reporter: Fabio Parise
Created: Thu, 29 May 2003 4:58 AM
Updated: Wed, 30 Jul 2003 4:02 AM
Description:
Trying to define a computed field (i.e. 'status1000' as the result of the following computation: status+1000; where 'status' is a table column) in this way:
<property column="STATUS+1000" length="10" name="status1000" not-null="true" type="java.lang.Long" update="false" insert="false"/>
if the first 7 chars of the attribute 'column' contains some non-valid chars for sql aliases, the produced SELECT statement will fail.
In the example the alias for the computed field is 'STATUS+16_', which is not a valid sql alias.
SELECT WkfPr0_.pkid as pkid, ..., WkfPr0_.STATUS+1000 as STATUS+16_ FROM WKF_PROCESS_CLASS WkfPr0_ WHERE WkfPr0_.pkid=?
if the field involved in the formula has a longer name i.e. MYSTATUS --> formula=MYSTATUS+1000, the computed alias is MYSTATU16_, which is a valid alias.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 17:50:55
|
Message:
The following issue has been closed.
Resolver: Christian Bauer
Date: Wed, 30 Jul 2003 12:43 PM
Already fixed in current CVS.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-221
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-221
Summary: idbag documentation bug
Type: Bug
Status: Closed
Priority: Trivial
Resolution: FIXED
Project: Hibernate2
Fix Fors:
2.0.2
Versions:
2.0.1
Assignee:
Reporter: Paul Rivers
Created: Wed, 30 Jul 2003 12:39 PM
Updated: Wed, 30 Jul 2003 12:43 PM
Description:
The documentation for the <idbag> mapping (http://hibernate.bluemars.net/hib_docs/reference/html/collections.html#collections-s1-13) shows:
<idbag name="lovers" table="LOVERS" lazy="true">
<collection-id column="ID" type="long">
<generator class="hilo"/>
</collection-id>
<key column="PERSON1"/>
<many-to-many column="PERSON2" class="eg.Person" outer-join="true"/>
</set>
Is it really supposed to be ended with </set> rather than </idbag>?
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 17:40:17
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-221 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-221 Summary: idbag documentation bug Type: Bug Status: Unassigned Priority: Trivial Project: Hibernate2 Versions: 2.0.1 Assignee: Reporter: Paul Rivers Created: Wed, 30 Jul 2003 12:39 PM Updated: Wed, 30 Jul 2003 12:39 PM Description: The documentation for the <idbag> mapping (http://hibernate.bluemars.net/hib_docs/reference/html/collections.html#collections-s1-13) shows: <idbag name="lovers" table="LOVERS" lazy="true"> <collection-id column="ID" type="long"> <generator class="hilo"/> </collection-id> <key column="PERSON1"/> <many-to-many column="PERSON2" class="eg.Person" outer-join="true"/> </set> Is it really supposed to be ended with </set> rather than </idbag>? --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <leg...@at...> - 2003-07-30 15:54:14
|
The following comment has been added to this issue:
Author: Panagiotis Louridas
Created: Wed, 30 Jul 2003 10:53 AM
Body:
It works fine!
Thanks!
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-209
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-209
Summary: FlushMode.AUTO problem in joined subclass hierarchy
Type: Bug
Status: Closed
Priority: Major
Resolution: FIXED
Project: Hibernate2
Fix Fors:
2.0.2
Versions:
2.0.1
Assignee: Gavin King
Reporter: Panagiotis Louridas
Created: Tue, 22 Jul 2003 8:09 AM
Updated: Sun, 27 Jul 2003 7:34 PM
Environment: RedHat Linux 9.0, JVM 1.4.2
Description:
Suppose we have a class hierarchy
A <- B <- C.
In my case the class hierarchy is mapped as a joined-subclass hierarchy, but my observations may hold in general.
I use a Session with the default FlushMode setting (FlushMode.AUTO). I open the session, load an object of class B or C, perform some changes on it, do some queries and flush the session. When the session is flushed, only updates for the table pertaining to class A are issued by hibernate.
If I manually flush just before the queries hibernate performs fine, issuing the proper updates for tables B and C. The same happens when I manually flush at the end of the transaction, after the queries, but having set the Session's flush mode to FlushMode.NEVER.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 12:47:49
|
The following issue has been updated:
Updater: Emmanuel Ligne (mailto:emm...@at...)
Date: Wed, 30 Jul 2003 7:27 AM
Changes:
Attachment changed to DTDEntityResolver.java
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215&page=history
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-215
Summary: Resolving XML external entities from a XML file enclosed in a jar
Type: Patch
Status: Unassigned
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Emmanuel Ligne
Created: Mon, 28 Jul 2003 6:14 AM
Updated: Wed, 30 Jul 2003 7:27 AM
Environment: Hibernate 2.0.1, windows 2000, jdk 1.4.1
Description:
When specifying something like <!ENTITY frame SYSTEM "/mypath/Frame.xml">, if both enclosing and enclosed XML files are in jar file, Frame.xml is not searched in the enclosing file jar
origin (as should be done regarding specif of relative URI search priority).
Updated net.sf.hibernate.util.DTDEntityResolver as well as its users
(ie XMLHelper and Configuration) so that optionnally a ClassLoader
can be passed. This classloader is tried to load resources as stream
given their systemId if the systemId is told to start with file:///
(ie relative uri).
code for DTDEntityResolver :
public class DTDEntityResolver implements EntityResolver {
Log log = LogFactory.getLog(DTDEntityResolver.class);
private final ClassLoader loader ;
public DTDEntityResolver(ClassLoader loader) {
super() ;
this.loader = loader ;
}
private static final String URL = "http://hibernate.sourceforge.net/";
private static final String FILE = "file:///" ;
public InputSource resolveEntity (String publicId, String systemId) {
if ( systemId!=null) {
if (systemId.startsWith(URL) ) {
log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/");
// Search for DTD
ClassLoader classLoader = this.getClass().getClassLoader();
InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) );
if (dtdStream==null) {
log.debug(systemId + "not found in classpath");
return null;
}
else {
log.debug("found " + systemId + " in classpath");
InputSource source = new InputSource(dtdStream);
source.setPublicId(publicId);
source.setSystemId(systemId);
return source;
}
}
else if (systemId.startsWith(FILE))
{
InputStream childStream = loader.getResourceAsStream(systemId.substring(FILE.length())) ;
if (childStream == null)
return null ;
else {
log.debug("found " + systemId + " from classLoader");
InputSource source = new InputSource(childStream);
source.setPublicId(publicId);
source.setSystemId(systemId);
return source;
}
} else
return null ;
} else {
// use the default behaviour
return null;
}
}
}
Impacted code in XMLHelper :
Added constructor
public static SAXReader createSAXReader(String file, ClassLoader cl) {
SAXReader reader = new SAXReader();
reader.setEntityResolver(new DTDEntityResolver(cl));
reader.setErrorHandler( new ErrorLogger(file) );
reader.setMergeAdjacentText(true);
reader.setValidation(true);
return reader;
}
Modified DTD_RESOLVER instanciation :
private static final EntityResolver DTD_RESOLVER = new DTDEntityResolver(XMLHelper.class.getClassLoader());
Configuration.java :
Modified some addXXX methods to use the new feature of XMLHelper :
public Configuration addInputStream(InputStream xmlInputStream, ClassLoader src) throws MappingException {
try {
add( XMLHelper.createSAXReader("XML InputStream", src).read( new InputSource(xmlInputStream) ) );
return this;
}
catch (MappingException me) {
throw me;
}
catch (Exception e) {
log.error("Could not configure datastore from input stream", e);
throw new MappingException(e);
}
}
/**
* Read mappings from an application resource
* @param path a resource
* @param classLoader a <tt>ClassLoader</tt> to use
*/
public Configuration addResource(String path, ClassLoader classLoader) throws MappingException {
log.info("Mapping resource: " + path);
InputStream rsrc = classLoader.getResourceAsStream(path);
if (rsrc==null) throw new MappingException("Resource: " + path + " not found");
return addInputStream(rsrc, classLoader);
}
/**
* Read a mapping from an application resource, using a convention.
* The class <tt>foo.bar.Foo</tt> is mapped by the file <tt>foo/bar/Foo.hbm.xml</tt>.
* @param persistentClass the mapped class
*/
public Configuration addClass(Class persistentClass) throws MappingException {
String fileName = persistentClass.getName().replace(StringHelper.DOT,'/') + ".hbm.xml";
log.info("Mapping resource: " + fileName);
ClassLoader cl = persistentClass.getClassLoader() ;
InputStream rsrc = cl.getResourceAsStream(fileName);
if (rsrc==null) throw new MappingException("Resource: " + fileName + " not found");
return addInputStream(rsrc, cl);
}
/**
* Read all mappings from a jar file
* @param resource an application resource (a jar file)
*/
public Configuration addJar(String resource) throws MappingException {
log.info("Searching for mapping documents in jar: " + resource);
final JarFile jarFile;
final ClassLoader cl ;
try {
cl = Thread.currentThread().getContextClassLoader() ;
jarFile = new JarFile(
cl.getResource(resource).getFile()
);
}
catch (IOException ioe) {
log.error("Could not configure datastore from jar", ioe);
throw new MappingException(ioe);
}
if (jarFile==null) throw new MappingException("Resource: " + resource + " not found");
Enumeration enum = jarFile.entries();
while( enum.hasMoreElements() ) {
ZipEntry z = (ZipEntry) enum.nextElement();
if( z.getName().endsWith(".hbm.xml") ) {
log.info( "Found mapping documents in jar: " + z.getName() );
try {
addInputStream( jarFile.getInputStream(z), cl );
}
catch (MappingException me) {
throw me;
}
catch (Exception e) {
log.error("Could not configure datastore from jar", e);
throw new MappingException(e);
}
}
}
return this;
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 12:29:14
|
The following issue has been updated:
Updater: Emmanuel Ligne (mailto:emm...@at...)
Date: Wed, 30 Jul 2003 7:27 AM
Changes:
Attachment changed to XMLHelper.java
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215&page=history
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-215
Summary: Resolving XML external entities from a XML file enclosed in a jar
Type: Patch
Status: Unassigned
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Emmanuel Ligne
Created: Mon, 28 Jul 2003 6:14 AM
Updated: Wed, 30 Jul 2003 7:27 AM
Environment: Hibernate 2.0.1, windows 2000, jdk 1.4.1
Description:
When specifying something like <!ENTITY frame SYSTEM "/mypath/Frame.xml">, if both enclosing and enclosed XML files are in jar file, Frame.xml is not searched in the enclosing file jar
origin (as should be done regarding specif of relative URI search priority).
Updated net.sf.hibernate.util.DTDEntityResolver as well as its users
(ie XMLHelper and Configuration) so that optionnally a ClassLoader
can be passed. This classloader is tried to load resources as stream
given their systemId if the systemId is told to start with file:///
(ie relative uri).
code for DTDEntityResolver :
public class DTDEntityResolver implements EntityResolver {
Log log = LogFactory.getLog(DTDEntityResolver.class);
private final ClassLoader loader ;
public DTDEntityResolver(ClassLoader loader) {
super() ;
this.loader = loader ;
}
private static final String URL = "http://hibernate.sourceforge.net/";
private static final String FILE = "file:///" ;
public InputSource resolveEntity (String publicId, String systemId) {
if ( systemId!=null) {
if (systemId.startsWith(URL) ) {
log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/");
// Search for DTD
ClassLoader classLoader = this.getClass().getClassLoader();
InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) );
if (dtdStream==null) {
log.debug(systemId + "not found in classpath");
return null;
}
else {
log.debug("found " + systemId + " in classpath");
InputSource source = new InputSource(dtdStream);
source.setPublicId(publicId);
source.setSystemId(systemId);
return source;
}
}
else if (systemId.startsWith(FILE))
{
InputStream childStream = loader.getResourceAsStream(systemId.substring(FILE.length())) ;
if (childStream == null)
return null ;
else {
log.debug("found " + systemId + " from classLoader");
InputSource source = new InputSource(childStream);
source.setPublicId(publicId);
source.setSystemId(systemId);
return source;
}
} else
return null ;
} else {
// use the default behaviour
return null;
}
}
}
Impacted code in XMLHelper :
Added constructor
public static SAXReader createSAXReader(String file, ClassLoader cl) {
SAXReader reader = new SAXReader();
reader.setEntityResolver(new DTDEntityResolver(cl));
reader.setErrorHandler( new ErrorLogger(file) );
reader.setMergeAdjacentText(true);
reader.setValidation(true);
return reader;
}
Modified DTD_RESOLVER instanciation :
private static final EntityResolver DTD_RESOLVER = new DTDEntityResolver(XMLHelper.class.getClassLoader());
Configuration.java :
Modified some addXXX methods to use the new feature of XMLHelper :
public Configuration addInputStream(InputStream xmlInputStream, ClassLoader src) throws MappingException {
try {
add( XMLHelper.createSAXReader("XML InputStream", src).read( new InputSource(xmlInputStream) ) );
return this;
}
catch (MappingException me) {
throw me;
}
catch (Exception e) {
log.error("Could not configure datastore from input stream", e);
throw new MappingException(e);
}
}
/**
* Read mappings from an application resource
* @param path a resource
* @param classLoader a <tt>ClassLoader</tt> to use
*/
public Configuration addResource(String path, ClassLoader classLoader) throws MappingException {
log.info("Mapping resource: " + path);
InputStream rsrc = classLoader.getResourceAsStream(path);
if (rsrc==null) throw new MappingException("Resource: " + path + " not found");
return addInputStream(rsrc, classLoader);
}
/**
* Read a mapping from an application resource, using a convention.
* The class <tt>foo.bar.Foo</tt> is mapped by the file <tt>foo/bar/Foo.hbm.xml</tt>.
* @param persistentClass the mapped class
*/
public Configuration addClass(Class persistentClass) throws MappingException {
String fileName = persistentClass.getName().replace(StringHelper.DOT,'/') + ".hbm.xml";
log.info("Mapping resource: " + fileName);
ClassLoader cl = persistentClass.getClassLoader() ;
InputStream rsrc = cl.getResourceAsStream(fileName);
if (rsrc==null) throw new MappingException("Resource: " + fileName + " not found");
return addInputStream(rsrc, cl);
}
/**
* Read all mappings from a jar file
* @param resource an application resource (a jar file)
*/
public Configuration addJar(String resource) throws MappingException {
log.info("Searching for mapping documents in jar: " + resource);
final JarFile jarFile;
final ClassLoader cl ;
try {
cl = Thread.currentThread().getContextClassLoader() ;
jarFile = new JarFile(
cl.getResource(resource).getFile()
);
}
catch (IOException ioe) {
log.error("Could not configure datastore from jar", ioe);
throw new MappingException(ioe);
}
if (jarFile==null) throw new MappingException("Resource: " + resource + " not found");
Enumeration enum = jarFile.entries();
while( enum.hasMoreElements() ) {
ZipEntry z = (ZipEntry) enum.nextElement();
if( z.getName().endsWith(".hbm.xml") ) {
log.info( "Found mapping documents in jar: " + z.getName() );
try {
addInputStream( jarFile.getInputStream(z), cl );
}
catch (MappingException me) {
throw me;
}
catch (Exception e) {
log.error("Could not configure datastore from jar", e);
throw new MappingException(e);
}
}
}
return this;
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 12:27:14
|
The following issue has been updated:
Updater: Emmanuel Ligne (mailto:emm...@at...)
Date: Wed, 30 Jul 2003 7:27 AM
Changes:
Attachment changed to Configuration.java
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215&page=history
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-215
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-215
Summary: Resolving XML external entities from a XML file enclosed in a jar
Type: Patch
Status: Unassigned
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Emmanuel Ligne
Created: Mon, 28 Jul 2003 6:14 AM
Updated: Wed, 30 Jul 2003 7:27 AM
Environment: Hibernate 2.0.1, windows 2000, jdk 1.4.1
Description:
When specifying something like <!ENTITY frame SYSTEM "/mypath/Frame.xml">, if both enclosing and enclosed XML files are in jar file, Frame.xml is not searched in the enclosing file jar
origin (as should be done regarding specif of relative URI search priority).
Updated net.sf.hibernate.util.DTDEntityResolver as well as its users
(ie XMLHelper and Configuration) so that optionnally a ClassLoader
can be passed. This classloader is tried to load resources as stream
given their systemId if the systemId is told to start with file:///
(ie relative uri).
code for DTDEntityResolver :
public class DTDEntityResolver implements EntityResolver {
Log log = LogFactory.getLog(DTDEntityResolver.class);
private final ClassLoader loader ;
public DTDEntityResolver(ClassLoader loader) {
super() ;
this.loader = loader ;
}
private static final String URL = "http://hibernate.sourceforge.net/";
private static final String FILE = "file:///" ;
public InputSource resolveEntity (String publicId, String systemId) {
if ( systemId!=null) {
if (systemId.startsWith(URL) ) {
log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/");
// Search for DTD
ClassLoader classLoader = this.getClass().getClassLoader();
InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) );
if (dtdStream==null) {
log.debug(systemId + "not found in classpath");
return null;
}
else {
log.debug("found " + systemId + " in classpath");
InputSource source = new InputSource(dtdStream);
source.setPublicId(publicId);
source.setSystemId(systemId);
return source;
}
}
else if (systemId.startsWith(FILE))
{
InputStream childStream = loader.getResourceAsStream(systemId.substring(FILE.length())) ;
if (childStream == null)
return null ;
else {
log.debug("found " + systemId + " from classLoader");
InputSource source = new InputSource(childStream);
source.setPublicId(publicId);
source.setSystemId(systemId);
return source;
}
} else
return null ;
} else {
// use the default behaviour
return null;
}
}
}
Impacted code in XMLHelper :
Added constructor
public static SAXReader createSAXReader(String file, ClassLoader cl) {
SAXReader reader = new SAXReader();
reader.setEntityResolver(new DTDEntityResolver(cl));
reader.setErrorHandler( new ErrorLogger(file) );
reader.setMergeAdjacentText(true);
reader.setValidation(true);
return reader;
}
Modified DTD_RESOLVER instanciation :
private static final EntityResolver DTD_RESOLVER = new DTDEntityResolver(XMLHelper.class.getClassLoader());
Configuration.java :
Modified some addXXX methods to use the new feature of XMLHelper :
public Configuration addInputStream(InputStream xmlInputStream, ClassLoader src) throws MappingException {
try {
add( XMLHelper.createSAXReader("XML InputStream", src).read( new InputSource(xmlInputStream) ) );
return this;
}
catch (MappingException me) {
throw me;
}
catch (Exception e) {
log.error("Could not configure datastore from input stream", e);
throw new MappingException(e);
}
}
/**
* Read mappings from an application resource
* @param path a resource
* @param classLoader a <tt>ClassLoader</tt> to use
*/
public Configuration addResource(String path, ClassLoader classLoader) throws MappingException {
log.info("Mapping resource: " + path);
InputStream rsrc = classLoader.getResourceAsStream(path);
if (rsrc==null) throw new MappingException("Resource: " + path + " not found");
return addInputStream(rsrc, classLoader);
}
/**
* Read a mapping from an application resource, using a convention.
* The class <tt>foo.bar.Foo</tt> is mapped by the file <tt>foo/bar/Foo.hbm.xml</tt>.
* @param persistentClass the mapped class
*/
public Configuration addClass(Class persistentClass) throws MappingException {
String fileName = persistentClass.getName().replace(StringHelper.DOT,'/') + ".hbm.xml";
log.info("Mapping resource: " + fileName);
ClassLoader cl = persistentClass.getClassLoader() ;
InputStream rsrc = cl.getResourceAsStream(fileName);
if (rsrc==null) throw new MappingException("Resource: " + fileName + " not found");
return addInputStream(rsrc, cl);
}
/**
* Read all mappings from a jar file
* @param resource an application resource (a jar file)
*/
public Configuration addJar(String resource) throws MappingException {
log.info("Searching for mapping documents in jar: " + resource);
final JarFile jarFile;
final ClassLoader cl ;
try {
cl = Thread.currentThread().getContextClassLoader() ;
jarFile = new JarFile(
cl.getResource(resource).getFile()
);
}
catch (IOException ioe) {
log.error("Could not configure datastore from jar", ioe);
throw new MappingException(ioe);
}
if (jarFile==null) throw new MappingException("Resource: " + resource + " not found");
Enumeration enum = jarFile.entries();
while( enum.hasMoreElements() ) {
ZipEntry z = (ZipEntry) enum.nextElement();
if( z.getName().endsWith(".hbm.xml") ) {
log.info( "Found mapping documents in jar: " + z.getName() );
try {
addInputStream( jarFile.getInputStream(z), cl );
}
catch (MappingException me) {
throw me;
}
catch (Exception e) {
log.error("Could not configure datastore from jar", e);
throw new MappingException(e);
}
}
}
return this;
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 10:19:14
|
Message:
The following issue has been closed.
Resolver: Christian Bauer
Date: Wed, 30 Jul 2003 5:18 AM
New examples package has been released yesterday. Old examples are deprecated.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-42
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-42
Summary: hibernate-examples-2.0
Type: Patch
Status: Closed
Priority: Minor
Resolution: FIXED
Project: Hibernate2
Fix Fors:
2.0.2
Assignee: Christian Bauer
Reporter: Max Rydahl Andersen
Created: Sat, 3 May 2003 10:26 AM
Updated: Wed, 30 Jul 2003 5:18 AM
Description:
hibernate-examples-2.0
Annexed is a ZIP of the hibernate-example refitted for
version 2.0 beta 3.
I'm also finishing up a Struts application based on the
eg examples. I'll release it at the Struts SourceForge
site (where Matt's Resume application now lives), and
let you know.
-Ted.
http://sourceforge.net/tracker/index.php?func=detail&aid=699668&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-07-30 09:05:22
|
The following comment has been added to this issue:
Author: Gavin King
Created: Wed, 30 Jul 2003 4:04 AM
Body:
This is now implemented for properties of <class> or <subclass>; not for properties of <component>s, nor for properties in a <joined-subclass> heirarchy.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-111
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-111
Summary: fields defined as formulas...
Type: New Feature
Status: In Progress
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.0rc2
Assignee: Gavin King
Reporter: Fabio Parise
Created: Thu, 29 May 2003 4:58 AM
Updated: Wed, 30 Jul 2003 4:02 AM
Description:
Trying to define a computed field (i.e. 'status1000' as the result of the following computation: status+1000; where 'status' is a table column) in this way:
<property column="STATUS+1000" length="10" name="status1000" not-null="true" type="java.lang.Long" update="false" insert="false"/>
if the first 7 chars of the attribute 'column' contains some non-valid chars for sql aliases, the produced SELECT statement will fail.
In the example the alias for the computed field is 'STATUS+16_', which is not a valid sql alias.
SELECT WkfPr0_.pkid as pkid, ..., WkfPr0_.STATUS+1000 as STATUS+16_ FROM WKF_PROCESS_CLASS WkfPr0_ WHERE WkfPr0_.pkid=?
if the field involved in the formula has a longer name i.e. MYSTATUS --> formula=MYSTATUS+1000, the computed alias is MYSTATU16_, which is a valid alias.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 06:57:14
|
The following comment has been added to this issue:
Author: Max Rydahl Andersen
Created: Wed, 30 Jul 2003 1:56 AM
Body:
idea: could we explicitly check reflectively for if equals and hashcode is implemented for the required classes ? (just to help the users)
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-214
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-214
Summary: Deadlock in processing "composite-id -> key-many-to-one"
Type: Bug
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate2
Assignee:
Reporter: Shining
Created: Mon, 28 Jul 2003 5:28 AM
Updated: Tue, 29 Jul 2003 8:36 PM
Environment: Windows2000 Professional with SP3, SQL Server 2000, Microsoft SQLServer 2000 JDBC Driver, SUN JDK 1.4.1_02, Elcipse 2.1
Description:
I want use multi-primary-key and foriegn-key as primary-key in my project. The insert and update operator can work correctly, but the load operator can not work correctly. After tracing the source code of hibernate, I think problem is the process of the <composition-id> with <key-many-to-one> element.
I can not sure it is a bug or hibernate can not support my database schema. What can I do?
My Sample is:
-----------------------DataBase Schema---------------------------------
/*==============================================================*/
/* Table: TBL_DWZT_NCS */
/*==============================================================*/
create table TBL_DWZT_NCS (
ZT_BM char(10) not null,
DW_BZDM char(40) not null,
NCS_FLYS_BM FLYS_BM not null,
NCS_YEFX JDBZ not null,
NCS_YE JE not null,
constraint PK_TBL_DWZT_NCS primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM)
)
go
/*==============================================================*/
/* Table: TBL_DWZT_NCSHB */
/*==============================================================*/
create table TBL_DWZT_NCSHB (
ZT_BM char(10) not null,
DW_BZDM char(40) not null,
NCS_FLYS_BM FLYS_BM not null,
NCSHB_DM HB_DM not null,
NCSHB_YE JE not null,
constraint PK_TBL_DWZT_NCSHB primary key (ZT_BM, DW_BZDM, NCS_FLYS_BM, NCSHB_DM)
)
go
alter table TBL_DWZT_NCSHB
add constraint FK_DWZT_NCS_HB foreign key (ZT_BM, DW_BZDM, NCS_FLYS_BM)
references TBL_DWZT_NCS (ZT_BM, DW_BZDM, NCS_FLYS_BM)
on update cascade on delete cascade
go
-----------------------NCS.hbm.xml-------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="jdo.NCS" table="TBL_DWZT_NCS">
<!--<jcs-cache usage="read-write"/>-->
<composite-id>
<key-property name="dw_bzdm" column="DW_BZDM"/>
<key-property name="zt_bm" column="ZT_BM"/>
<key-property name="flys_bm" column="NCS_FLYS_BM"/>
</composite-id>
<property name="yefx" column="NCS_YEFX" type="int"/>
<property name="YE" column="NCS_YE" type="double"/>
<set name="hbs" cascade="save-update">
<key>
<column name="DW_BZDM"/>
<column name="ZT_BM"/>
<column name="NCS_FLYS_BM" />
</key>
<one-to-many class="jdo.NCSHB"/>
</set>
</class>
</hibernate-mapping>
-----------------------NCSHB.hbm.xml-------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="jdo.NCSHB" table="TBL_DWZT_NCSHB">
<!--<jcs-cache usage="read-write"/>-->
<composite-id>
<key-many-to-one name="ncs" class="jdo.NCS">
<column name="DW_BZDM"/>
<column name="ZT_BM"/>
<column name="NCS_FLYS_BM" />
</key-many-to-one>
<key-property name="hb_dm" column="NCSHB_DM"/>
</composite-id>
<property name="ye" column="NCSHB_YE" type="double"/>
</class>
</hibernate-mapping>
----------------------------NCS.java----------------------------------
/*
* Created on 2003-7-10
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package jdo;
import java.io.Serializable;
import java.util.Set;
import java.util.HashSet;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class NCS implements Serializable {
private String dw_bzdm;
private String zt_bm;
private String flys_bm;
private FLYS flys;
private int yefx;
private double ye;
private Set hbs;
/**
* @return
*/
public String getDw_bzdm() {
return dw_bzdm;
}
/**
* @return
*/
public String getFlys_bm() {
return flys_bm;
}
/**
* @return
*/
public double getYE() {
return ye;
}
/**
* @return
*/
public int getYefx() {
return yefx;
}
/**
* @return
*/
public String getZt_bm() {
return zt_bm;
}
/**
* @param string
*/
public void setDw_bzdm(String string) {
dw_bzdm = string;
}
/**
* @param string
*/
public void setFlys_bm(String string) {
flys_bm = string;
}
/**
* @param d
*/
public void setYE(double d) {
ye = d;
}
/**
* @param string
*/
public void setYefx(int i) {
yefx = i;
}
/**
* @param string
*/
public void setZt_bm(String string) {
zt_bm = string;
}
public Set getHbs() {
return hbs;
}
void setHbs(Set hbs) {
this.hbs = hbs;
}
void addHb(NCSHB ncshb)
{
if (hbs == null)
hbs = new HashSet();
hbs.add(ncshb);
}
/**
* @return
*/
public FLYS getFlys() {
return flys;
}
/**
* @param flys
*/
public void setFlys(FLYS flys) {
this.flys = flys;
}
}
----------------------------NCSHB.java----------------------------------
/*
* Created on 2003-7-10
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package jdo;
import java.io.Serializable;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class NCSHB implements Serializable {
private NCS ncs;
private String hb_dm;
private double ye;
/**
* @return
*/
public String getHb_dm() {
return hb_dm;
}
/**
* @return
*/
public double getYe() {
return ye;
}
/**
* @return
*/
public NCS getNcs() {
return ncs;
}
/**
* @param string
*/
public void setHb_dm(String string) {
hb_dm = string;
}
/**
* @param d
*/
public void setYe(double d) {
ye = d;
}
/**
* @param ncs
*/
public void setNcs(NCS ncs) {
this.ncs = ncs;
}
}
----------------------------hibernate.properties-----------------------
######################
### Query Language ###
######################
## define query language constants / function names
hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
## package imports
#hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg
#################
### Platforms ###
#################
## MS SQL Server
hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
#hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_XTGL;SelectMethod=cursor
hibernate.connection.url jdbc:microsoft:sqlserver://192.168.0.3:1433;DatabaseName=FIMS_ZWGL;SelectMethod=cursor
hibernate.connection.username sa
hibernate.connection.password
#################################
### Hibernate Connection Pool ###
#################################
#hibernate.connection.pool_size 1
#hibernate.statement_cache.size 25
###################################
### Apache DBCP Connection Pool ###
###################################
## connection pool
hibernate.dbcp.maxActive 100
hibernate.dbcp.whenExhaustedAction 1
hibernate.dbcp.maxWait 120000
hibernate.dbcp.maxIdle 10
## prepared statement cache
hibernate.dbcp.ps.maxActive 100
hibernate.dbcp.ps.whenExhaustedAction 1
hibernate.dbcp.ps.maxWait 120000
hibernate.dbcp.ps.maxIdle 100
## optional query to validate pooled connections:
#hibernate.dbcp.validationQuery select 1 from dual
#hibernate.dbcp.testOnBorrow true
#hibernate.dbcp.testOnReturn false
#################################
### Plugin ConnectionProvider ###
#################################
## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)
#hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider
hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.ProxoolConnectionProvider
#######################
### Transaction API ###
#######################
## the Transaction API abstracts application code from the underlying JTA or JDBC transactions
#hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory
#hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory
## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
## default is java:comp/UserTransaction
#jta.UserTransaction jta/usertransaction
#jta.UserTransaction javax.transaction.UserTransaction
#jta.UserTransaction UserTransaction
## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup
##############################
### Miscellaneous Settings ###
##############################
## print all generated SQL to the console
hibernate.show_sql true
## specify a JDBC isolation level
#hibernate.connection.isolation 4
## set the JDBC fetch size
#hibernate.jdbc.fetch_size 25
## set the maximum JDBC 2 batch size (a nonzero value enables batching)
hibernate.jdbc.batch_size 0
## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)
#hibernate.jdbc.use_scrollable_resultset true
## use streams when writing binary types to / from JDBC
hibernate.jdbc.use_streams_for_binary true
## specify a default schema for unqualified tablenames
#hibernate.default_schema test
## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used)
#hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt
## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default)
#hibernate.use_outer_join false
## enable CGLIB reflection optimizer (enabled by default)
#hibernate.cglib.use_reflection_optimizer false
############
### JNDI ###
############
## specify a JNDI name for the SessionFactory
#hibernate.session_factory_name hibernate/session_factory
## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
## is the best approach in an application server
#file system
#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
#hibernate.jndi.url file:/
#WebSphere
#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
#hibernate.jndi.url iiop://localhost:900/
----------------------------Test.java----------------------------------
1 try {
2 // configure the Configuration
3 ds = new Configuration()
4 .addClass(jdo.NCS.class)
5 .addClass(jdo.NCSHB.class);
6
7 // build a SessionFactory
8 sessions = ds.buildSessionFactory();
9
10 Session sess = sessions.openSession();
11
12 NCS ncs = null;
13
14 Iterator iter = sess.iterate("FROM NCS ncs");
15 while (iter.hasNext()) {
16 ncs = (NCS) iter.next();
17 sess.delete(ncs);
18 }
19
20 ncs = new NCS();
21 ncs.setDw_bzdm("0001");
22 ncs.setZt_bm("01");
23 ncs.setFlys_bm("[][][][][][][][]");
24 ncs.setYefx(1);
25 ncs.setYE(1000.00);
26
NCSHB ncshb = null;
ncshb = new NCSHB();
ncshb.setNcs(ncs);
ncshb.setHb_dm("RMB");
ncshb.setYe(1000.00);
ncs.addHb(ncshb);
sess.save(ncs);
ncs = new NCS();
ncs.setDw_bzdm("0002");
ncs.setZt_bm("01");
ncs.setFlys_bm("[01][][][][][][][]");
ncs.setYefx(1);
ncs.setYE(900.00);
ncshb = new NCSHB();
ncshb.setNcs(ncs);
ncshb.setHb_dm("RMB");
ncshb.setYe(900.00);
ncs.addHb(ncshb);
ncshb = new NCSHB();
ncshb.setNcs(ncs);
ncshb.setHb_dm("USD");
ncshb.setYe(100.00);
ncs.addHb(ncshb);
sess.save(ncs);
sess.delete(ncs);
sess.flush();
sess.connection().commit();
sess.close();
} catch (HibernateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Deadlock occured in line 14, the session.iterator()
------------------------------Erro Message----------------------------
Hibernate: select ncs0_.DW_BZDM as x0_0_, ncs0_.ZT_BM as x0_1_, ncs0_.NCS_FLYS_BM as x0_2_ from TBL_DWZT_NCS ncs0_
Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=?
Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=?
Hibernate: select ncs0_.DW_BZDM as DW_BZDM, ncs0_.ZT_BM as ZT_BM, ncs0_.NCS_FLYS_BM as NCS_FLYS_BM, ncs0_.NCS_YEFX as NCS_YEFX, ncs0_.NCS_YE as NCS_YE from TBL_DWZT_NCS ncs0_ where ncs0_.DW_BZDM=? and ncs0_.ZT_BM=? and ncs0_.NCS_FLYS_BM=?
Hibernate: select tbl_dwzt0_.DW_BZDM as DW_BZDM__, tbl_dwzt0_.ZT_BM as ZT_BM__, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS3___, tbl_dwzt0_.NCSHB_DM as NCSHB_DM__, tbl_dwzt0_.DW_BZDM as DW_BZDM, tbl_dwzt0_.ZT_BM as ZT_BM, tbl_dwzt0_.NCS_FLYS_BM as NCS_FLYS_BM, tbl_dwzt0_.NCSHB_DM as NCSHB_DM, tbl_dwzt0_.NCSHB_YE as NCSHB_YE from TBL_DWZT_NCSHB tbl_dwzt0_ where tbl_dwzt0_.DW_BZDM=? and tbl_dwzt0_.ZT_BM=? and tbl_dwzt0_.NCS_FLYS_BM=?
..............
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 06:54:14
|
The following comment has been added to this issue:
Author: Max Rydahl Andersen
Created: Wed, 30 Jul 2003 1:53 AM
Body:
ok - I reread the spec and it actually only says something about "Boolean properties" and in here it is only for boolean primitive type and it actually also just say "allow", instead of "required" ;)
So, I'll look at this and make it user controllable....
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-220
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-220
Summary: hbm2java generates wrong getter for java.lang.Boolean
Type: Bug
Status: Unassigned
Priority: Minor
Project: Hibernate2
Components:
toolset
Versions:
2.0.2
Assignee:
Reporter: Colin Evans
Created: Tue, 29 Jul 2003 4:32 PM
Updated: Tue, 29 Jul 2003 4:32 PM
Description:
The hbm2java BasicRenderer generates an "is" getter method for fields of type java.lang.Boolean. It should only do this for primitive fields of type boolean, and this breaks some other bean-based frameworks (such as the JSTL EL tags).
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 03:42:13
|
Message:
The following issue has been re-assigned.
Assignee: Gavin King (mailto:ga...@in...)
Assigner: Gavin King (mailto:ga...@in...)
Date: Tue, 29 Jul 2003 10:42 PM
Comment:
Had no idea this would be so popular!
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-111
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-111
Summary: fields defined as formulas...
Type: New Feature
Status: Assigned
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.0rc2
Assignee: Gavin King
Reporter: Fabio Parise
Created: Thu, 29 May 2003 4:58 AM
Updated: Tue, 29 Jul 2003 10:42 PM
Description:
Trying to define a computed field (i.e. 'status1000' as the result of the following computation: status+1000; where 'status' is a table column) in this way:
<property column="STATUS+1000" length="10" name="status1000" not-null="true" type="java.lang.Long" update="false" insert="false"/>
if the first 7 chars of the attribute 'column' contains some non-valid chars for sql aliases, the produced SELECT statement will fail.
In the example the alias for the computed field is 'STATUS+16_', which is not a valid sql alias.
SELECT WkfPr0_.pkid as pkid, ..., WkfPr0_.STATUS+1000 as STATUS+16_ FROM WKF_PROCESS_CLASS WkfPr0_ WHERE WkfPr0_.pkid=?
if the field involved in the formula has a longer name i.e. MYSTATUS --> formula=MYSTATUS+1000, the computed alias is MYSTATU16_, which is a valid alias.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 03:40:21
|
The following issue has been updated:
Updater: Gavin King (mailto:ga...@in...)
Date: Tue, 29 Jul 2003 10:40 PM
Comment:
Scheduled for 2.1
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-60&page=history
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-60
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-60
Summary: Pluggable Cache
Type: New Feature
Status: Assigned
Priority: Critical
Project: Hibernate2
Components:
core
Fix Fors:
2.1
Versions:
2.1
Assignee: Gavin King
Reporter: Gavin King
Created: Tue, 6 May 2003 5:31 AM
Updated: Tue, 29 Jul 2003 10:40 PM
Description:
We plan to make the JVM-level cache fully pluggable, and remove the mapping-file dependency upon JCS.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <leg...@at...> - 2003-07-30 03:40:20
|
The following issue has been updated:
Updater: Gavin King (mailto:ga...@in...)
Date: Tue, 29 Jul 2003 10:39 PM
Comment:
See HB-60
Changes:
Fix Version changed to 2.1
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-47&page=history
---------------------------------------------------------------------
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: Assigned
Priority: Critical
Project: Hibernate2
Fix Fors:
2.1
Assignee: Gavin King
Reporter: Max Rydahl Andersen
Created: Sat, 3 May 2003 10:30 AM
Updated: Tue, 29 Jul 2003 10:39 PM
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-07-30 02:59:14
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Tue, 29 Jul 2003 9:58 PM
This was caused by the repeated column name, which I didn't notice at first.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-145
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-145
Summary: insert for classes with composite-id crashes
Type: Bug
Status: Closed
Priority: Minor
Resolution: REJECTED
Project: Hibernate2
Assignee: Gavin King
Reporter: Hrituc Ovidiu
Created: Thu, 19 Jun 2003 10:21 AM
Updated: Tue, 29 Jul 2003 9:58 PM
Environment: W2k professional, SQL Server 2k, OC4J
Description:
Insert for classes with composite-id crashes when persisting to SQL Server 2000.
The composite id consists of the COD, DATA_FIN combination. I am trying to keep the history of a person in the same table and the current record to be the combination (COD_Value, 01/01/3000)
The current manager's data gets pulled out with a many-to-one relationship with a composite fk (MGR_ID, BOGUS_DT_FIN).
Loading goes ok.
Insert doesn't, the exceptions look like this:
Hibernate: insert into PERSON (PKID, NAME, DATA_INI, DEPT_ID, MGR_ID, BOGUS_DT_FIN, COD, DATA_FIN) values (?, ?, ?, ?, ?, ?, ?, ?)
Jun 19, 2003 6:02:16 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: 07009
Jun 19, 2003 6:02:16 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).
Jun 19, 2003 6:02:17 PM net.sf.hibernate.JDBCException <init>
SEVERE: Could not synchronize database state with session
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.validateParameterIndex(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setTimestamp(Unknown Source)
at com.evermind.sql.FilterPreparedStatement.setTimestamp(FilterPreparedStatement.java:394)
at com.evermind.sql.FilterPreparedStatement.setTimestamp(FilterPreparedStatement.java:394)
at net.sf.hibernate.type.TimestampType.set(TimestampType.java:27)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
at net.sf.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:163)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:369)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:446)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:20)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2064)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2036)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:1980)
at it.saga.library.commonDataTypes.impl.CdtBLGBaseSessionBean.save(CdtBLGBaseSessionBean.java:247)
at CdtBLGPerson_StatelessSessionBeanWrapper10.save(CdtBLGPerson_StatelessSessionBeanWrapper10.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
at java.lang.Thread.run(Thread.java:536)
---------------------------------------------------------------------
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
|