Adam Hardy

Ranch Hand
+ Follow
since Oct 09, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adam Hardy

In a similar way, many of the projects I work on are big enough for refactoring to become an issue. What approach do you use there?
I just searched my google books copy and the first 5 hits were not good! In one example, he writes "design patterns and idioms" and I think in that sense 'idiom' means something along the lines of the dictionary definition which relates to idioms in the English language - you can translate that for the Java language as something like "a typical way of doing something".

In the other 4 of the first 5 hits, he used the word 'idiom' when really he just means 'example'.

So, not great English.

In fact, a bit of an anti-pattern! ;)

They fall into that trap at Spring Frameworks, where every document contains a reference to the phrase "idiomatic Java" when really they would just do better to say 'correct Java' but I guess they felt that was a little arrogant - and to say "typical Java" made it sound a bit cheap.

My 2 cents!
9 years ago
Shame no-one answered this because I was looking for confirmation of what I was thinking on this exact scenario.

I think it will depend on how you updated the entity, whether it was attached or detached, also how you have set up caching.

However I think this would be a rare case. The business key examples given as examples above include addresses which is not a true business key. If you have any list of contacts that is more than a few items long, then you would be unlikely to use address details as part of the business key. People change their addresses all the time. In an ideal world, business key values would never need updating and if for any reason in your business domain they did need updating, you would need to design for that and not rely on Hibernate to sort out potential problems like that. And I think it's reasonable to assume that your persistence engine e.g. Hibernate would act unpredictably. I'm going to google more and if I don't edit this later, then assume I didn't find otherwise.

4 years late but better late than never....
I second this question, and I think it would also be great to find out how it varies between browsers as well. I love firefox because of all its plugins and extensions, but my guess is that it's a real memory hog, especially if you start multi-threading. But is Chrome, IE, Safari etc any better?
I'd be interested to hear what people's favorites are, especially Mike and Merrick

I rank the JPA implementations that I have experience with as follows:

(1) OpenJPA
(2) Hibernate
(3) Toplink

Don't have any experience with other implementations - always wanted to check out Kodo but never got around to it.

Hi Mike and Merrick

the blurb about the book looks promising - I might actually have to go and buy it - if I don't win it

[devaka: question removed]

Regards
Adam
Just looking thro the table of contents of the EJB3 Persistence book, I couldn't tell whether it covers many-to-many join tables, or other more complicated entity relationships.

I have worked with legacy databases on the last 2 projects I did, and with Hibernate I had a few problems mapping the tables to a reasonable domain model. For example, I effectively had a one-to-one relationship to model, but in the DB it was a parent-child entity relationship, and I had to map a left-join from the child to the parent. Hibernate couldn't do it.

How much would you say EJB3 provides for doing this sort of thing?
A database doesn't really have external behaviour though. At least you would have to include the persistence O/R mapping layer in the discussion, and talk about refactoring behind the API which that offers.

Otherwise you would be limited to refactoring indexing and other mechanisms which had no impact on the tables and columns (the externally visible part).


Adam
I've noticed a strong correlation between people talking about 'patterns' and people using EJB. Since Marinescu's EJB Design Patterns and that Wrox book - was it 'Core J2EE Patterns?', I think everyone thinks EJB has a monopoly on the use of patterns.
Actually there is point of view that EJB is itself an anti-pattern! Only kidding. A pattern is no more than a decent basis for a design.
What were you considering EJBs for? Database access? Well there are plenty of non-EJB database access frameworks around. JDO, Hibernate.
Actually I think you can pick up a free copy of EJB Patterns as a pdf from the serverside.com, and in it they have a chapter on alternatives for EJB.
HTH,
Adam
Try putting it in the default web.xml in the tomcat.sar directory in your deploy directory.
19 years ago
That's because they have to put their hooks and claws into the tomcat code before releasing it. But they are only one or two minor revisions behind. The latest that I'm using is 5.0.19.
You may be able to find tomcat5 on your jboss right now - there's an ant script to run that will create the jbossweb-tomcat50.sar directory for you. I'm not sure if it is with every release. I am using a build of the CVS tree because there was a bug fix in it I needed. Try downloading jboss 3.2.4RC1
19 years ago
Smitha, it's alot easier to help when you say what the error is. Presumably ant says something is wrong. What does it say?
if you like the command-line, go for emacs and ant. One advantage is that there's one less layer of complexity (if you take out the IDE)
19 years ago
Yup, that's right. Global JNDI. Norm, is that less efficient than calling it up via the local name?
19 years ago
I was looking through the JBoss archives and I saw a thread discussing this theme. You can configure log4j to use a seperate config file for your application. I don't recall the details but it involves setting up a log4j initialization class in your app's start-up.
19 years ago