-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: mysql, java, hibernate date issue
PostPosted: Thu Nov 11, 2004 12:56 am 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
I am not sure if anyone in this forum will be able to help or not, but here goes.

I created an application that uses a MySQL database, JSTL (EL), Struts and Hibernate. I have several fields that require dates to be input into the database. Java uses a 0 based date system (Jan-Dec = 0-11) and MySQL uses a 1 based date system (Jan-Dec = 1-12).

(Date format is M/d/yyyy)

The problem comes in when I try to get the date using hibernate in combination with JSTL. If I enter 1/1/2004 and submit the jsp, the following date is actually inserted into the database: 2/1/2004. The month is off by 1. Then when I retrieve the object and pull out the date it is incorrect (2/1/2004).

Decrementing the date before entering it into the database doesn't work either because it won't recognize 0 in mysql.

Is there anyway I can get Hibernate to increment the month by 1 as it is pulling it from the database?

One fix for this issue would be to pass the list of objects to a method that iterates the list, pulls out each object, gets the date from the object and increments the month by one. This would create performance reduction and would defeat the purpose of using hibernate and JSTL.

I am usging the following code to store and retrieve my objects to/from the database:

public void makePersistent(Transcript transcript)
throws InfrastructureException
{

try
{
HibernateUtil.getSession().saveOrUpdate(transcript);
} catch (HibernateException ex)
{
throw new InfrastructureException(ex);
}
}

public Collection findAllTranscripts()
throws InfrastructureException
{

Collection transcripts;
try
{
transcripts = HibernateUtil.getSession().createCriteria(Transcript.class).list();
} catch (HibernateException ex)
{
throw new InfrastructureException(ex);
}
return transcripts;
}


After calling the findAllTranscripts method I pass my list to a jsp and extract the data from the beans contained in the collection with JSTL and EL.

<c:forEach var="transcript" value="${sessionScope.transcriptList.transcript}">
<c:out value="transcript.mydate"/>
</c:forEach>

Does anyone have any suggestions on how to handle this issue?


Thanks!!!!!!!! :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 5:33 pm 
Newbie

Joined: Thu Nov 11, 2004 2:37 pm
Posts: 3
It looks like we have the same problem using Oracle with the latest ojdbc14.jar

Hibernate version: 2.1.6
Oracle 8i

I tried with a java.sql.Date, java.util.Date and a java.util.Timestamp mapped to a sql-type=DATE

Code:
<property name="date" type="java.sql.Date">
   <column name="EVEN_DATE" sql-type="DATE"/>
</property>


The column EVEN_DATE is a DATE type in the Oracle db.


When i save my object using session.save(myObject);

My date is off by one.
exemple: If I save 2004-04-11 ('YYYY-MM-DD') then 2004-03-11 will be saved in the database.

This problem doesn't appear when loading the object. The correct date showed in the database is affected to the object.


Any help would be appreciated. I searched a lot on this forum and didn't find anything to help. I also searched through google without any good result either.

Thank you


Top
 Profile  
 
 Post subject: Calendar
PostPosted: Fri Nov 12, 2004 11:31 am 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
I tried using a Calendar object as well. The same issue occurs.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 12:36 pm 
Newbie

Joined: Thu Nov 11, 2004 2:37 pm
Posts: 3
Since we can't find answer to our problem, perhaps this could help...

has anyone used date successfully with hibernate 2.1.6 and oracle,(or MySQL)?

If so, which was your column type and java type used? Providing a mapping could also help.


Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 12:39 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Turn on debug logging (Hibernate core and bind parameters) in your log4j.properties and check whats really going on.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 1:36 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
dyonn wrote:
Since we can't find answer to our problem, perhaps this could help...

has anyone used date successfully with hibernate 2.1.6 and oracle,(or MySQL)?

If so, which was your column type and java type used? Providing a mapping could also help.


Thank you!


i have used hibernate 2.1.6 with MySQL and i use java.sql.Timestamp and then convert it to date in struts for display using the formatKey in the bean tag. i am sure there is a JSTL equivalent for it as well. i have never had issues using java.sql.Timestamp with either MySQL or SAPDB.


Top
 Profile  
 
 Post subject: log file results
PostPosted: Mon Nov 15, 2004 2:51 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
Ok, I ran the debugger and checked the output. It appears to me hibernate is incrementing the month by one before it executes the transaction. Also, if I look in the database it contains the incremented date.

