您好我有一个Netty Server,其处理程序应该接受字符串.它似乎只接收最多1024个字节的内容.如何增加缓冲区大小.我已经尝试过了
bootstrap.setOption("child.sendBufferSize", 1048576);
bootstrap.setOption("child.receiveBufferSize", 1048576);
Run Code Online (Sandbox Code Playgroud)
没有成功.
处理程序如下
public class TestHandler extends SimpleChannelHandler {
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
ChannelBuffer buf = (ChannelBuffer) e.getMessage();
String response = "";
if (buf.readable()) {
response = buf.toString(CharsetUtil.UTF_8);
System.out.println("CONTENT: " + response);
}
System.out.println(response);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
e.getCause().printStackTrace();
Channel ch = e.getChannel();
ch.close();
}
Run Code Online (Sandbox Code Playgroud)
}
node-oracledb 版本 1.2 node v0.12.7
按预期选择工作。对于更新和插入,虽然我们得到了 rowsAffected: 1,但插入或更新不受影响。
var oracledb = require('oracledb');
oracledb.getConnection(
{
user: "HRTest",
password: "********",
connectString: "localhost/XE"
},
function (err, connection) {
if (err) {
console.error(err.message);
return;
}
connection.execute(
"UPDATE TBCUSTOMERDetails set FIRSTNAME=:fn WHERE id=:id ",
{fn: 'new name', id: 1},
function (err, result) {
if (err) {
console.error(err.message);
return;
}
console.log(result);
connection.release(
function (err) {
if (err) {
console.error(err.message);
throw(err);
}
else console.log("released connection");
}); // end release
}); // end function
});</code></pre>
Run Code Online (Sandbox Code Playgroud)