[Hibernate-JIRA] Created: (HHH-5790) method BasicBinder#bind() slow because formatting for trace is done also with disabled trace
by Guenther Demetz (JIRA)
method BasicBinder#bind() slow because formatting for trace is done also with disabled trace
--------------------------------------------------------------------------------------------
Key: HHH-5790
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5790
Project: Hibernate Core
Issue Type: Improvement
Affects Versions: 3.6.0
Environment: 3_6_0_final
Reporter: Guenther Demetz
In the ELSE block of method org.hibernate.type.descriptor.sql.BasicBinder#bind
the if statement "if (log.isTraceEnabled())" is missing, so strings are formatted
even if trace logging is disabled.
CURRENT CODE:
if ( value == null ) {
if ( log.isTraceEnabled() ) {
log.trace(String.format(...);
}
st.setNull( index, sqlDescriptor.getSqlType() );
}
else {
log.trace(String.format(BIND_MSG_TEMPLATE,index, ...);
doBind( st, value, index, options );
}
IMPROVEMENT:
if ( value == null ) {
if ( log.isTraceEnabled() ) {
log.trace(String.format(...);
}
st.setNull( index, sqlDescriptor.getSqlType() );
}
else {
if ( log.isTraceEnabled() ) { //// NEW LINE
log.trace(String.format(BIND_MSG_TEMPLATE,index, ...);
} //// NEW LINE
doBind( st, value, index, options );
}
BTW: By doing this little code enhancement, I was able to achieve almost the double speed when inserting data.
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HBX-1186) Missing many-to-one relationships in which foreign key references a unique key in the one side
by Rui Baeta (JIRA)
Missing many-to-one relationships in which foreign key references a unique key in the one side
----------------------------------------------------------------------------------------------
Key: HBX-1186
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1186
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2.4.GA
Environment: jdk1.5.0_11
hibernate-tools-3.2.4.GA
hibernate-core-3.3.2.GA
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
Oracle JDBC driver, version: 11.2.0.1.0
Reporter: Rui Baeta
Attachments: OracleMetaDataDialect.patch
In the reverse engineering process, Hibernate Tools is missing many-to-one relationships in which foreign key references a _unique key_ in the one side.
Here is a test case: table {{detail}} has a foreign key to table {{master}}, and references a column that has a unique constraint ({{uk_master}}).
{code:SQL}
create table master (
pk_master number(24), --primary key
uk_master number(24), --unique key
primary key (pk_master),
unique (uk_master)
);
create table detail (
pk_detail number(24), --primary key
fk_master number(24), --foreign key
primary key (pk_detail)
);
alter table detail add constraint cns_fk_master
foreign key (fk_master) references master(uk_master)
;
{code}
Now, when executing Hibernate Tools with {{OracleMetaDataDialect}}, this relationship is not captured by the metadata query issued by {{OracleMetaDataDialect}} (constant {{SQL_FK_BASE}}). This is so because {{OracleMetaDataDialect}} is restricting foreign key relationships only to _primary key constraints_:
{code:SQL}constraint_type = 'P'{code}
If we change this restriction so that it includes also _unique key constraints_, it works:
{code:SQL}constraint_type in ('P','U'){code}
As far as I know, this change doesn't have side effects.
There is a patch attached.
(If you need, I can zip a simple maven project with this test case.)
--
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
13 years, 7 months
[Hibernate-JIRA] Created: (HHH-5025) Support caching audit queries using ehcache's DiskStore.
by Brent Worden (JIRA)
Support caching audit queries using ehcache's DiskStore.
--------------------------------------------------------
Key: HHH-5025
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5025
Project: Hibernate Core
Issue Type: Improvement
Components: envers
Reporter: Brent Worden
Priority: Minor
Enabling audit query caching with a ehcache cache configured as persisting to disk or overflowing to disk. For example,
<defaultCache diskPersistent="true" eternal="false" maxElementsInMemory="1000" maxElementsOnDisk="10000" overflowToDisk="true" timeToIdleSeconds="300" timeToLiveSeconds="3600" />
Results in the following exception:
java.io.NotSerializableException: org.hibernate.envers.entities.RevisionTypeType
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
The lack of needed serialization prohibits the use of ehcache's DiskStore.
--
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
13 years, 7 months