Error with dataProvider.commit() when Calendar is mapped to smallDateTime

I have a Calendar component binded to smallDateTime field of the database table (SQL Server 2005). I can read the data without any problem. However, if I make any change and commit the changes using dataProvider.commit(), I get this error:

Could not updatethis record: Number of conflictswhile synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0

[sunm][SQLServer JDBC Driver]Unable to determine the type of the specified object.

JSP for Calendar:

<ui:calendar binding="#{users$user_rate_detail.start_date}"

dateFormatPatternHelp="#{ApplicationBean1.emptyString}"

id="start_date" maxDate="#{ApplicationBean1.maxDate}"

minDate="#{ApplicationBean1.minDate}"

readOnly="#{!users$user_rate_detail.beingEdited}" required="true"

selectedDate="#{SessionBean1.dp_user_rate_detail.value['user_rate_sdate']}"/>

Code for saving changes:

public String btnSave_action(){

try{

try{

getSessionBean1().getDp_user_rate_detail().commitChanges();

info("Record updated");

}catch (Exception ex){

info("Could not update this record: "+ex.getMessage());

log("user_rate_detail.btnSave_action: Could not update this record", ex);

}

returnnull;

}

[1994 byte] By [Sabir] at [2007-11-26 11:17:06]
# 1

I finally resolved it by adding the following code is my Save button action handler. Is there any better way to do this?

java.sql.Timestamp endTime=new java.sql.Timestamp(getEnd_date().getSelectedDate().getTime());

java.sql.Timestamp startTime=new java.sql.Timestamp(getStart_date().getSelectedDate().getTime());

getSessionBean1().getDp_user_rate_detail().setValue("user_rate_sdate", endTime);

getSessionBean1().getDp_user_rate_detail().setValue("user_rate_edate", startTime);

getSessionBean1().getDp_user_rate_detail().commitChanges();

Sabir at 2007-7-7 3:32:16 > top of Java-index,Development Tools,Java Tools...