[Hibernate-JIRA] Created: (HHH-2652) character x character varying
by Frederico (JIRA)
character x character varying
-----------------------------
Key: HHH-2652
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2652
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Hibernate 3.2.4.sp1, Postgresql 8.1
Reporter: Frederico
My problem: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2641?page=c...
Solution:
change types of the primary key's to 'character varying'.
hibernate works in different way when the primary key's are character, in my problem this happens:
12:21:43,427 DEBUG CollectionLoadContext:262 - 2 collections were found in result set for role: entidades.bdufop.Sistema.aplicacoes
12:21:43,432 DEBUG CollectionLoadContext:206 - collection fully initialized: [entidades.bdufop.Sistema.aplicacoes#ACESSO] <----
12:21:43,436 DEBUG CollectionLoadContext:206 - collection fully initialized: [entidades.bdufop.Sistema.aplicacoes#ACESSO ] <----
12:21:43,441 DEBUG CollectionLoadContext:272 - 2 collections initialized for role: entidades.bdufop.Sistema.aplicacoes
So, I think that java.lang.String and java.lang.Character are differents, but not to character and to character varying...space placed for the size of character is that it varies or not, so....hibernate would have or not to work with the type (SGDB) to character as it works with character varying?!
I think too....this is not a hibernate user forum topic!
Fred
--
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
17 years, 2 months
[Hibernate-JIRA] Created: (HHH-2731) wrong delete statement for elements in collections with formula properties
by Giorgio Massussi (JIRA)
wrong delete statement for elements in collections with formula properties
--------------------------------------------------------------------------
Key: HHH-2731
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2731
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Hibernate 3.2.4 sp1 with oracle 10
Reporter: Giorgio Massussi
I have mapped a collection of components in a class; the component declares a formula property:
<class name="Master" table="MASTERS">
...
<set name="details" table="DETAILS" cascade="persist,merge,save-update" >
<key>
...
</key>
<composite-element class="Detail">
....
<property name="formula" type="int" >
<formula>1</formula>
</property>
</composite-element>
</set>
</class>
Hibernate generates a delete statement with a wrong where clause on the formula column:
delete from DETAILS where [ .... ] and null = 1
I suspect that the problem is in the constructor of org.hibernate.persister.collection.AbstractCollectionPersister: it calculates correctly the set of columns to use in where clauses, excluding formula and nullable columns, but then this fragment of code forces to keep all columns, including formulas
//workaround, for backward compatibility of sets with no
//not-null columns, assume all columns are used in the
//row locator SQL
if ( !hasNotNullableColumns ) {
Arrays.fill( elementColumnIsInPrimaryKey, true );
}
I suspect that there is the same error is in update statement.
--
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
17 years, 2 months
[Hibernate-JIRA] Created: (HHH-2689) HQL Query using the relationary operator "or"
by Luiz Alberto (JIRA)
HQL Query using the relationary operator "or"
---------------------------------------------
Key: HHH-2689
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2689
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.0.cr4
Environment: ORACLE 9I
HIBERNATE 3.2
Reporter: Luiz Alberto
Priority: Critical
*************
EXAMPLE TABLE "REQUERIMENTO" IN THE DATA BASE
ROWID | ID(PK) | LABO(FK) | GRADUACAO(FK)
---------------------------------------------------------
1 | 110 | 5302332 | NULL
2 | 120 | NULL | 4002993
3 | 130 | NULL | 5321663
4 | 140 | 3698566 | NULL
5 | 150 | 5699636 | NULL
*************
Mapping
RequerimentoVO
.getMatriculaGraduacao() --> GraduacaoVO
.getMatriculaLABO() --> LaboVO
**************
I use one query "HQL". Predicate "OR" is used of the following form.
" FROM RequerimentoVO r "
" where ( r.matriculaGraduacao.id = :codigo or r.matriculaLABO.matricula = :codigo ) "
Which is the problem? It is bug of the Hibernate? Query returns "null"
which and the problem? I am thankful
***************
Exception when:
" FROM RequerimentoVO r "
" where r.matriculaGraduacao.id = :codigo "
it returns a RequerimentoVO
or in such a way
" FROM RequerimentoVO r "
" where r.matriculaLABO.matricula = :codigo = :codigo "
it returns a RequerimentoVO
which and the problem? I am thankful
I am thankful !
--
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
17 years, 2 months
[Hibernate-JIRA] Created: (HHH-2740) SAPDBDialect generates wrong boolean expressions
by Matthias Wuttke (JIRA)
SAPDBDialect generates wrong boolean expressions
------------------------------------------------
Key: HHH-2740
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2740
Project: Hibernate3
Issue Type: Bug
Components: core
Environment: SAP DB 7.6
Reporter: Matthias Wuttke
The following code fragment works for MySQL, but does not for SAP-DB / MaxDB:
bulkUpdate("UPDATE MyObject SET recent = false");
The query Hibernate generates is:
update my_object set recent=0
The MaxDB error is "Constant must be compatible with column type and length". The following query works:
update my_object set recent=false
The same problem applies to SELECT queries generated by Hibernate for use with the SAPDB / MaxDB.
The following class fixes the problem (if you set it as the dialect to use):
public class ExtSAPDBDialect extends SAPDBDialect {
@Override
public String toBooleanValueString(boolean bool) {
return Boolean.toString(bool);
}
}
To fix the bug, I think one should change SAPDBDialect.toBooleanValueString(boolean).
hbm2ddl has some more bugs when using it with MaxDB. eg. using ";" as the statement separator, choosing the wrong column type for Strings longer than 4000 chars (but these bugs are not that bad). ;-)
Best regards
Matthias
--
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
17 years, 2 months
[Hibernate-JIRA] Created: (HHH-2200) Memory leak in AbstractBatcher with Generated Properties
by Jay Paulsen (JIRA)
Memory leak in AbstractBatcher with Generated Properties
--------------------------------------------------------
Key: HHH-2200
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2200
Project: Hibernate3
Type: Bug
Versions: 3.2.0.ga
Environment: Hibernate 3.2.0 GA; Oracle 10g; Java 1.5
Reporter: Jay Paulsen
Using Hibernate 3.2 GA with Entity Manager and Annotations, I have a batch job that inserts several thousands of objects for a class with a @Generated property. The job results in a memory leak in the AbstractBatcher class.
The problem appears to be in the method processGeneratedProperties in AbstractEntityPersister. This method closes the result set for the generated property query and calls session.getBatcher().closeStatement() to close the statement instead of session.getBatcher().closeQueryStatement to close both the statement and the result set. The result is that even though the result set is closed, it is not removed AbstractBatcher's resultSetsToClose HashSet.
Even though the batch job commits and clears the session every 200 rows, over time the leaked result sets in resultSetsToClose results in an OutOfMemory problem.
I've changed the code in AbstractEntityPersister.processGeneratedProperties to call session.getBatcher().closeQueryStatement and the same job then runs to completion without the memory leakage.
I noticed that this method in AbstractEntityPersister has had a recent change to fix a similar problem for issue HHH-1750, so I wanted to verify that this fix is the right approach.
--
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
17 years, 2 months
[Hibernate-JIRA] Created: (HHH-2078) for update on multiple tables does not work or is not present. cascade='lock' does not always work as specified.
by Peter Mutsaers (JIRA)
for update on multiple tables does not work or is not present. cascade='lock' does not always work as specified.
----------------------------------------------------------------------------------------------------------------
Key: HHH-2078
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2078
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: Oracle 9
Reporter: Peter Mutsaers
A normal one to many relationship between two classes, say A and B exists.
We have a cascade='lock' from A to B and also specified fetch='join'.
When I get only an instance of A, hibernate generates a left join between A and B.
When I get the instance while getting a lock, session.get(A.class, id, LockMode.UPGRADE),
I would expect and need an SQL statement along the lines of "select .. from A a left join B b on a.id=b.a_id FOR UPDATE", which would lock both A and its associated B instances.
Instead, hibernate even refuses to execute the join in this case, and fetches A and B with separate queries.
Also whatever I do, I cannot convince hibernate to generate a "for update" query without specifiying a specific table.
For example when A and B have fetch="select" and B is lazily loaded, and I have already retrieved an instance of A, then execute
session.lock(a, id, LockMode.UPGRADE), I would expect that the cascade='lock' would also lock B by either generating the left join over A and B, or by executing both "select ... from A for update" and "select ... from B for update".
Instead, only the first select statement is executed and B is NOT LOCKED at all in spite of the cascade='lock' instruction.
--
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
17 years, 2 months