openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Leung (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (OPENJPA-440) Calendar instance doesn't appear to detach properly (or proxying of it is in error?)
Date Tue, 18 Dec 2007 23:42:43 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ted Leung resolved OPENJPA-440.
-------------------------------

    Resolution: Fixed

was resolved by some one else in the 1.1.0 snapshots is no longer a problem.

> Calendar instance doesn't appear to detach properly (or proxying of it is in error?)
> ------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-440
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-440
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.0.0, 1.1.0
>         Environment: fedora 7, java full version "1.6.0_03-b05", Spring 2.0.7, Mysql
5.0.45,  mysql connector 5.0.5
>            Reporter: Ted Leung
>             Fix For: 1.1.0
>
>
> I have an @entity object which has a field 	
>    @Temporal(TemporalType.DATE)
>    private Calendar aquisitionDate = null;
> I can set the Calendar field fine and it persists fine into the database.
> If I start a new transaction and read the object back out of the database, 
> when the transaction is still open everything works fine, I can call 
>    getTimeInMillis() = 1153108800000
>    get(Calendar.YEAR) = 2006
>    get(Calendar.MONTH) 6
>    get(Calendar.DAY_OF_MONTH) = 17
> which is all correct
> After I close the transaction, 
>    getTimeInMillis() = 1153181684943 (why did it change? I didn't change the data)
>    get(Calendar.YEAR) = ERROR 
> <openjpa-1.1.0-SNAPSHOT-r420667:570593 fatal user error> org.apache.openjpa.persistence.InvalidStateException:
The context has been closed.  The stack trace at which the context was closed is available
if Runtime=TRACE logging is enabled.
> 	at org.apache.openjpa.kernel.BrokerImpl.assertOpen(BrokerImpl.java:4291)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginOperation(BrokerImpl.java:1702)
> 	at org.apache.openjpa.kernel.BrokerImpl.isActive(BrokerImpl.java:1672)
> 	at org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1524)
> 	at org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1471)
> 	at org.apache.openjpa.util.Proxies.dirty(Proxies.java:66)
> 	at org.apache.openjpa.util.java$util$GregorianCalendar$proxy.computeFields(Unknown Source)
> 	at java.util.Calendar.complete(Calendar.java:1522)
> 	at java.util.Calendar.get(Calendar.java:1126)
> 	at com.XXXXX.dao.ItemTest.itemTest(ItemTest.java:46)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message