Thursday, November 8, 2012
Where i am starting from
Occasionally of course weight in might occur later for example over the weekends. Today's weight is 117.3 which is slightly higher than i expected. But we will deal with it later.
Wednesday, November 7, 2012
Loosing wait. Again?
And here comes a realisation that something must be done with my growing weight. It took me good two and a half years to loose 55 kg back in 2008 but since my weight is constantly growing. I can keep it at the same level most of the time, but each trip anywhere in the world, whether this is a holiday or business trip, costs me few kgs.
So, here is the deal: starting from today i am coming back to the program that helped me back in 2008.
The main principles of the program are as follows:
- carbs and fat or proteins should not be mixed in one meal;
- no bad carbs should be consumed, i.e. no sugar, sweets, pasta, bread etc.
- overall calories consumption should be kept in the region of 1500 a day;
- no stimulants like caffeine or alcohol;
Obviously, it is unlikely that the last point can be followed in 100% of the cases but stimulants must be minimized.
And exercising is a key. Let's see how it goes.
I will keep this diary in case i need information in the future. As i do not believe it is the last time i am loosing the weight.
Thursday, September 13, 2012
How to check out a project from SVN repository ignoring some directories
So, here is a remedy (step-by-step guide):
- Identify names of directories that should be omitted from the checkout.
- Start general checkout of the branch: svn co <branch URL> <directory name>
- Interrupt checkout as soon as it creates directory (directories) that should be omitted.
- Delete directory that should be omitted from the disk.
- Run svn cleanup
- Do a checkout of the directory to be omitted specifying empty depth: svn co <branch URL>/directory --depth empty
- Do this for each directory that should be omitted. Note, that these directories could be situated at any level in the source tree, but the checkout with the empty depth should be done then from the directory that holds the one that should be omitted.
Wednesday, September 12, 2012
Magic of the disappearing hibernate session
It usually manifests itself with the following exception:
org.springframework.transaction.support.TransactionSynchronizationUtils - TransactionSynchronization.beforeCompletion threw exception
java.lang.IllegalStateException: No value for key [org.hibernate.impl.SessionFactoryImpl@2ea60563] bound to thread [WorkManager(2)-7]
However, from time to time it shows the different message with the similar message which reads that Hibernate session is not available to the current thread.
After some investigation it appears that it is highly likely that this exception occurs when the particular combination of the frameworks involved into the application. We observed it in the J2EE project that is built using combination of Hibernate and Spring running on JBoss 5.1 application server where transaction management is delegated to the JBoss.
It seems that Spring by default wraps the Hibernate's SessionFactory implementation into its own transactional version attached to Spring's transaction support. Since we delegated transaction management to JBoss Hibernate Session will not be bound to the Spring's transaction manager. But Spring's SessionFactoryUtil checks if it is bound to Spring's transaction manager and reports the error if it does not unless it is instructed not to do so.
In order to instruct Spring to ignore the fact that Hibernate session is not bound to the Spring's transaction support the following property should be added to the definition of the Hibernate Session Factory:
<property name="exposeTransactionAwareSessionFactory" value="false"/>
Note that this property makes sense only in case of JTA transaction manager involved and not required when local transaction manager is used.