openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Leung (JIRA)" <>
Subject [jira] Created: (OPENJPA-440) Calendar instance doesn't appear to detach properly (or proxying of it is in error?)
Date Sat, 10 Nov 2007 01:29:50 GMT
Calendar instance doesn't appear to detach properly (or proxying of it is in error?)

                 Key: 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

I have an @entity object which has a field 	

   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(
	at org.apache.openjpa.kernel.BrokerImpl.beginOperation(
	at org.apache.openjpa.kernel.BrokerImpl.isActive(
	at org.apache.openjpa.kernel.StateManagerImpl.dirty(
	at org.apache.openjpa.kernel.StateManagerImpl.dirty(
	at org.apache.openjpa.util.Proxies.dirty(
	at$util$GregorianCalendar$proxy.computeFields(Unknown Source)
	at java.util.Calendar.complete(
	at java.util.Calendar.get(
	at com.XXXXX.dao.ItemTest.itemTest(

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

View raw message