Showing posts from December, 2008

Oracle XE web interface

Oracle XE has a web interface for administration, monitoring and running SQL. It is very nice. By default its URL is http://localhost:8080/apex.

Hibernates proxy usage for persistent objects

Hibernate's Session.load() returns a proxy instance if proxy usage/lazy loading is not disabled. This proxy instance could be uninitialised.  ie.the fields are not populated. It may throw org.hibernate.LazyInitializationException when the fields of the object is accessed outside a transaction. By default, in Hibernate 3 all classes and collections are lazy initialized. So accessing the objects fields should be done inside a transaction if load() is used and lazy loading is not disabled. Session.get() won't use uninitialized proxies. So it is safe to access objects returned by get() method outside a transaction. To disable usage of proxy, specifiy lazy="false" attribute for class element or default-lazy="false" attribute of hibernate-mapping element. Most scenarios will benefit the usage of proxy and load() should be used.

Oracle XE and SQLPlus

Immediately after Oracle Express Edition installation, trying to run SQLPlus command line tool was giving TNS listener not found error. tnsping was working fine. After a restart it started working. If you need to run sqlplus.exe without restarting the machine set the environment variable ORACLE_HOME. SQLPlus should know oracle home directory to find tnsnames.ora file. Oracle installation didn't set this environment variable. This variable must point to the database installation directory. In my case it is F:\oraclexe\app\oracle\product\10.2.0\server. After a system restart SQLPlus is working without this variable. SQLPlus should be reading this from the registry.

My first blog

This is my first blog. I will be writing stuff that I learn. It is kind of notebook of my learning experience. Most posts will be software technology related. I hope that it will be useful to others as a place for reference.