如何读取Apache Derby数据库日志? [英] How to read Apache Derby database log?

查看:824
本文介绍了如何读取Apache Derby数据库日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想看看Derby的数据库日志;我不是指derby.log文件,我在谈论 / [database name] / log 目录中的二进制日志文件。是否有可以用人类可读格式显示它们的工具?

I'd like to have a peek at Derby's database log; I don't mean the derby.log file, I'm talking about the binary log files in the /[database name]/log directory. Is there a tool that can display them in a human-readable format?

我的原因是我使用Apache Derby(版本10.6.1.0)自动集成测试,在Maven Failsafe插件的帮助下。一些测试执行锁定记录的事务代码(OpenJPA用作ORM工具)。有时,对于测试的某种顺序,发生的是,测试永远等待锁,导致构建挂起。同样的测试,当单独运行时,通过。所有陌生人的事情是每个测试在运行之前删除,创建和填充所有表,所以很难看到这个行为的明显原因。

My reason for asking is that I'm using Apache Derby (version 10.6.1.0) for automatic integration tests, with the help of Maven Failsafe plug-in. Some tests execute transactional code that locks records (OpenJPA is used as an ORM tool). Sometimes, with a certain ordering of tests, it happens that a test waits forever for a lock, causing the build to hang. The same test, when run separately, passes. All the stranger thing is that every test drops, creates and fills all tables before it runs, so it's hard to see obvious reasons for this behaviour.

通过将失败的测试放在单独的Failsafe执行中来解决问题;

The problem has been worked around by putting the failing tests in a separate Failsafe execution; still, I'd like to read the log to see what's going on.

推荐答案

确实存在这样的工具,但他们'重新相当低级。这里是您可以找到的地方: https://issues.apache.org/jira/browse / DERBY-5195

There do exist such tools, but they're quite low-level. Here's a place you can find them: https://issues.apache.org/jira/browse/DERBY-5195

诊断锁定问题是非常具有挑战性的;希望阅读日志将给你一些线索。日志只包含有关更新活动的信息,因此您需要使用其他方式推断读取活动。

Diagnosing locking problems such as these is very challenging; hopefully reading the logs will give you some clues. The logs will only contain information about update activity, so you will need to infer read activity using other means.

你可能会尝试的另一件事是看看你是否可以扩展你的测试过程包括调用lock_table数据(http://db.apache.org/derby/docs/10.8/devguide/cdevconcepts50894.html)。

Another thing you might try is to see if you can augment your testing process to include invocations of the lock_table data (http://db.apache.org/derby/docs/10.8/devguide/cdevconcepts50894.html).

可能:(a)您的ORM工具运行的代码比您认为运行的更多/不同,或者(b)您的ORM工具没有按照您的想法它是。

Probably either: (a) your ORM tool is running more/different code than you think it's running, or (b) your ORM tool is not expressing the transaction boundaries the way you think it is.

最好的运气!

这篇关于如何读取Apache Derby数据库日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