JAVA thread allocation?

96 Views Asked by At

My program run in Eclipse, all process will be done in a single thread only. I am facing a problem when i deploy it to client machine (I am not sure the configuration of the machine).

Thread is suddenly changed from btpool0-1 to `btpool0-7 during the process. I am sure i have not create any thread in coding.

I would like to know is there any reason why the behavior like this??

Thanks in advance!!

=======LOG HERE=====================================================

2016-01-20 12:03:58.784 [btpool0-1] INFO hk.com.xx.sys.service.impl.BargeVoyageServiceImpl - End submit request to nSys in saveAndSynchronize

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.persistence.TransactionCoordinator - Flush before Commit Transaction id 1656368712 in thread 2055564603

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.persistence.DefaultEntityManager - Run flush for delegate 481556314 of customFramework manager 1801910956 in thread 2055564603 in session 1798587502 in transaction 2028663310 in context 880330942 2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.ro.security.remote.RemotecustomFrameworkManager - Run flush for delegate 1470155242 of customFramework manager 146387751 in thread 2055564603 in session 2099793559 in transaction 1484449171 in context 1631574962

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.persistence.TransactionCoordinator - Commit Transaction id 1656368712 in thread 2055564603

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.persistence.DefaultcustomFrameworkManager - Committed transaction for delegate 481556314 of customFramework manager 1801910956 in thread 2055564603 in session 1798587502 in transaction 2028663310 in context 880330942

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.persistence.DefaultcustomFrameworkManager - Closed delegate 481556314 for customFramework manager 1801910956 in thread 2055564603 in session 1798587502

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.ro.security.remote.RemotecustomFrameworkManager - Committed transaction for delegate 1470155242 of customFramework manager 146387751 in thread 2055564603 in session 2099793559 in transaction 1484449171 in context 1631574962

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.ro.security.remote.RemotecustomFrameworkManager - Closed delegate 1470155242 for customFramework manager 146387751 in thread 2055564603 in session 2099793559

2016-01-20 12:03:58.877 [btpool0-1] DEBUG customFramework.persistence.TransactionCoordinator - Commit Transaction Ended id 1656368712 in thread 2055564603

2016-01-20 12:03:58.877 [btpool0-1] INFO performance - hk.com.xx.sys.service.BargeVoyageService method saveAndSynchronizeForPeakMode - elapsed time is 687 ms.

2016-01-20 12:03:59.190 [btpool0-1] DEBUG HK.com.xx.ro.security.ThreadSecurityContext - stack.size() = 1; index = 0

2016-01-20 12:03:59.252 [btpool0-7] INFO customFramework.service.http.HttpServiceHandlerFactory - Invoking service hk.com.xx.sys.service.BargeVoyageService method savePeakBargeVoyageInBatch

2016-01-20 12:03:59.252 [btpool0-7] DEBUG customFramework.service.http.HttpServiceHandlerFactory - Service object =

2016-01-20 12:03:59.252 [btpool0-7] DEBUG customFramework.service.ServiceInterceptorFactory - Invoking method savePeakBargeVoyageInBatch with transaction attribute = REQUIRED

2016-01-20 12:03:59.252 [btpool0-7] DEBUG customFramework.persistence.TransactionCoordinator - Execute with transaction attribute = REQUIRED

2016-01-20 12:03:59.252 [btpool0-7] DEBUG customFramework.persistence.TransactionCoordinator - Begin Transaction id 1656368712 in thread 1377751019

2016-01-20 12:03:59.252 [btpool0-7] DEBUG customFramework.persistence.DefaultcustomFrameworkManager - Created delegate 1334851109 for customFramework manager 1801910956 in thread 1377751019 in session 80928754 in context 812419927

1

There are 1 best solutions below

6
Tassos Bassoukos On BEST ANSWER

Well, you do use a pool - btpool0-7 reads as thread #7 of pool #0. Now, this does not mean that you've started 6 threads - it just means that your pool is sized at least 8 threads large, and for some random reason thread #7 was chosen to start the unit of work. This could be due to a number of reasons that I won't enumerate here, suffice to say that a) it's benign, b) you should not care about the number, just that it stays the same during logging.