[Hibernate-JIRA] Commented: (HHH-1639) Add Events to Query methods
by Dominic Bruegger (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1639?page=c... ]
Dominic Bruegger commented on HHH-1639:
---------------------------------------
Are there any plans to implement this feature? We implemented a custom versioning system which is based on database views. Before each query we need to insert the desired snapshot date into a context table. A pre-query event would be the best place to do this.
> Add Events to Query methods
> ---------------------------
>
> Key: HHH-1639
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1639
> Project: Hibernate Core
> Issue Type: New Feature
> Components: core
> Affects Versions: 3.1.3
> Reporter: jose
> Priority: Minor
> Original Estimate: 16h
> Remaining Estimate: 16h
>
> Current event methods capturing some persistence actions (on session actions) but not capturing persistence-searchs actions (on Query object)
>
> I would like adds event architecture to Query, adding listeners to iterate, list, scroll,... methods to allows customizable "pre" and "post" actions over list searchs
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-6486) Negative ID created using Sequences
by Andreas Beckers (JIRA)
Negative ID created using Sequences
-----------------------------------
Key: HHH-6486
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6486
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Beta4, 4.0.0.Beta1
Environment: JBoss 7.0.0.Final with Hibernate 4.0.0.Beta4, Oracle 10 Express
Reporter: Andreas Beckers
We use seperated sequences for each table. Our IDs are annotated like this:
@SequenceGenerator(name = "PersonGen", sequenceName = "person_id_seq")
@Id
@GeneratedValue(generator = "PersonGen")
public long getId() {
return _id;
}
The sequence is defined like this:
CREATE SEQUENCE person_id_seq START WITH 1 INCREMENT BY 1 NOCACHE;
The Problem is, that I get negative IDs in my object and the generated IDs are not unique. I get the error
java.sql.SQLIntegrityConstraintViolationException: ORA-00001: Unique Constraint (VESUVZPONF.PERSON_PKEY) verletzt
In the log I see:
Generated identifier: -21, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
The code worked in JBoss 6.0.0.Final using Hibernate 3.6.0.Final
I tried auto strategy which uses a single sequence that works fine.
There are ManyToOne and OneToMany relations with cascade all, don't know if that's of importance.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-6530) JTATransactio E TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
by Murtuza (JIRA)
JTATransactio E TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-6530
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6530
Project: Hibernate Core
Issue Type: Task
Components: core
Affects Versions: 3.2.4.sp1
Environment: Hibernate Version : 3.2.4.sp1
Database : DB2 9.1
Application Server : WAS 6.0 and WAS7
Reporter: Murtuza
Hi,
While trying to use the JTATransaction object to commit the tranasction and close the session object in the ServiceBean of Session Bean. we get the following error message.
"JTATransactio E TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:"."
The hibernate.cfg.xml file has the appropriate mapping.
<property name="connection.datasource">datasource</property>
<!-- Database Settings -->
<property name="default_schema">Schema</property>
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="show_sql">false</property>
<!-- Transaction Settings -->
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.transaction.auto_close_session">true</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
Any Help would be highly appreciated.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[Hibernate-JIRA] Created: (OGM-63) Remove unused code branches and unnecessary null checks
by Juraci Paixao Krohling (JIRA)
Remove unused code branches and unnecessary null checks
-------------------------------------------------------
Key: OGM-63
URL: http://opensource.atlassian.com/projects/hibernate/browse/OGM-63
Project: Hibernate OGM
Issue Type: Improvement
Components: core
Affects Versions: 3.0.0.Alpha1
Reporter: Juraci Paixao Krohling
Assignee: Juraci Paixao Krohling
Fix For: 3.0-next
I ran the FindBugs code analysis tool and noticed that there are some unnecessary null checks and unused code branches in Hibernate OGM Core module, like the following example from OgmLoader:
{code:title=OgmLoader.java}
//we don't load more than one instance per row, shortcircuiting it for the moment
final int[] collectionOwners = null;
for ( int i=0; i<collectionPersisters.length; i++ ) {
final CollectionAliases[] descriptors = getCollectionAliases();
final boolean hasCollectionOwners = collectionOwners !=null &&
collectionOwners[i] > -1;
//true if this is a query and we are loading multiple instances of the same collection role
//otherwise this is a CollectionInitializer and we are loading up a single collection or batch
final Object owner = hasCollectionOwners ?
row[ collectionOwners[i] ] :
null; //if null, owner will be retrieved from session
final CollectionPersister collectionPersister = collectionPersisters[i];
final Serializable key;
if ( owner == null ) {
key = null;
}
else {
key = collectionPersister.getCollectionType().getKeyOfOwner( owner, session );
//TODO: old version did not require hashmap lookup:
//keys[collectionOwner].getIdentifier()
}
readCollectionElement(
owner,
key,
collectionPersister,
descriptors[i],
resultSet, //TODO CURRENT must use the same instance across all calls
session
);
{code}
Note that {{collectionOwners}} is always {{null}}. Thus, {{hasCollectionOwners}} is always {{false}}, causing {{owner}} to always be {{null}}. Then, the {{if ( owner == null ) }} will always be evaluated as true, turning the else part to be unnecessary. The above code can be rewritten as:
{code:title=OgmLoader.java}
final CollectionAliases[] descriptors = getCollectionAliases(); // this line was inside the for loop... it seems it can be outside
for ( int i=0; i<collectionPersisters.length; i++ ) {
final CollectionPersister collectionPersister = collectionPersisters[i];
readCollectionElement(
null,
null,
collectionPersister,
descriptors[i],
resultSet, //TODO CURRENT must use the same instance across all calls
session
);
}
{code}
This JIRA is to track similar issues to the example above.
--
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, 5 months