josh...@gmail.com
unread,Dec 3, 2009, 11:23:40 AM12/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Rails SQLServer Adapter
Hi Ken,
For those who may not have seen my post on MetaSkills.net:
------Part 1 -- Nov 30 2009------
Great tutorial. Got almost everything to working using MSSQL 2008,
basic crud works fine, but tried to get active_record session store
going and keep getting the following error:
DBI::DatabaseError: 22001 (8152) [unixODBC][FreeTDS][SQL Server]String
or binary data would be truncated.: INSERT INTO [sessions] ([data],
[created_at], [updated_at], [session_id]) VALUES
('BAh7BjoQX2NzcmZfdG9rZW4iMVhWazJXb2ZOUzZiQTJpVDBXZ2ZuWEdOaTJp
QnRLRnprYnZKbzJiWGpxNzg9 ', '2009-11-30 20:19:31.435', '2009-11-30
20:19:31.435',
'BAh7CDoQX2NzcmZfdG9rZW4iMVB2RCtuaVBtUUxLT3BrVEFtUExkSHphalpRd0xCQ2IxZE9rVDNadThSeTQ9Og9zZXNzaW9uX2lkIiU0ZDM1ZTI1NmU1MjQyMjM3NGZmMjY3MTU5NTFhZjk1NSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==--49244d32c588044567f3458bed477038666bdbc9')
Double checked the fields in the db were the right data type and all
looks good, any ideas what might be going wrong.
--------Part 2 (later that day)
So it will work if I remove the session_id index, but this could be a
problem when the app starts to see high traffic (which it will).
-----------
----From Ken, December 1, 2009
Your issue could be related to the data type. For instance, I
think :text types might be varchar(max) in 2008 and you may need to
force it to another type for the room to store serialized objects.
--------
I tried using different data types including "text" but I would
receive the same error. It was not until I removed the index that the
migration would work (using any of data types: varchar(255) varchar
(max) and text). An associate of mine suggested that perhaps MS SQL
2008 does not support indexing on such large values. I would like to
get the indexing to work to ensure performance is maintain, and cannot
switch to cookies to do the sensitive nature of some of the data (just
record ids but the company I'm working for has high regulatory
requirements and like control).