questions about the btm tlog files

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

questions about the btm tlog files

sajmera
This post was updated on .
Hi,

I am currently using BTM  2.1.3. I have some questions about the btm tlog files:

1) does the tlog files grow in size with time, or does it always remain at a constant size of 2.1M?
2) What are the best practices for where the tlog files should be located on the server? (We use tomcat as our container)
3) Is there documentation on what gets logged in the tlog files and how the contents of these files can be useful for debugging?


Thank you,
Saurabh Ajmera
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

Brett Wooldridge-2
Hi,

The tlog files are transaction journal logs, similar in a way to the transaction log that your database maintains to store transactions prior to commit.  They are not human-readable or debug logs, they are used for transaction recovery if your server crashes.

The logs will never grow over their constant size.  They can be stored in any location that will survive a restart of your application.  Temporary directories are sometimes cleared on restart, so that would not be a good location.  But other than that, any location is fine.  I would suggest some place relative to your application in the container.

Regards,
Brett


On Thu, Oct 3, 2013 at 7:07 AM, sajmera <[hidden email]> wrote:
Hi,

I am currently using BTM  2.1.3. I have some questions about the btm tlog
files:

1) does the tlog files grow is size with time, or does it always remain at a
constant size of 2.1M?
2) What are the best practices for where the tlog files should be located on
the server? (We use tomcat as our container)
3) Is there documentation on what gets logged in the tlog files and how the
contents of these files can be useful for debugging?


Thank you,
Saurabh Ajmera



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/questions-about-the-btm-tlog-files-tp1533.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

sajmera
This post was updated on .
Hi Brett,

Thanks for your response. I do have another related question that I am hoping to seek an answer for:

We have two spring based web applications both use bitronix as connection pool manager. One application is called 'rice', which is a middleware and also provides api, and another application is called 'kfs'. In terms of structure, rice is maven style project, while KFS is a simple eclipse based java project. KFS and rice are deployed on separate physical machines.

The tlog files does get created for rice. However, the tlog files does not get created for kfs. I was wondering if this is an expected behavior, or does it indicate some flaw in my configuration?

Thank you,
Saurabh Ajmera
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

Anil Hemnani

Looks like your code config issue. Could you please share the configuration files if possible.

On 7 Oct 2013 17:29, "sajmera" <[hidden email]> wrote:
Hi Brett,

Thanks for your response. I do have another related question that I am
hoping to seek an answer for:

We have two spring based web applications both use bitronix as connection
pool manager. One application is called 'rice', which is a middleware and
also provides api, and another application is called 'kfs'. In terms of
structure, rice is maven style project, while KFS is a simple eclipse based
java project. KFS and rice are deployed on separate physical machines.

The tlog files does get created for rice. However, the tlog files does not
get created for kfs. I was wondering if this an expected  behavior, or does
it indicate some flaw in my configuration?

Thank you,
Saurabh Ajmera



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/questions-about-the-btm-tlog-files-tp1533p1538.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

sajmera
following are contents of bitronix-default-config.properties

KFS

bitronix.tm.serverId=USC-KFS
bitronix.tm.allowMultipleLrc=true

# location of tlog files:
bitronix.tm.journal.disk.logPart1Filename=./kuali/btm/tx-logs/kfs-btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=./kuali/btm/tx-logs/kfs-btm2.tlog


RICE
# Bitronix Configuration File

bitronix.tm.2pc.warnAboutZeroResourceTransactions=false
bitronix.tm.serverId=USC-RICE

bitronix.tm.timer.defaultTransactionTimeout=5000
bitronix.tm.allowMultipleLrc=true

# location of tlog files:
bitronix.tm.journal.disk.logPart1Filename=./kuali/btm/tx-logs/rice-btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=./kuali/btm/tx-logs/rice-btm2.tlog



NOTE: tlog files do get created for Rice, but not for KFS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

Ludovic Orban-2
The transaction log files are automatically created when the transaction manager starts. Unless you configured the null journal, there is no way around that.

It looks like you're only using the connection pools in your KFS app, without using the transaction manager. If that's what you wanted to do then you're fine and don't need the tlog files.

--
Ludovic


On Mon, Oct 7, 2013 at 7:45 PM, sajmera <[hidden email]> wrote:
following are contents of bitronix-default-config.properties

*KFS*

bitronix.tm.serverId=USC-KFS
bitronix.tm.allowMultipleLrc=true

# location of tlog files:
bitronix.tm.journal.disk.logPart1Filename=./kuali/btm/tx-logs/kfs-btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=./kuali/btm/tx-logs/kfs-btm2.tlog


*RICE*
# Bitronix Configuration File

bitronix.tm.2pc.warnAboutZeroResourceTransactions=false
bitronix.tm.serverId=USC-RICE

bitronix.tm.timer.defaultTransactionTimeout=5000
bitronix.tm.allowMultipleLrc=true

