Jul 31 2008

How to enable Auto Commit in Hibernate Transactions

Tag: JavaYogesh @ 9:40 am

Use

 
<property name="connection.autocommit">true</property>

in the hibernate config xml.


Jul 23 2008

Email wrapping issue (\n does not move content to new line)- outlook

Tag: JavaYogesh @ 9:51 am

i had to generate and send an email with multiple lines in plain text format, the problem i was facing is peculiar, if i use a single \n or \r\n the line doesn't get wrapped but if i use two new line characters the lines are seperated by two blank lines :S

I found that this is due to a strange behavior of outlook whereby if any content follows a period(i had a *), outlook considers it as the start of new statement and adds the next line to current line!

it works perfectly in other email clients...


Jul 23 2008

How to view the memory used by the JVM?

Tag: JavaYogesh @ 9:24 am

Use the Runtime class to get the total/free memory used by the JVM,

Runtime.getRuntime().totalMemory();
Runtime.getRuntime().freeMemory();


Next Page »