Wednesday, May 30, 2012

Java application with hibernate stops working after a few hours of not being used

I have a tomcat - hibernate web application, but after a night of not being used - the application stops working and shows exceptions and I need to restart the app in tomcat.

The issue seems to be related to the fact the hibernate drops the connection after a configurable amount of time and doesn't know how to reconnect.

Th solution lays in C3P0 package.

See here:
http://www.databasesandlife.com/automatic-reconnect-from-hibernate-to-mysql/

Wednesday, April 11, 2012

Remote desk top to win2k3 console session (shadow mode - without disabling local user)

Typically after performing an mstsc remote desktop  to a windows 2003 server machine, you will want to open the terminal services manager and right click connect to the console session already running locally on the computer.

When you try to do that you will get a message:
"Can't remote control session(ID 0) control is disabled on that session"

To be able to connect to the console session of a windows 2003, and even share the screen with the local user without disconnecting them, you need to perform the following procedure:

http://support.microsoft.com/kb/278845 (see the "how to shadow the console session" part)

The fast answer is to perform this on the remote desktop session:
  1. Open the Group Policy snap-in (Gpedit.msc).
  2. In the left pane, under the Computer Configuration branch, expand the Administrative Templates branch.
  3. Expand the Windows Components branch.
  4. Click the Terminal Services folder.
  5. In the right pane, double-click Sets rules for remote control of Terminal Services user sessions.
  6. On the Setting tab, click Enabled.
  7. In the Options box, click Full Control without users' permission, and then click OK
And after that open a command prompt and type:
shadow 0

Sunday, February 26, 2012

Setting up word heading styles to have multilevel numbering

In order to setup word styles to have good indented numbering system in the header styles,
Like this:

1. Heading1A
  1.1 Heading2a
  1.1 Heading2b
2. Heading1B

You need to work with "List Styles" which is a top level Style binder that groups the header styles into a logical group with logic - specifically you will need to build a new list style and link its levels to the headings.

A very good doc for this can be found here:
http://www.shaunakelly.com/word/numbering/numbering20072010.html

Thursday, February 23, 2012

File search alternatives for the bad windows 7 search

http://www.mythicsoft.com/page.aspx?type=agentransack&page=home

OR

http://goffconcepts.com/products/filesearchex/

Monday, January 23, 2012

Great Java Servlet JSP Eclipse tutorial

Organized as slides, very good for people coming from visual studio too, shows anti SQLi programming practices too:

Java Servlet/JSP tutorail

Sunday, January 22, 2012

USB thumb drive (disk on key) doesn't work in windows 7

I had many times that windows 7 would not react when I inserted my disk on key - nothing happened.

This can be solved many times by disabling the power management on the USB slots:
Start->"power options" (enter in search box and select it when it comes up)->"change plan setting"->"change advanced power settings"
open "USB settings", open "USB selective suspend setting" -> change it to "Disabled" click OK and boot the machine.

If it still doesn't work, it maybe because of daemon tools, try opening daemon tools and removing the virtual devices and then closing daemon tools and re-inserting the disk on key.