Tuesday, February 28, 2006

isOpen? SHUT UP!

Let me just get this straight - the "isOpen()" method on EntityManager throws an exception when the EntityManager is closed?

Look for yourself:

21:25:51,396 ERROR [Faces Servlet]:704 - Servlet.service () for servlet Faces Servlet threw exception
java.lang.IllegalStateException: EntityManager is closed
    at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:31)
    at org.hibernate.ejb.AbstractEntityManagerImpl.adjustFlushMode (AbstractEntityManagerImpl.java:273)
    at org.hibernate.ejb.EntityManagerImpl.isOpen(EntityManagerImpl.java:54)

Saturday, February 25, 2006

Generics are beautiful

Where's Waldo? Or in this case - where's the method name? (It's in there somewhere! Hint: U find it!)

<T extends BusinessObject, U extends List<T>, V extends SearchCriteria<T>> U find(V criteria);

Thursday, February 23, 2006

Isn't that what everyone is complaining about?

"This deal wouldn't go forward if we were concerned about the security of the United States of America," Bush told reporters during a Cabinet meeting.

Tuesday, February 21, 2006

ibm caches JNDI references

Our app has a nifty little cache of EjbHome remote references.  And it has some nifty code to discard and get a new remote reference if the current reference should happen to go stale.  Which nifty code never helps much - since IBM's jndi implementation caches objects directly retrieved from the InitialContext in its own little cache.  SO . . . we were discarding our cached reference - and then getting it back again!  Users have been complaining that they have to shut down and restart their app whenever they leave it idle (or "iddle" to quote one help desk official) for any length of time.

The solution is to pass an IBM proprietary string value to the InitialContext object before getting your next reference.  There are three such value options to be passed with some proprietary string key, and the values amount to "use the cache", "reset the cache", and "don't use the cache."  Of course, I can't remember the proprietary string key nor any of the proprietary string values.  But armed with the information so far, you can probably find the rest.

Sunday, February 12, 2006

Email clients

I'm really impressed with gmail.  But does it post annoying postscripts to my outgoing emails, like Yahoo! does?

Why, oh why, "carconf" on my faces?

So if YOU were writing an EXAMPLE application, why
would you give your variables names like "carconf" for
an object that turns out to be a "carConfigurator?"

I'm trying to take this stuff in at maximum ingestion
speed. Would it really have hurt so bad to call your
variable carConfigurator in the .jsp page?