Hmm, it's sad but it's true. Firstly what makes me to rebuild the application. Till midnight everything went very well but then I realized, that performance of my example application is even worse that terrible ! As I mentioned before, I use Oracle's HR database. There are roughly 100 employees, some departmets, some countries etc. but initial load of such application was 20 almost seconds ! So I decided to use lazy fetching. Good idea but annotation @OneToMany(fetch = FetchType.LAZY) is just a suggestion - and for reason unknown, Toplink didn't follow it. I'm just a humble developer so I made up my mind and download latest build of Glassfish - b33 just to try my luck. You can't imagine my surprisal when I wasn't able to compile the project. Toplink has been turned upside-down and many annotation was deleted, renamed or rearranged. More on this here. After all I know what I'll be doing tonight :-)
It's 1:10 pm and I've made the changes. Piece of cake I must admit. So, @Id no longer contain parameters, @GeneratedValue is newcomer (can be used with every generated field) and everyone is shinny happy. After this small intermezzo I will continue trying to fix the performance issue. All I need to do is to find a balance between code simplicity and application response time.
No comments:
Post a Comment