For oppEstAwardDate I entered the following date:
01/10/2005 01:00 AM
Also, for all the dates with a month of 10 I actually entered 9.


---------------------------- FULL LOG BELOW ------------------------------------

13:46:14,300 DEBUG SessionImpl:555 - opened session
13:46:14,300 DEBUG JDBCTransaction:37 - begin
13:46:14,310 DEBUG DriverManagerConnectionProvider:84 - total checked-out connections: 1
13:46:14,310 DEBUG DriverManagerConnectionProvider:90 - using pooled JDBC connection, pool size: 0
13:46:14,320 DEBUG JDBCTransaction:41 - current autocommit status:false
13:46:14,320 DEBUG SessionImpl:1982 - loading [com.eds.opportunity.model.FinancialAnalyst#2]
13:46:14,330 DEBUG SessionImpl:2079 - attempting to resolve [com.eds.opportunity.model.FinancialAnalyst#2]
13:46:14,330 DEBUG SessionImpl:2112 - object not resolved in any cache [com.eds.opportunity.model.FinancialAnalyst#2]
13:46:14,330 DEBUG NormalizedEntityPersister:401 - Materializing entity: [com.eds.opportunity.model.FinancialAnalyst#2]
13:46:14,330 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
13:46:14,330 DEBUG SQL:237 - select financiala0_.FINANCIAL_ANALYST_ID as ID0_, financiala0__1_.LAST_NAME as LAST_NAME0_0_, financiala0__1_.FIRST_NAME as FIRST_NAME0_0_, financiala0__1_.STREET as STREET0_0_, financiala0__1_.CITY as CITY0_0_, financiala0__1_.STATE as STATE0_0_, financiala0__1_.ZIP as ZIP0_0_, financiala0__1_.PHONE as PHONE0_0_, financiala0__1_.EMAIL as EMAIL0_0_, financiala0__1_.BUILDING as BUILDING0_0_, financiala0__1_.FLOOR as FLOOR0_0_, financiala0__1_.SUITE as SUITE0_0_ from FINANCIAL_ANALYST financiala0_ inner join PERSON financiala0__1_ on financiala0_.FINANCIAL_ANALYST_ID=financiala0__1_.ID where financiala0_.FINANCIAL_ANALYST_ID=?
13:46:14,440 DEBUG BatcherImpl:241 - preparing statement
13:46:14,440 DEBUG LongType:46 - binding '2' to parameter: 1
13:46:14,450 DEBUG Loader:197 - processing result set
13:46:14,450 DEBUG Loader:405 - result row: 2
13:46:14,450 DEBUG Loader:536 - Initializing object from ResultSet: 2
13:46:14,450 DEBUG Loader:605 - Hydrating entity: com.eds.opportunity.model.FinancialAnalyst#2
13:46:14,460 DEBUG StringType:68 - returning 'simpson' as column: LAST_NAME0_0_
13:46:14,460 DEBUG StringType:68 - returning 'homer' as column: FIRST_NAME0_0_
13:46:14,540 DEBUG StringType:68 - returning '7890 marge lane' as column: STREET0_0_
13:46:14,540 DEBUG StringType:68 - returning 'fairfax' as column: CITY0_0_
13:46:14,540 DEBUG StringType:68 - returning 'va' as column: STATE0_0_
13:46:14,540 DEBUG StringType:68 - returning '22033' as column: ZIP0_0_
13:46:14,550 DEBUG StringType:68 - returning '703-352-1234' as column: PHONE0_0_
13:46:14,550 DEBUG StringType:68 - returning 'nobody@nowhere.com' as column: EMAIL0_0_
13:46:14,560 DEBUG StringType:68 - returning 'administration' as column: BUILDING0_0_
13:46:14,560 DEBUG StringType:68 - returning '6' as column: FLOOR0_0_
13:46:14,560 DEBUG StringType:68 - returning '12345' as column: SUITE0_0_
13:46:14,560 DEBUG Loader:226 - done processing result set (1 rows)
13:46:14,570 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:46:14,661 DEBUG BatcherImpl:261 - closing statement
13:46:14,661 DEBUG Loader:239 - total objects hydrated: 1
13:46:14,661 DEBUG SessionImpl:2198 - resolving associations for [com.eds.opportunity.model.FinancialAnalyst#2]
13:46:14,661 DEBUG SessionImpl:2222 - done materializing entity [com.eds.opportunity.model.FinancialAnalyst#2]
13:46:14,661 DEBUG SessionImpl:3112 - initializing non-lazy collections
13:46:14,761 DEBUG SessionImpl:1982 - loading [com.eds.opportunity.model.ContractSupport#4]
13:46:14,761 DEBUG SessionImpl:2079 - attempting to resolve [com.eds.opportunity.model.ContractSupport#4]
13:46:14,761 DEBUG SessionImpl:2112 - object not resolved in any cache [com.eds.opportunity.model.ContractSupport#4]
13:46:14,761 DEBUG NormalizedEntityPersister:401 - Materializing entity: [com.eds.opportunity.model.ContractSupport#4]
13:46:14,761 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
13:46:14,761 DEBUG SQL:237 - select contractsu0_.CONTRACT_SUPPORT_ID as ID0_, contractsu0__1_.LAST_NAME as LAST_NAME0_0_, contractsu0__1_.FIRST_NAME as FIRST_NAME0_0_, contractsu0__1_.STREET as STREET0_0_, contractsu0__1_.CITY as CITY0_0_, contractsu0__1_.STATE as STATE0_0_, contractsu0__1_.ZIP as ZIP0_0_, contractsu0__1_.PHONE as PHONE0_0_, contractsu0__1_.EMAIL as EMAIL0_0_, contractsu0__1_.BUILDING as BUILDING0_0_, contractsu0__1_.FLOOR as FLOOR0_0_, contractsu0__1_.SUITE as SUITE0_0_ from CONTRACT_SUPPORT contractsu0_ inner join PERSON contractsu0__1_ on contractsu0_.CONTRACT_SUPPORT_ID=contractsu0__1_.ID where contractsu0_.CONTRACT_SUPPORT_ID=?
13:46:14,771 DEBUG BatcherImpl:241 - preparing statement
13:46:14,771 DEBUG LongType:46 - binding '4' to parameter: 1
13:46:14,781 DEBUG Loader:197 - processing result set
13:46:14,781 DEBUG Loader:405 - result row: 4
13:46:14,791 DEBUG Loader:536 - Initializing object from ResultSet: 4
13:46:14,791 DEBUG Loader:605 - Hydrating entity: com.eds.opportunity.model.ContractSupport#4
13:46:14,871 DEBUG StringType:68 - returning 'idle' as column: LAST_NAME0_0_
13:46:14,871 DEBUG StringType:68 - returning 'billy' as column: FIRST_NAME0_0_
13:46:14,871 DEBUG StringType:68 - returning '3456 connies corner' as column: STREET0_0_
13:46:14,871 DEBUG StringType:68 - returning 'fairfax' as column: CITY0_0_
13:46:14,871 DEBUG StringType:68 - returning 'va' as column: STATE0_0_
13:46:14,881 DEBUG StringType:68 - returning '22033' as column: ZIP0_0_
13:46:14,881 DEBUG StringType:68 - returning '703-789-1234' as column: PHONE0_0_
13:46:14,891 DEBUG StringType:68 - returning 'billy@kmart.com' as column: EMAIL0_0_
13:46:14,891 DEBUG StringType:68 - returning 'administration' as column: BUILDING0_0_
13:46:14,891 DEBUG StringType:68 - returning '7' as column: FLOOR0_0_
13:46:14,981 DEBUG StringType:68 - returning '67654' as column: SUITE0_0_
13:46:14,981 DEBUG Loader:226 - done processing result set (1 rows)
13:46:14,981 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:46:14,981 DEBUG BatcherImpl:261 - closing statement
13:46:14,991 DEBUG Loader:239 - total objects hydrated: 1
13:46:14,991 DEBUG SessionImpl:2198 - resolving associations for [com.eds.opportunity.model.ContractSupport#4]
13:46:15,081 DEBUG SessionImpl:2222 - done materializing entity [com.eds.opportunity.model.ContractSupport#4]
13:46:15,081 DEBUG SessionImpl:3112 - initializing non-lazy collections
13:46:15,081 DEBUG SessionImpl:1982 - loading [com.eds.opportunity.model.DeliveryLead#3]
13:46:15,091 DEBUG SessionImpl:2079 - attempting to resolve [com.eds.opportunity.model.DeliveryLead#3]
13:46:15,091 DEBUG SessionImpl:2112 - object not resolved in any cache [com.eds.opportunity.model.DeliveryLead#3]
13:46:15,091 DEBUG NormalizedEntityPersister:401 - Materializing entity: [com.eds.opportunity.model.DeliveryLead#3]
13:46:15,091 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
13:46:15,091 DEBUG SQL:237 - select deliveryle0_.DELIVERLY_LEAD_ID as ID0_, deliveryle0__1_.LAST_NAME as LAST_NAME0_0_, deliveryle0__1_.FIRST_NAME as FIRST_NAME0_0_, deliveryle0__1_.STREET as STREET0_0_, deliveryle0__1_.CITY as CITY0_0_, deliveryle0__1_.STATE as STATE0_0_, deliveryle0__1_.ZIP as ZIP0_0_, deliveryle0__1_.PHONE as PHONE0_0_, deliveryle0__1_.EMAIL as EMAIL0_0_, deliveryle0__1_.BUILDING as BUILDING0_0_, deliveryle0__1_.FLOOR as FLOOR0_0_, deliveryle0__1_.SUITE as SUITE0_0_ from DELIVERY_LEAD deliveryle0_ inner join PERSON deliveryle0__1_ on deliveryle0_.DELIVERLY_LEAD_ID=deliveryle0__1_.ID where deliveryle0_.DELIVERLY_LEAD_ID=?
13:46:15,101 DEBUG BatcherImpl:241 - preparing statement
13:46:15,111 DEBUG LongType:46 - binding '3' to parameter: 1
13:46:15,121 DEBUG Loader:197 - processing result set
13:46:15,121 DEBUG Loader:405 - result row: 3
13:46:15,131 DEBUG Loader:536 - Initializing object from ResultSet: 3
13:46:15,131 DEBUG Loader:605 - Hydrating entity: com.eds.opportunity.model.DeliveryLead#3
13:46:15,201 DEBUG StringType:68 - returning 'carson' as column: LAST_NAME0_0_
13:46:15,201 DEBUG StringType:68 - returning 'jonny' as column: FIRST_NAME0_0_
13:46:15,201 DEBUG StringType:68 - returning '12876 dove street' as column: STREET0_0_
13:46:15,201 DEBUG StringType:68 - returning 'fairfax' as column: CITY0_0_
13:46:15,201 DEBUG StringType:68 - returning 'va' as column: STATE0_0_
13:46:15,211 DEBUG StringType:68 - returning '22033' as column: ZIP0_0_
13:46:15,211 DEBUG StringType:68 - returning '703-352-5678' as column: PHONE0_0_
13:46:15,221 DEBUG StringType:68 - returning 'jonny@carson.com' as column: EMAIL0_0_
13:46:15,221 DEBUG StringType:68 - returning 'administration' as column: BUILDING0_0_
13:46:15,221 DEBUG StringType:68 - returning '5' as column: FLOOR0_0_
13:46:15,312 DEBUG StringType:68 - returning '980876' as column: SUITE0_0_
13:46:15,312 DEBUG Loader:226 - done processing result set (1 rows)
13:46:15,312 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:46:15,312 DEBUG BatcherImpl:261 - closing statement
13:46:15,312 DEBUG Loader:239 - total objects hydrated: 1
13:46:15,322 DEBUG SessionImpl:2198 - resolving associations for [com.eds.opportunity.model.DeliveryLead#3]
13:46:15,322 DEBUG SessionImpl:2222 - done materializing entity [com.eds.opportunity.model.DeliveryLead#3]
13:46:15,332 DEBUG SessionImpl:3112 - initializing non-lazy collections
13:46:15,332 DEBUG Cascades:341 - id unsaved-value strategy NULL
13:46:15,332 DEBUG SessionImpl:1391 - saveOrUpdate() previously saved instance with id: 1
13:46:15,332 DEBUG SessionImpl:1439 - updating [com.eds.opportunity.model.Opportunity#1]
13:46:15,532 DEBUG Cascades:497 - processing cascades for: com.eds.opportunity.model.Opportunity
13:46:15,532 DEBUG Cascades:113 - cascading to saveOrUpdate()
13:46:15,532 DEBUG SessionImpl:1371 - saveOrUpdate() persistent instance
13:46:15,532 DEBUG Cascades:113 - cascading to saveOrUpdate()
13:46:15,542 DEBUG SessionImpl:1371 - saveOrUpdate() persistent instance
13:46:15,542 DEBUG Cascades:113 - cascading to saveOrUpdate()
13:46:15,622 DEBUG SessionImpl:1371 - saveOrUpdate() persistent instance
13:46:15,622 DEBUG Cascades:506 - done processing cascades for: com.eds.opportunity.model.Opportunity
13:46:15,622 DEBUG JDBCTransaction:59 - commit
13:46:15,622 DEBUG SessionImpl:2242 - flushing session
13:46:15,622 DEBUG Cascades:497 - processing cascades for: com.eds.opportunity.model.Opportunity
13:46:15,632 DEBUG Cascades:113 - cascading to saveOrUpdate()
13:46:15,632 DEBUG SessionImpl:1371 - saveOrUpdate() persistent instance
13:46:15,632 DEBUG Cascades:113 - cascading to saveOrUpdate()
13:46:15,642 DEBUG SessionImpl:1371 - saveOrUpdate() persistent instance
13:46:15,642 DEBUG Cascades:113 - cascading to saveOrUpdate()
13:46:15,642 DEBUG SessionImpl:1371 - saveOrUpdate() persistent instance
13:46:15,642 DEBUG Cascades:506 - done processing cascades for: com.eds.opportunity.model.Opportunity
13:46:15,652 DEBUG SessionImpl:2435 - Flushing entities and processing referenced collections
13:46:15,652 DEBUG SessionImpl:2529 - Updating entity: [com.eds.opportunity.model.Opportunity#1]
13:46:15,652 DEBUG SessionImpl:2776 - Processing unreferenced collections
13:46:15,662 DEBUG SessionImpl:2790 - Scheduling collection removes/(re)creates/updates
13:46:15,662 DEBUG SessionImpl:2266 - Flushed: 0 insertions, 1 updates, 0 deletions to 4 objects
13:46:15,752 DEBUG SessionImpl:2271 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
13:46:15,752 DEBUG Printer:75 - listing entities:
13:46:15,752 DEBUG Printer:82 - com.eds.opportunity.model.Opportunity{oppId=123456, oppClient=kmart, oppEstAwardDate=10 February 2005 01:00:15, oppPerformaComplete=to be completed, deliveryLead=DeliveryLead#3, oppTcv=11894567, oppPhase=tbd, oppActualAwardDate=17 October 2004 00:54:15, oppRole=tbd, oppBAndP=yes, oppRfiDueDate=09 October 2004 00:54:15, contractSupport=ContractSupport#4, id=1, oppNewOrExisting=tbd, financialAnalyst=FinancialAnalyst#2, oppProposalDueDate=17 October 2004 00:54:15, oppRiskModule=to be completed, oppRfpDate=17 October 2004 00:54:15, oppName=hris, oppCyr=2145, oppWinProbability=75, oppComments=some comments go here}
13:46:15,852 DEBUG Printer:82 - com.eds.opportunity.model.FinancialAnalyst{phone=703-352-1234, suite=12345, building=administration, street=7890 marge lane, email=nobody@nowhere.com, state=va, floor=6, zip=22033, city=fairfax, firstName=homer, id=2, lastName=simpson}
13:46:15,852 DEBUG Printer:82 - com.eds.opportunity.model.ContractSupport{phone=703-789-1234, suite=67654, building=administration, street=3456 connies corner, email=billy@kmart.com, state=va, floor=7, zip=22033, city=fairfax, firstName=billy, id=4, lastName=idle}
13:46:15,953 DEBUG Printer:82 - com.eds.opportunity.model.DeliveryLead{phone=703-352-5678, suite=980876, building=administration, street=12876 dove street, email=jonny@carson.com, state=va, floor=5, zip=22033, city=fairfax, firstName=jonny, id=3, lastName=carson}
13:46:15,953 DEBUG SessionImpl:2355 - executing flush
13:46:15,953 DEBUG EntityPersister:648 - Updating entity: [com.eds.opportunity.model.Opportunity#1]
13:46:15,953 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
13:46:15,953 DEBUG SQL:237 - update Opportunity set CONTRACT_SUPPORT_ID=?, FINANCIAL_ANALYST_ID=?, DELIVERY_LEAD_ID=?, OPP_ID=?, OPP_NAME=?, OPP_CLIENT=?, OPP_TCV=?, OPP_CYR=?, OPP_PHASE=?, OPP_WIN_PROBABILITY=?, OPP_EST_AWARD_DATE=?, OPP_COMMENTS=?, OPP_RFI_DUE_DATE=?, OPP_RFP_DATE=?, OPP_B_AND_P=?, OPP_PERFORMA_COMPLETE=?, OPP_RISK_MODULE=?, OPP_PROPOSAL_DUE_DATE=?, OPP_ACTUAL_AWARD_DATE=?, OPP_ROLE=?, OPP_NEW_OR_EXISTING=? where ID=?
13:46:15,963 DEBUG BatcherImpl:241 - preparing statement
13:46:15,963 DEBUG EntityPersister:388 - Dehydrating entity: [com.eds.opportunity.model.Opportunity#1]
13:46:15,963 DEBUG LongType:46 - binding '4' to parameter: 1
13:46:15,973 DEBUG LongType:46 - binding '2' to parameter: 2
13:46:15,973 DEBUG LongType:46 - binding '3' to parameter: 3
13:46:15,973 DEBUG LongType:46 - binding '123456' to parameter: 4
13:46:15,973 DEBUG StringType:46 - binding 'hris' to parameter: 5
13:46:15,993 DEBUG StringType:46 - binding 'kmart' to parameter: 6
13:46:15,993 DEBUG LongType:46 - binding '11894567' to parameter: 7
13:46:15,993 DEBUG LongType:46 - binding '2145' to parameter: 8
13:46:15,993 DEBUG StringType:46 - binding 'tbd' to parameter: 9
13:46:15,993 DEBUG IntegerType:46 - binding '75' to parameter: 10
13:46:16,003 DEBUG CalendarType:46 - binding '10 February 2005 01:00:15' to parameter: 11
13:46:16,083 DEBUG StringType:46 - binding 'some comments go here' to parameter: 12
13:46:16,083 DEBUG CalendarType:46 - binding '09 October 2004 00:54:15' to parameter: 13
13:46:16,083 DEBUG CalendarType:46 - binding '17 October 2004 00:54:15' to parameter: 14
13:46:16,093 DEBUG StringType:46 - binding 'yes' to parameter: 15
13:46:16,093 DEBUG StringType:46 - binding 'to be completed' to parameter: 16
13:46:16,103 DEBUG StringType:46 - binding 'to be completed' to parameter: 17
13:46:16,103 DEBUG CalendarType:46 - binding '17 October 2004 00:54:15' to parameter: 18
13:46:16,103 DEBUG CalendarType:46 - binding '17 October 2004 00:54:15' to parameter: 19
13:46:16,113 DEBUG StringType:46 - binding 'tbd' to parameter: 20
13:46:16,113 DEBUG StringType:46 - binding 'tbd' to parameter: 21
13:46:16,203 DEBUG LongType:46 - binding '1' to parameter: 22
13:46:16,203 DEBUG BatcherImpl:28 - Adding to batch
13:46:16,203 DEBUG BatcherImpl:50 - Executing batch size: 1
13:46:16,213 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:46:16,213 DEBUG BatcherImpl:261 - closing statement
13:46:16,213 DEBUG SessionImpl:2820 - post flush
13:46:16,303 DEBUG SessionImpl:585 - transaction completion
13:46:16,303 DEBUG SessionImpl:573 - closing session
13:46:16,303 DEBUG SessionImpl:3332 - disconnecting session
13:46:16,313 DEBUG DriverManagerConnectionProvider:120 - returning connection to pool, pool size: 1
13:46:16,313 DEBUG SessionImpl:585 - transaction completion


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 2:55 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Uhm, someone has a broken routine for month and java.util.*, the month is zero based in Java APIs. I'm sure its not Hibernate that does this.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: log file results
PostPosted: Mon Nov 15, 2004 3:16 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
Cool, that's what I was hoping. I pull the date from the request and put it in a calendar object. It must be in there somewhere. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 3:53 pm 
Newbie

Joined: Thu Nov 11, 2004 2:37 pm
Posts: 3
Christian is right...

Sorry about it. Haven't played much with dates..


Top
 Profile  
 
 Post subject: fixed
PostPosted: Mon Nov 15, 2004 4:13 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
Yeah, I haven't messed with dates much either. I was able to figure out the problem. The calendar used to select dates had 31 days for every month. If 31 was selected for a month that doesn't have 31 days in it the date rolls into the next month.
It just so happens the default date set was 31 Sept for some strange reason. This is why it was still messed up when I subtracted 1 from the month before putting it in the calendar and passing it to Hibernate.

Thanks!!!! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.