[Hibernate-JIRA] Created: (HHH-4102) Same applies to version 3.3.1
by Peter Ladanyi (JIRA)
Same applies to version 3.3.1
-----------------------------
Key: HHH-4102
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4102
Project: Hibernate Core
Issue Type: Sub-task
Components: core
Affects Versions: 3.3.1
Reporter: Peter Ladanyi
Priority: Critical
Can u please validate my change
ThreadLocalSessionContext.TransactionProtectionWrapper.invoke(line:328 )
Modified to
if ( "beginTransaction".equals( method.getName() )
|| "getTransaction".equals( method.getName() )
|| "isTransactionInProgress".equals( method.getName() )
|| "setFlushMode".equals( method.getName() )
|| "createCriteria".equals( method.getName() )
|| "createFilter".equals( method.getName() )
|| "createQuery".equals( method.getName() )
|| "get".equals( method.getName() )
|| "load".equals( method.getName() )
|| "refresh".equals( method.getName() )
|| "update".equals( method.getName() )
|| "getSessionFactory".equals( method.getName() ) ) {
log.trace( "allowing method [" + method.getName() + "] in non-transacted context" );
}
else if ( "reconnect".equals( method.getName() )
|| "disconnect".equals( method.getName() ) ) {
// allow these (deprecated) methods to pass through
}
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[Hibernate-JIRA] Created: (HHH-4101) add mapping inheritance to allow read only classes to be used for reporting
by Ian Hayes (JIRA)
add mapping inheritance to allow read only classes to be used for reporting
---------------------------------------------------------------------------
Key: HHH-4101
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4101
Project: Hibernate Core
Issue Type: New Feature
Environment: All
Reporter: Ian Hayes
I'm finding that with a number of hibernate mappings I have a simple version of an entity defined for basic CRUD operations, and then I really need an expanded version of the same entity that includes all of its associations for reporting process optimization.
For example: I have an entity (e.g. course) that has a number of related sub entities (e.g. attendees, class times etc) but I don't want to include these sub entities as properties in the main entity class used for CRUD operations.
To get around this I'm using the following class hierarchy...
Code:
AbstractCourse
|---- Course
|---- CoursePlusBookings
public abstract class AbstractCourse {
private int CourseID;
private String Title;
private String Teacher
}
public class Course extends AbstractCourse {
}
public class Attendee {
private int AttendeeID;
private int CourseID;
private String StudentName;
}
public CoursePlusBookings extends AbstractCourse {
private Set<Attendee> Attendees;
}
Now for all entity level CRUD operations I'm using 'Course' and 'Attendee' separately to add entries to the underlying database. However, for reporting purposes I want to use 'CoursePlusBookings, which allows me to show a list of courses with the number of bookings.
Now the only way I can find to support this approach is to have two separate mappings - one for 'Course' and a second for 'CoursePlusBookings' - both of which map to the same table. I can't find a way of implementing mapping inheritance to avoid this duplication. I did raise this question sometime ago on the support forums (see viewtopic.php?f=1&t=984333) but unfortunately the respondents misunderstood my question, so I'm asking it again.
I suppose in a way this posting boils down to a question about whether it is possible to have mapping element associations that are read only in nature. In otherwords if persisted CoursePlusBookings then the Attendee set would not be persisted as part of that operation.
An alternative approach would be to allow mapping inheritance where a sub class has no discriminator and is marked as 'read only'. Such read only sub classes could have multiple properties representing sub entity set associations.
Or is there another way to achieve what I'm after?
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[Hibernate-JIRA] Commented: (HHH-1352) Session.setReadOnly(Object, boolean) fails for proxies
by Bob Tiernay (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1352?page=c... ]
Bob Tiernay commented on HHH-1352:
----------------------------------
What isn't accounting for proxies, is there a workaround, and is this intended to be fixed?
Thanks
> Session.setReadOnly(Object, boolean) fails for proxies
> ------------------------------------------------------
>
> Key: HHH-1352
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1352
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1
> Environment: Hibernate 3.1, MySQL 5.0.15-nt
> Reporter: Stewart Cambridge
> Assignee: Steve Ebersole
> Priority: Minor
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> Session.setReadOnly(Object, boolean) is broken. It throws a TransientObjectException with the message "Instance was not associated with the session" when the object is quite obvious associated with the current session, because we only just loaded it using Session.load(Class, Serializable)
> Here is a simple JUnit test, for an arbitrary entity:
> public void testReadOnly()
> throws Exception
> {
> User user = (User) session.load(User.class, new Long(7));
> System.out.println("\n=== " + user + " ===");
> session.setReadOnly(user, true);
> }
> This is the exception stack trace:
> org.hibernate.TransientObjectException: Instance was not associated with the session at org.hibernate.engine.StatefulPersistenceContext.setReadOnly(StatefulPersistenceContext.java:1167) at org.hibernate.impl.SessionImpl.setReadOnly(SessionImpl.java:1740) at
> test.persistence.HibernateObjectTest.testReadOnly(HibernateObjectTest.java:30) ....
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[Hibernate-JIRA] Created: (HHH-3161) No Dialect mapping for JDBC type: -4
by cyrus (JIRA)
No Dialect mapping for JDBC type: -4
------------------------------------
Key: HHH-3161
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3161
Project: Hibernate3
Issue Type: Bug
Components: core, query-hql, query-sql
Affects Versions: 3.2.1
Environment: hibernate 3.2.1 + mysql
Reporter: cyrus
Priority: Critical
When I execute the statement below:
SELECT concat(case ip_protocol when 6 then 'TCP' when 17 then 'UDP' else 'OTHER' end, ', PORT ', repeat(' ', 5 - length(if(port is NULL, 0, port))), if(port is NULL, 0, port)) as protocol, concat(case ip_protocol when 6 then 'TCP' when 17 then 'UDP' else 'OTHER' end, if(port is NULL, 0, port)) as id, sum(byte_subtotal) as total FROM usage_sum_minute WHERE from_unixtime(time_min * 60) between '2008-02-03 14:00:00' and '2008-03-05 13:59:00' GROUP BY protocol ORDER BY total DESC LIMIT 0, 20
DB schema:
CREATE TABLE `ascot`.`usage_sum_minute` (
`id` int(11) NOT NULL auto_increment,
`igateway_id` smallint(5) NOT NULL,
`time_min` int(11) NOT NULL,
`user_name` varchar(255) default NULL,
`mac_local` varchar(80) NOT NULL,
`ip_local` bigint(20) NOT NULL,
`ip_remote` bigint(20) NOT NULL,
`ip_protocol` smallint(5) NOT NULL,
`port` smallint(6) default NULL,
`domain_name` char(80) default NULL,
`url` varchar(1024) default NULL,
`byte_subtotal` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `index_igateway` (`igateway_id`),
KEY `index_protocol` (`ip_protocol`),
KEY `index_minute` (`time_min`),
KEY `index_user` (`user_name`),
KEY `index_port` (`port`),
KEY `index_ip` (`ip_remote`)
) ENGINE=InnoDB AUTO_INCREMENT=505699 DEFAULT CHARSET=latin1
It give an exception "No Dialect mapping for JDBC type: -4"
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[Hibernate-JIRA] Resolved: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=c... ]
Gail Badner resolved HHH-1483.
------------------------------
Resolution: Duplicate
Fixed by HHH-3892.
> MySQL5: No Dialect mapping for JDBC type: -1
> --------------------------------------------
>
> Key: HHH-1483
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: MySQL 5.0.18-nt
> Reporter: Sergey Vladimirov
> Assignee: Gail Badner
> Priority: Minor
> Attachments: hhh-1483-patch.txt
>
>
> MySQL5: No Dialect mapping for JDBC type: -1
> SELECT answpos,answer FROM votes_answers WHERE question=? ORDER BY answpos
> mysql> describe votes_answers;
> +----------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +----------+---------+------+-----+---------+-------+
> | question | int(11) | NO | MUL | | |
> | answpos | int(11) | NO | | | |
> | answer | text | YES | | NULL | |
> +----------+---------+------+-----+---------+-------+
> mysql> describe temp;
> +---------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+---------+------+-----+---------+-------+
> | answpos | int(11) | NO | | 0 | |
> | answer | text | YES | | NULL | |
> +---------+---------+------+-----+---------+-------+
> Please, let me know what to add to MySQL5Dialect :)
> Will it be ok to add? :
> registerColumnType( Types.LONGVARCHAR, "text" );
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months