[Hibernate-JIRA] Created: (HHH-2064) Delete not always executing
by Jasper Rosenberg (JIRA)
Delete not always executing
---------------------------
Key: HHH-2064
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2064
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3, 3.2.0.cr4
Environment: MySQL (latest stable), XP/Linux, hibernate 3.2.0.cr4, Spring 2.0-rc3
Reporter: Jasper Rosenberg
This case I just ran into works in 3.1.3 but fails in 3.2.0 Release Candidates (1-4).
In a single JTA transaction I execute unit test:
personManager.save(firstName, lastName, email, phone, password);
Person person = personManager.get(email); // Not the PK
assertNotNull(person);
personManager.delete(person); // Deletes by PK
person = personManager.get(email); // Not the PK
assertNull(person);
personManager is just a DAO that uses a Spring HibernateTemplate to call save/delete/get on the underlying Session.
In 3.1.3, the final "assertNull(person)" succeeds.
In 3.2-RC4 it fails
Also, if I replace that final get with:
person = personManager.get(person.getId()); // Get by PK
Then the assertion succeeds.
When I turn on logging for org.hibernate.SQL, I can see in 3.2-RC4 the delete is never executed (unlike in 3.1.3). If I had to make a total guess, I would suspect that in 3.2-RC4 the delete it only getting applied to the session cache, and never making it to the database for some reason. Then, since the get(email) is not by primary key, it skips the cache (where it has been removed) and finds it still in the database.
Sorry I am unable to give you a discrete case you can run to reproduce this issue (there are a stupid number of dependencies), but hopefully this case will trigger a lightbulb to go off for the developer who was last working in this portion of the code.
--
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, 7 months
[Hibernate-JIRA] Created: (HHH-2129) Invalid column name SQL Error: 17006, SQLState: null
by sagar patkar (JIRA)
Invalid column name SQL Error: 17006, SQLState: null
----------------------------------------------------
Key: HHH-2129
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2129
Project: Hibernate3
Type: Bug
Components: query-sql
Versions: 3.2.0.cr3
Environment: Hibernate 3.2 cr3 with oracle 9i
Reporter: sagar patkar
Hi,
Is it required that stored procedure must return all the column in the resultset of the mapped class. i was trying to fetch only subset of column & i got the following exception
ERROR [org.hibernate.util.JDBCExceptionReporter] - <Invalid column name>
is it a bug? or is there any alternative solution for this?
Stored procedure
CREATE OR REPLACE PACKAGE BODY Pkg_Test2
IS
PROCEDURE get_my_list(p_record OUT ref_cur ,eventid IN NUMBER)
AS
BEGIN
OPEN p_record FOR
SELECT EVENT_ID, TITLE FROM EVENTS WHERE EVENT_ID=eventid;
END get_my_list;
END Pkg_Test2;
/
mapping file for procedure call
<sql-query name="test_select_sp" callable="true">
<return alias="evaa" class="events.Event">
<return-property name="id" column="EVENT_ID"/>
<return-property name="title" column="TITLE"/>
</return>
{ call pkg_test1.get_selected_list(?,:eventid)}
</sql-query>
--
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, 7 months
[Hibernate-JIRA] Updated: (HHH-1668) PersistentSet write methods mark collection as dirty even if entry is not written
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1668?page=all ]
Steve Ebersole updated HHH-1668:
--------------------------------
Fix Version: 3.2.0.cr5
(was: 3.2.1)
> PersistentSet write methods mark collection as dirty even if entry is not written
> ---------------------------------------------------------------------------------
>
> Key: HHH-1668
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1668
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.3
> Reporter: Koda Janh
> Assignee: Steve Ebersole
> Fix For: 3.2.0.cr5
> Attachments: PersistentList.patch, PersistentSet.patch, hhh-1668.tests.txt
>
> Original Estimate: 5 minutes
> Remaining: 5 minutes
>
> PersistentSet gets marked as dirty even if it hasn't changed. This has negative implications for concurrency because the optimistic-lock version is incremented and StaleObjectStateException is thrown even if the underlying data remains unchanged.
> I stepped through the code and narrowed down the problem to a bug in PersistentSet.add(). A simple fix is to replace:
> if (exists==null) {
> write();
> return set.add(value);
> }
> by:
> if (exists==null) {
> boolean result = set.add(value);
> if (result) {
> write();
> }
> return result;
> }
> I verified that this fixed the problem on my end. The old code was always marking the Set as dirty whereas the new code only does so if it actually has been modified. Please commit this patch.
--
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, 7 months