IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Speaking of EJBs...
A developer I know made the comment the other day that EJBs were useful if you had multiple, distributed processing in need of transaction.

In our application, while a database is involved, there are also additional distributed calculations and customer end-points that need to be involved in the transaction. The database isn't a suitable place for the transactions to live because of scalability and the fact that the database isn't involved in every aspect.

Now, mind you, he has zero experience with J2EE technologies. He's just "well read" and he has an opinion on everything. :-)

I haven't used things like transaction monitors, but my experience with EJBs has led me to the conclusion that the complexity involved would require extraordinary situations in order for the cost-benefit ratio to be there. I'm not sure there is any situation where things like entity EJBs make sense; at the most, perhaps distributed stateless session beans strictly for the transactional component. I really can't justify any EJB use in a strict browser <-> web server <-> app server <-> database environment.

I've seen a number of comments like yours where the middle tier is excluding EJBs. I'd like to start up a discussion to relate the experiences people (ChrisR, dshellman, bluke, Mr. Blanchard, and others) who have dealt with J2EE in production environments. What works well? What's overkill? What should never be used under any circumstances?

The premise, however, is that J2EE is the environment in use. Comments about nifty Smalltalk or Python environments, while interesting, should be used only in the context of equivalent Java technologies.

Of particular interest to me is experience relating to EJB and JMS stuff, as well as favored methods for building front-ends.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New experience...um....
...this is a production J2EE environment (some sites w/EJBs and some without).

The best response time we've gotten out of the sites where we do have EJBs is 8 seconds and that was after significant tweakage.

My $.02
-Slugbug
New What kind of EJBs?
Session or entity? Stateless or not?

What are you using for the front-end?
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Re: What kind of EJBs?
Why do plumbing problems always happen on Sundays?

Anyway....

Of the more than 170 sites we have, only four use EJBs (session, w/Apache front end). The four sites are up for re-design. They were created (prior to my arrival at this place) when EJBs first arrived and are very much over architected. It will be interesting to see the new designs <smirk>.

-Slugbug
New 8 Seconds!?!

We had a multiple server DB2 UDB system using JDBC WITHOUT EJB running transactions at 250 milliseconds at a load of about 10 per second. The system was architected to run on 3 systems (two transaction parsers, V480s and one DB server V880) up to about 48 TPS. However, at 10 per second, we still ran it on a single V880.

Our goal was to add two V480's to send the volume up from 10 to about 48 per second.

We just used multithreaded sockets and some fancy object design in Java, DB2 UDB with a SAN and good database tuning.

These were a LOT of small 2-4 K transactions, and the parser took them apart, then stored them in the database.

Before the project came to an end, we were still running on a single box V880 with only 4 processors, with about 25% CPU utilization.

So, people who say you can't get good performance with Java are smokin' weed. We did it. It took about a year to really learn what performs in Java, and what was a dog, but we learned. But I'll completely agree that you have to "think outside the vendors".

EJB is terrible because no middleware vendor can really understand your database architecture. To get fast DB performance, your queries need to run directly in JDBC, with someone who's an expert at both Java and database advising you (like me).

I guess if you knew the inner workings of the entity bean architecture, what the middleware would do, and you knew what the database would do, then you could probably theoretically run good performing entity beans. But how meany entity bean vendors will let you know that much about the internals of their product? And how many consultants are there that are both entity bean experts and database?

But, it seems to me, that you would have to work about 10x as hard to get a good performing system than if you simply used the JDBC calls, wrote your own SQL, built your own indexes, and use snapshots to monitor transactions, and tuned your database.

That's the problem with most companies today, they want it to be "easy". And it isn't. If you want a poor-performing application, then why not just write it in VB and Access? Why waste the money on EJB?

BTW, the system we wrote did not require a single EJB vendor's product. We started with WebLogic, but decided quickly that we would get the basic Java working, then add the EJB when we needed to get to multiple machines. By the time we got to multiple machines, we decided that EJB's weren't the solution.

My 2 cents.

Glen Austin
Glen Austin
New They're not Scottish
You can always use the transaction services in a J2EE app server - with or without EJBs. The catch is you have to open,commit,rollback explicitly in code using JTA.

More to the point, I've rarely worked on systems that required transactional semantics that didn't exactly map to the single database I was using. Furthermore, typically the DB is the only transactional component I have. So I could just use JDBC transactions and be fine. Or, use EOF from WebObjects (which is now deployable within J2EE app servers - the build makes you a .war file) which manages database transactions for you via editing contexts. One exception I guess is using JMS queues. These can also participate in transactions. But I rarely need one of these and generally I find its easier to design things to be idempotent and guarantee that they happen at least once than it is to deal with distributed transactions.

