Skip to main content

Posts

Showing posts from October 17, 2009

Hibernate Reverse Engineering

Hibernate Revers enginering is the process of creating hibernate mapping files and pojo classes from an exising database tables.It has been explicitly achived by using HIbernate Tools. In Eclipse IDE we have to put the hibernate tool in our eclipse version. In net beans 6.8 it is by defaultly avialable to you. Fid below the handling of the required hibernate tool on different IDE's. Reveres Engineering using Net Beans Ide

Managing Data with the ThreadLocal Class

ThreadLocal class allows you to put local data on a thread, so that every module running in the thread can access it. ThreadLocal has been around since JDK 1.2, but hasn't been used much, maybe because of a first, rather poor implementation, performance-wise. Documentation From ThreadLocal Api This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID). An example may help clarify this concept. A servlet is executed in a thread, but since many users may use the same servlet at the same time, many threads will be running the same servlet code concurrently. If the servlet uses a ThreadLocal object, it can hold data local to each thread. The user ID is a good example of what c...