[Hibernate-JIRA] Created: (HHH-3031) Include "FOR READ ONLY" hint in non-locking DB2 statements
by Steve Finch (JIRA)
Include "FOR READ ONLY" hint in non-locking DB2 statements
----------------------------------------------------------
Key: HHH-3031
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3031
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.5
Environment: 3.2.5, DB2/UDB 8.1+
Reporter: Steve Finch
As per the DB2 documentation:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.i...
The FOR READ ONLY clause indicates that the result table is read-only and therefore the cursor cannot be referred to in Positioned UPDATE and DELETE statements. FOR FETCH ONLY has the same meaning.
For result tables in which updates and deletes are allowed, specifying FOR READ ONLY (or FOR FETCH ONLY) can possibly improve the performance of FETCH operations by allowing the database manager to do blocking. For example, in programs that contain dynamic SQL statements without the FOR READ ONLY or ORDER BY clause, the database manager might open cursors as if the FOR UPDATE clause were specified. It is recommended, therefore, that the FOR READ ONLY clause be used to improve performance, except in cases where queries will be used in positioned UPDATE or DELETE statements.
A read-only result table must not be referred to in a Positioned UPDATE or DELETE statement, whether it is read-only by nature or specified as FOR READ ONLY (FOR FETCH ONLY).
The aforementioned improvement can be achieved by applying "FOR READ ONLY" when other locking hints are not specified.
Patch to be uploaded soon.
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-6413) C3P0ConnectionProvider
by Robert Saenger (JIRA)
C3P0ConnectionProvider
----------------------
Key: HHH-6413
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6413
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.4
Environment: c3p0-0.9.1.2
com.p6spy.engine.spy.P6SpyDriver, oracle.jdbc.driver.OracleDriver, i.e. more than one driver suited to resolve a jdbc url matching jdbc:oracle:thin:@<host>:<port>:<sid>
Reporter: Robert Saenger
Priority: Critical
org.hibernate.connection.C3P0ConnectionProvider.configure does not effectively pass the jdbcDriverClass driver configuration to C3P0. Unfortunately it is not sufficient to ensure loading of the given class, since C3P0 reads the driver class from property c3p0.driverClass, which is not set by C3P0ConnectionProvider.
If the c3p0.driverClass defaults to null, com.mchange.v2.c3p0.DriverManagerDataSource.driver() delegates the determination of an appropriate driver to java.sql.DriverManager, which attempts to select an appropriate driver from the set of registered JDBC drivers. If more than one appropriate driver has been registered, that understands a given URL it might happen, that not the intended driver is used (although C3P0ConnectionProvider log info message has stated it is being used).
However, even if C3P0ConnectionProvider would accurately pass down the jdbcDriverClass to C3P0, the latest c3p0 (0.9.1.2) would not handle it appropriately.
See also dependent bug http://sourceforge.net/tracker/?func=detail&aid=3357654&group_id=25357&at....
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-6381) using @SecondaryTable with optional=true not handled for joined subclasses (@Inheritance(strategy = InheritanceType.JOINED)
by David Mansfield (JIRA)
using @SecondaryTable with optional=true not handled for joined subclasses (@Inheritance(strategy = InheritanceType.JOINED)
---------------------------------------------------------------------------------------------------------------------------
Key: HHH-6381
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6381
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Beta2, 3.6.5
Environment: linux, jdk 1.6, hibernate latest from master, oracle 11gr2
Reporter: David Mansfield
When using a @SecondaryTable(name="xx), set to optional using @org.hibernate.annotations.Table(name="xx",optional=true) the documentation states that the secondary table row will only be populated if any one of the properties mapped to the secondary table are not-null. However, this does not work with joined subclasses using the JoinedSubclassEntityPersister. This is because, internally, the boolean which controls "outer joinability" (called isNullableTable) always returns false.
A fix has been tested which will be put into a github pull request.
The fix implements isNullableTable to honor the optional flag.
Unfortunately, there is no way I could find to really test whether the code is working, as it requires examining the SQL generated for various operations. However, I have manually verified the fix. Please look at the output of the JoinedSubclassAndSecondaryTable test, which has been modified as well, to verify the DML statements.
Fix available for 3.6.5 upon request. github pull will be for 4.0 (master).
--
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, 6 months
[Hibernate-JIRA] Updated: (HHH-1268) Unidirection OneToMany causes duplicate key entry violation when removing from list
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268?page=c... ]
Gail Badner updated HHH-1268:
-----------------------------
Fix Version/s: (was: 4.0.0.Beta3)
(was: 3.6.6)
> Unidirection OneToMany causes duplicate key entry violation when removing from list
> -----------------------------------------------------------------------------------
>
> Key: HHH-1268
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1, 3.5.6, 3.6.0
> Environment: 3.1 final
> MySql 4.1.14 using MYISAM tables
> Reporter: Rex Madden
> Assignee: Gail Badner
> Fix For: 3.2.x, 3.3.x
>
> Attachments: possible_solution.patch, src.zip
>
>
> Simple OneToMany parent/child relationship using the default table structure (2 tables and a join table)
> Add 3 children to the parent. Flush. Remove the first child. Flush throws error:
> Exception in thread "main" org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
> at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
> at UnidirectionalOneToManyRemoveFromListBug.main(UnidirectionalOneToManyRemoveFromListBug.java:27)
> 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:585)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: java.sql.BatchUpdateException: Duplicate key or integrity constraint violation, message from server: "Duplicate entry '5' for key 2"
> at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1461)
> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
> ... 11 more
> The problem is that there is a unique key on the relationship table that gets violated. The session removes the last row in the relationship table, then attempts to rewrite the child_id's. It fails since there is a uniqueness constraint on that column.
--
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, 6 months