The single biggest benefit of using Session Beans that I can see is the ability to specify transaction semantics declaratively in the deployment descriptor - assuming you think programming in xml is some kind of benefit over programming in Java. The current trend in EJB's also seems to be to deploy them locally into the same process as the web tier rather than pay the costs of remote calling. I never understood the drive to locate them remotely when doing web apps anyhow.

I've never used EntityBeans and all that I read about them implies they are a solution in search of a problem. Avoid them. Better to make use of a conventional OR mapping layer like TopLink, EOF, or one of the new JDO implementations like SolarMetric's (which I've seen demo'd but haven't used - it looks a lot like EOF).

I've probably bought half a dozen books on J2EE to brush up on my skills (plus I'm working on this app originally written on WebLogic 7). Of the lot of them, the one that seems the most sensible is Rod Johnson's "J2EE Design and Development". He's absolutely objective, unlike the vast majority of the J2EE cheerleaders out there publishing pie in the sky architecture guides.

His chapter on EntityBeans ends:

"I was enthusiastic about the idea of entity beans whent they were first described as an optional feature of EJB1.0. As recently as the first draft release of EJB2.0 in June 2000 I was hopeful that the limitations that I and other architects had encountered working with entity beans in EJB 1.1 would be overcome, and that entity beans would become a strong feature of EJB. However, I have become progressively disillusioned.

Entity bean performance has proven a problem in most systems I have seen that use entity beans. I have become convineced that remote access to eneity beans and the transaction and security management infrastructure for entity beans is architecturally gratuitous and an unnecessary overhead. These are issues to be handled by session beans. The introduction of locan interfaces still leaves entity beans as unnecessarily heavyweight components. Entity beans still fail to address the hardest problems of OR mapping.

My feeling is that JDO will supplant entity beans as the standard-based persistence technology in J2EE. I think that there's a strong case for downgrading the status of entity beans to an optional part of the EJB specification. Entity bean support counts for well over a third of the EJB 2.0 specification (as opposed to slightly more than a fifth of the much shorter EJB 1.1 specification), and much of the complexity of EJB containers. Removing the requirement to implement entity beans would foster competition and innovation in the application server market would help JDO become a single strong J2EE standard for accessing persistent data. But that's just my opinion!"


That's about mine as well. Remove EntityBeans and you're left with a mechanism that looks a lot like a corba server. Within that server, you can access data anyway you like. Whether those business process objects need to be remoted at all is a whole other consideration but generally I'd assume they live in the same process as the web tier unless they are providing an interface for some other server. And as I mentioned elsewhere, remove EJB's seem to make sense for message driven beans handling async requests.




In Java, you can't escape the creepy feeling.

     --James Gosling
Expand Edited by tuberculosis Aug. 21, 2007, 06:01:43 AM EDT
New Re: They're not Scottish
You can always use the transaction services in a J2EE app server - with or without EJBs. The catch is you have to open,commit,rollback explicitly in code using JTA.
Truth, I had forgotten about JTA.

More to the point, I've rarely worked on systems that required transactional semantics that didn't exactly map to the single database I was using.
We're a financial application. Our clients would like to be able to share in our transactions via the backend interface, and as I mentioned some of our stuff doesn't hit the database at all.

I've never used EntityBeans and all that I read about them implies they are a solution in search of a problem. Avoid them. Better to make use of a conventional OR mapping layer like TopLink, EOF, or one of the new JDO implementations like SolarMetric's (which I've seen demo'd but haven't used - it looks a lot like EOF).
One of the problems I have with Entity EJBs is shared by all OR mapping tools: we don't expose the tables or views. All access is done via stored procedures for both security and business logic.

Of the lot of them, the one that seems the most sensible is Rod Johnson's "J2EE Design and Development".
I'll check it out, thanks.

Thanks for the comments.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Sounds like JDBC/JTA is all you need.
Although I don't quite understand enough about what you're doing to know how you're going to use transactions outside the db without the hassle of writing OTS compliant resources. But based on what I'm hearing, that sounds like the direction for you.



In Java, you can't escape the creepy feeling.

     --James Gosling
Expand Edited by tuberculosis Aug. 21, 2007, 06:02:09 AM EDT
     Speaking of EJBs... - (admin) - (7)
         experience...um.... - (slugbug) - (3)
             What kind of EJBs? - (admin) - (1)
                 Re: What kind of EJBs? - (slugbug)
             8 Seconds!?! - (gdaustin)
         They're not Scottish - (tuberculosis) - (2)
             Re: They're not Scottish - (admin) - (1)
                 Sounds like JDBC/JTA is all you need. - (tuberculosis)

Powered by crabby patties!
48 ms