TEIID 中的大 Blob 插入/更新

问题描述

我正在尝试插入一个大 blob,插入时的转换器实现在 DB 中写入一行并将 blob 内容保存在一个文件中。

问题是当我想插入大量数据时,我想通过 JDBC 客户端流式传输数据,以便在我的客户端上不会填满内存,并且数据会流向服务器(翻译器)

>

为此,我想出了一个发送 Blob 引用的解决方案,但似乎只支持读取 Blob 引用,以下部分来自一些 TEIID older version documentation

“但是,JDBC API 当前不会在插入或更新时流式传输大对象。因此,Teiid JDBC API 将读取所有数据并将其以单个物化值的形式传回连接器。”

latest version documentation 中我找不到类似的声明

我的问题是插入时是否支持流式传输?

我将感谢您提供任何其他解决方案来处理用于插入/更新的大型 blob

以下是我的更新代码

    PipedInputStream inStream  = new PipedInputStream(1024);
    PipedOutputStream outStream = new PipedOutputStream(inStream);
    try (PreparedStatement pStmtUpdate = conn.prepareStatement(
            "update Entity set data = ? where id = ?")) {
        pStmtUpdate.setBinaryStream(1,inStream);
        pStmtUpdate.setString(2,id);
        
        DataWriteWorker writeWorker = new DataWriteWorker(outStream,true);
        writeWorker.start();
        
        
        //I am using a separate thread to write data,//my main thread keeps on waiting at executeUpdate uptil the entire writing to output has fininshed using the thread above
        pStmtUpdate.executeUpdate();


    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...