This project is read-only.
1
Vote

Importing of users causes error when LastActivityDate is NULL

description

I get this error when importing.
 
Error migrating user mdrew:
Insert of '716323563-9a30712d-ed9d-40e1-aea7-d0eec1ac9b8a' failed: Telerik.OpenAccess.RT.sql.SQLException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
INSERT INTO [sf_users] ([app_name], [commnt], [creation_date], [email], [fld_psswrd_nswer_attempt_count], [fld_psswrd_nswr_ttmpt_wndw_str], [failed_password_attempt_count], [fld_psswrd_ttempt_window_start], [first_name], [id], [is_approved], [is_backend_user], [is_locked_out], [is_logged_in], [last_activity_date], [last_lockout_date], [last_login_date], [last_login_ip], [last_modified], [last_name], [last_password_changed_date], [manager_info], [passwd], [password_answer], [password_format], [password_question], [salt], [user_name]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
(set event logging to all to see parameter values) Telerik.OpenAccess.RT.sql.SQLException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
at DynamicModule.ns.Wrapped_OpenAccessMembershipProvider_91e4f9fe040e4ecfbbd569b5f108d061.CommitTransaction()
at Telerik.Sitefinity.Data.ManagerBase`1.SaveChanges()
at Migration.Classes.MigrationUsers.ImportUser(MigrationUser userContent) in \SitefinityMigration\Classes\MigrationUsers.cs:line 102
at Migration.MigrationModule.ImportUsers() in \SitefinityMigration\MigrationModule.cs:line 459
 
When I debug I have traced the problem all the way back to the Membership Provider in the old Sitefinity project, basically instead of returning LastActvityDate as 01/01/0001 00:00 it returns it as 01/01/0001 08:00, which is DateTime.MinValue plus my GMT offset. LastActvityDate is NULL in the database. The only way I could work around this was on that side to convert the time to Universal Time in the MigrationExportUsers class. By the way the catches in the same class our also incorrect...

comments