This is very strange but it appears as though Ibatis is crashing my MySql
instance when I use the DATE_FORMAT function in SQL. Please note: it only
crashes when I use a format string that resolves to text like %a
(Abbreviated weekday name) , %b (Abbreviated month name). The problem
doesn’t seem to exist for format strings that return numeric data.
MY SQL:
<statement id="getEmailList" resultClass="com.vc.domain.Email">
SELECT emailTrn.id, DATE_FORMAT(email.entryDate, '%a. %b %D - %h %i %p'
) as entryDateS, FROM email, emailTrn WHERE emailTrn.userId = 1 AND
emailTrn.emailId = email.id
</statement>
MY SET-UP:
MySql: 4.1.21
Java: 1.5.0_08
Ibatis: 2.1.7
Connector/J: 3.1.13
Running using Struts
Please note: I had the same problem when I was using Ibatis 1.x. I upgraded
to see if that resolved the problem.
OTHER INFORMATION
1. My application can hit the database
2. I can hit all of my other SQL statements without problem or errors
messages
3. I’m not sure when this problem started but it does not happen when I run
MySql 4.1.18. Unfortunately not an option with my hosting provider. So I’m
thinking there is a problem with Ibatis and this version of MySql.
Any help or insight would be appreciated. I’d provide my other Ibatis
configuration files but they don’t appear to be the problem. I take the
DATE_FORMAT out and the problem goes away and data is properly returned to
my jsp.
Thanks!
--
View this message in context: http://www.nabble.com/Ibatis-crashing-MySQL-when-I-use-DATE_FORMAT-tf2245286.html#a6227542
Sent from the iBATIS - User - Java forum at Nabble.com.
|