更改BTM tlog文件位置

时间:2016-02-25 09:52:26

标签: java jta bitronix

我们正在使用org.codehaus.btm:btm:2.1.4进行测试,我们看到这些文件出现在我们的maven模块目录(工作目录)中:

  • btm1.tlog
  • btm2.tlog

我希望在另一个目录中创建它们,例如在target/btmlogs/中。如何配置BTM来做到这一点?

1 个答案:

答案 0 :(得分:2)

您必须配置TransactionManager。 Relevant part of the configuration

在名为src/main/resources/bitronix-default-config.properties的文件中执行此操作。像这样:

# Avoid warnings in test log
bitronix.tm.serverId=foo-bar
# Disable tlog files
bitronix.tm.journal=null
# In case the journal is enabled locally, avoid that the btm1.tlog and btm2.tlog files are created in the module's directory
# causing gitignore, mvn clean and IDE indexing issues
bitronix.tm.journal.disk.logPart1Filename=target/btm/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=target/btm/btm2.tlog