简体   繁体   English

为什么尝试设置客户端变量导致coldfusion-out.log中的“字符串或二进制数据将被截断”消息?

[英]Why is attempting to set client variables resulting in “String or binary data would be truncated” messages in coldfusion-out.log?

If I try and set a client variable, by just doing a simple <cfset Client.X = 0 /> in onRequestStart, the request takes over a second (rather than mere milliseconds), and the following is output in coldfusion-out.log : 如果我尝试设置一个客户端变量,只需在onRequestStart中执行一个简单的<cfset Client.X = 0 /> ,请求将花费一秒钟(而不是仅仅几毫秒),并在coldfusion-out.log输出以下内容:

Aug 22, 2013 15:51:54 PM Information [ajp-bio-8012-exec-9] - [Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.
Aug 22, 2013 15:51:55 PM Information [ajp-bio-8012-exec-9] - client variable JDBC STORE - retry 1
Aug 22, 2013 15:51:55 PM Information [ajp-bio-8012-exec-9] - [Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.
Aug 22, 2013 15:51:55 PM Information [ajp-bio-8012-exec-9] - client variable JDBC STORE - retry 2
Aug 22, 2013 15:51:55 PM Information [ajp-bio-8012-exec-9] - [Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.
Aug 22, 2013 15:51:55 PM Information [ajp-bio-8012-exec-9] - client variable JDBC STORE - retry 3
Aug 22, 2013 15:51:55 PM Information [ajp-bio-8012-exec-9] - [Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.
Aug 22, 2013 15:51:55 PM Warning [ajp-bio-8012-exec-9] - Failed to store CLIENT variables to datasource mydsn - [Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.

As per the message, the variable doesn't get stored - but I'm not sure why it thinks anything would be truncated - it's not exactly a lot of data. 根据消息,变量不会被存储 - 但我不确定为什么它会认为任何东西会被截断 - 这并不是很多数据。

I'm pretty sure this has been working fine previously, but I'm not sure when it might have started playing up (I'd been doing work involving remote http requests, so wouldn't have noticed an extra second during that). 我很确定此前它已经运行良好,但我不确定它何时可能已经开始播放(我一直在做涉及远程http请求的工作,因此在此期间不会注意到额外的秒数)。

If I remove the client.x line, it responds immediately and doesn't log the warning. 如果我删除client.x行,它会立即响应并且不会记录警告。

Similarly, if I change the storage mechanism for client variables to either cookie or registry, the issue doesn't occur. 同样,如果我将客户端变量的存储机制更改为cookie或注册表,则不会发生此问题。

I've tried deleting the CDATA and CGLOBAL tables and re-assigning the datasource to let them be recreated, but this hasn't had an effect. 我已经尝试删除CDATA和CGLOBAL表并重新分配数据源以重新创建它们,但这并没有产生影响。

Just as I was about to post the question I figured out what it was, so to help anyone else experiencing the same problem I'll go ahead and answer too... 正如我即将发布问题一样,我弄明白它是什么,所以为了帮助其他遇到同样问题的人,我会继续回答......

The error was referring to the app column. 错误是指app列。

This is created as a char(64), but for this application the name is generated based on a couple of factors which resulted in it ending up as 95 characters long. 这是作为char(64)创建的,但是对于此应用程序,名称是基于几个因素生成的,这些因素最终导致95个字符长。

I edited the column in the database to char(255) and the problem goes away. 我将数据库中的列编辑为char(255),问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM