Docker死亡执行JDBC查询
我正在Docker中运行一个Spring Boot项目,并且正在执行以下JDBC代码:
SqlRowset rowset = jdbcTemplate.queryForRowSet(queryString);
查询字符串如下:
SELECT *
FROM tableName
WHERE timestamp >= '2022-04-03 01:00:00.000000 -0700'
AND timestamp <= '2022-04-13 01:59:59.999999 -0700'
ORDER BY timestamp
LIMIT 2500
OFFSET 0
在通过JDBC执行此查询时,Docker容器死亡和删除。我还有其他疑问可以正常工作,但是由于某种原因,这个日期包括杀死Docker机器。只是想知道是否有人知道为什么会发生这种情况?
在Docker容器中吐出的最后一个日志是:
2022-06-20 19:56:00,985 DEBUG org.springframework.jdbc.core.JdbcTemplate :
Executing SQL query
[SELECT * FROM tableName WHERE timestamp >= '2022-04-03 01:00:00.000000 -0300' AND timestamp <= '2022-04-13 01:59:59.999999 -0300' ORDER BY timestamp LIMIT 2500 OFFSET 0]
I'm running a spring boot project in docker and I'm executing the following JDBC code:
SqlRowset rowset = jdbcTemplate.queryForRowSet(queryString);
The query string is the following:
SELECT *
FROM tableName
WHERE timestamp >= '2022-04-03 01:00:00.000000 -0700'
AND timestamp <= '2022-04-13 01:59:59.999999 -0700'
ORDER BY timestamp
LIMIT 2500
OFFSET 0
While executing this query through JDBC the docker container dies and deletes. I have other queries that work fine but for some reason this one that has dates included kills the docker machine. Just wondering if anyone knows why this would be happening?
The last log that gets spit out in the docker container is:
2022-06-20 19:56:00,985 DEBUG org.springframework.jdbc.core.JdbcTemplate :
Executing SQL query
[SELECT * FROM tableName WHERE timestamp >= '2022-04-03 01:00:00.000000 -0300' AND timestamp <= '2022-04-13 01:59:59.999999 -0300' ORDER BY timestamp LIMIT 2500 OFFSET 0]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我弄清楚了什么问题。我的环境文件中的码头容器没有足够的内存分配。
我遵循链接@EOL提供的指示:
我删除了我们的标签以在故障时卸下Docker容器。
我已经进入容器,并进行了一些调查。我在状态
“ oomkill”中发现了一个失误的错误:“ true”
。这使我得出了一个结论,即记忆未分配到我们需要的大小。I figured out what was wrong. There wasn't enough memory being allocated for the Docker container in my environment file.
I followed the directions in the link @eol provided:
I removed our tag to remove the Docker container on a failure.
I SSH'd into the container and did some investigation. I discovered an out-of-memory error in the status
"OOMKilled": "true"
. This led me to the conclusion that memory wasn't allocated to the size we needed.