# location of tlog files:
bitronix.tm.journal.disk.logPart1Filename=./kuali/btm/tx-logs/rice-btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=./kuali/btm/tx-logs/rice-btm2.tlog



*NOTE:* tlog files do get created for Rice, but not for KFS



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/questions-about-the-btm-tlog-files-tp1533p1540.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

sajmera
Thanks Ludovic. After you pointed it out, i noticed that for KFS is still using the spring transaction manager, and Rice is using Bitronix transaction manager. My original intention was to use the bitronix transaction manager instead. However, I am wondering if KFS is using spring transaction manager and rice is using BTM tx manager, will that adversely affect the ability of transaction managers to roll back distributed transactions?

Please let me know what is the recommended approach here. KFS is a financial system and does initiate distributed transactions which accesses services on rice. So, should they both use btm tx manager or they can use different tx managers.  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

Ludovic Orban-2
If both Rice and KFS call each other and you want atomic outcomes, they should share their BTM instance.


On Tue, Oct 8, 2013 at 7:58 PM, sajmera <[hidden email]> wrote:
Thanks Ludovic. After you pointed it out, i noticed that for KFS is still
using the spring transaction manager, and Rice is using Bitronix transaction
manager. My original intention was to use the bitronix transaction manager
instead. However, I am wondering if KFS is using spring transaction manager
and rice is using BTM tx manager, will that adversely affect the ability of
transaction managers to roll back distributed transactions?

Please let me know what is the recommended approach here. KFS is a financial
system and does initiate distributed transactions which accesses services on
rice. So, should they both use btm tx manager or they can use different tx
managers.



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/questions-about-the-btm-tlog-files-tp1533p1543.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

sajmera
Hi,

I am facing an issue when doing a hot deploy in tomcat 6.24. The application is question is KFS, and it is using the bitronix transaction manager configured using spring and bitronix connection pool. If I shutdown tomcat completely and then restart tomcat, I don't get any errors and the application works as expected. However, if I were to do a hot deploy, without restarting tomcat, I get the following locking error:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static bitronix.tm.BitronixTransactionManager bitronix.tm.TransactionManagerServices.getTransactionManager()] threw exception; nested exception is bitronix.tm.utils.InitializationException: initialization failed, cannot safely start the transaction manager
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:127)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:435)
        ... 67 more
Caused by: bitronix.tm.utils.InitializationException: initialization failed, cannot safely start the transaction manager
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:102)
        at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115)
        ... 68 more
Caused by: java.nio.channels.OverlappingFileLockException
        at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
        at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
        at bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:71)
        at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:157)
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:85)
        ... 74 more

I was wondering if anyone has encountered such an issue before, and if there is a solution/workaround to this issue.

Thank you,
Saurabh Ajmera.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

Brett Wooldridge-2
I haven't looked into it at all, but my intuition is that there is some kind of restart/shutdown hook
you can register with Spring and/or Tomcat.  What you need is for Spring to shutdown bitronix
in a clean manner by calling the shutdown() method on BitronixTransactionManager, when the
container is redeployed.  Basically that is the issue, btm is not being shutdown and it leaving a
file lock in place as a result.  This is intentional to prevent two instances from running in the
same JVM.  The solution is to figure out how to properly shutdown btm when a redeploy happens.

Brett



On Tue, Oct 15, 2013 at 8:13 AM, sajmera <[hidden email]> wrote:
Hi,

I am facing an issue when doing a hot deploy in tomcat 6.24. The application
is question is KFS, and it is using the bitronix transaction manager
configured using spring and bitronix connection pool. If I shutdown tomcat
completely and then restart tomcat, I don't get any errors and the
application works as expected. However, if I were to do a hot deploy,
without restarting tomcat, I get the following locking error:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
Factory method [public static bitronix.tm.BitronixTransactionManager
bitronix.tm.TransactionManagerServices.getTransactionManager()] threw
exception; nested exception is bitronix.tm.utils.InitializationException:
initialization failed, cannot safely start the transaction manager
        at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:127)
        at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:435)
        ... 67 more
Caused by: bitronix.tm.utils.InitializationException: initialization failed,
cannot safely start the transaction manager
        at
bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:102)
        at
bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115)
        ... 68 more
Caused by: java.nio.channels.OverlappingFileLockException
        at
sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
        at
sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
        at
bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:71)
        at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:157)
        at
bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:85)
        ... 74 more

I was wondering if anyone has encountered such an issue before, and if there
is a solution/workaround to this issue.

Thank you,
Saurabh Ajmera.



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/questions-about-the-btm-tlog-files-tp1533p1546.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: questions about the btm tlog files

sajmera
Thanks Brett.

I was able to resolve this issue by calling TransactionManagerServices.getTransactionManager().shutdown() in the contextDestroyed(ServletContextEvent sce) method of my implementation of ServletContextListener.

Loading...