Slashdot Mirror


Java Database Best Practices

ProfKyne writes "I was excited to read this book when I first noticed it listed as "coming soon" in the Java section of O'Reilly's site back in May. I downloaded and read the sample chapter and waited expectantly for the book to be released. I was hoping that this book would be perfect for me, as nearly all of the Java programming I have done has dealt in some way with database access, though I do not consider myself to be an expert on the subject. The book didn't disappoint; Java Database Best Practices is an excellent high-level guide to writing database-driven applications from Java." Read on for the rest of ProfKyne's review. Java Database Best Practices author George Reese pages 267 publisher O'Reilly Associates rating Excellent for Java programmers moving to J2EE reviewer Erik Price ISBN 0596005229 summary A high-level introduction to writing database-driven apps in Java

What it's about: The book is divided into three sections of several chapters each:
  1. Data Architecture - an introduction to database-driven application concepts
  2. Persistence Fundamentals - descriptions of the various persistence frameworks for Java application development
  3. Tutorials
I should note that the book follows a strange order: the most logical progression for the apparent target audience of this book (developers just getting into J2EE) would be to read Part 1 first, then Part 3, and then Part 2, as the "Persistence Fundamentals" section draws heavily on content introduced in the later "Tutorials" section.

The first section (Data Architecture) introduces some of the concepts that will be covered in greater depth later on in the book, but also contains an excellent chapter, "Relational Data Architecture," on database schema design and normalization. By the way, this is the sample chapter that can be downloaded from O'Reilly's site. In fact, this chapter set itself apart from the rest of the book in that it goes into a great deal of detail on its subject (although obviously an aspiring DBA should probably read whole books dedicated to the topic of relational database concepts). Most of the rest of the chapters in the book is somewhat more lightweight than "Relational Data Architecture." This section also contains a chapter that introduces some of the things to be aware of when managing transactions, including implementation tips on using transactions in JDBC programming such as optimistic locking and the various transaction types (dirty reads, etc).

The Persistence Models section focuses on different persistence frameworks, there is a chapter for each of the following: Persistence Fundamentals, EJB Container-Managed Persistence (covers 1.x and 2.0 models), EJB Bean-Managed Persistence, JDO, and "Alternative Persistence." The fundamentals chapter is where some of the best of the "best practices" of the book are found, and introduces such patterns as the Data Access Object pattern and the Memento pattern in the context of a simple guest book JSP application. The EJB chapters do assume that the reader has a basic understanding of how EJB works, and provides suggestions and guidance on ways to implement EJBs in real J2EE applications. (Don't worry, if you don't know about EJBs, the J2EE Tutorial chapter later in the book provides this.) The JDO section is one of the shortest in the book; I think that it's just such a new technology (in terms of available implementations) that most of the "best practices" are yet to be discovered. "Alternative Persistence" means Hibernate and Castor.

The Tutorials section is definitely not for advanced Java programmers, as it contains beginner-level introductions to the J2EE platform, the SQL language, the JDBC architecture, and the JDO API. If you really don't know anything about JNDI or servlets or EJB, then the J2EE chapter is written for you -- it's not a "how-to" tutorial, but rather a description of the basic concepts. The JDO tutorial is like the J2EE tutorial, introducing the basic concepts such as "the extent" and the filter language used to query for JDO-persisted objects, but I think partly because it's such a new technology, there's not a lot of detail here. You'll still have to read more about J2EE EJB, or JDO, if you decide to use them in a production application. On the other hand, you will learn how to make effective use of SQL queries and the JDBC API (which lets you execute SQL queries from your Java code) from their respective tutorials.

While this is a good start, you will eventually want something more in-depth than this if you are actually implementing a J2EE application (such as a book dedicated to servlet/JSP programming or Enterprise JavaBean development). But I really wish that I had read Java Database Best Practices before tackling these subjects, as it would have helped ease the transition

What's to like As strange as it may sound, one of the things I liked most about the book is that it is relatively thin. In other words, the author gets right to the point and doesn't waste excessive space replicating information that can be found elsewhere. For instance, when describing how to implement a database-independent sequencing component, he incorporates enough code to support what he's saying, but doesn't include page after page of complete code listing, intact with multi-line Javadocs and plenty of whitespace -- just the meat. You can download all of the code from O'Reilly's site in a zip archive (and yes, it does include the Javadocs and whitespace that are wisely omitted from the book). Ironically, the book costs no less than other offerings from O'Reilly that are twice as thick.

Also, the "best practices" in the book are very good and, at least in my case, I was not familiar with some of them, so it was very worthwhile reading. As an example, I myself have recently run into the problem of different sequencing systems on different databases (such as MySQL's AUTO_INCREMENT column type vs PostgreSQL's sequence types). I've worked around it by modifying the application's database calls, but that isn't really a good strategy. Implementing a sequencer at the application level (one of the "best practices") is a much better idea if you're not clustering your application servers and other applications will not be performing INSERTs into the database. On the other hand, if clustering is an issue, then it's probably a better idea to use EJBs, and if other applications will be writing to the data store, then database portability will be difficult in the first place (even with the help of Perl's DBI or PHP's PEAR DB abstraction). Some of the other excellent best practices introduced are the DAO pattern and database schema normalization coverage.

What's to consider The most important thing to know when considering this book is that it really struck me as being appropriate for novice J2EE developers and/or those who are new to database programming in general. First of all, I think it's safe to assume that most people who will be doing anything with databases in Java will be using at least some element of the J2EE platform, and this book makes that same assumption. Java's tremendous success right now is in server-side application development. This means there won't be as much useful information in this book for the folks who are writing, say, an AWT interface tightly coupled to a MS-Access database through ODBC calls. Second of all, the patterns and practices described in this book should be familiar to most people who are already architecting J2EE applications, and are covered in greater depth in other books on enterprise application development.

Having now covered the main consideration, I do have to pick a couple of nits. Firstly, this book does suffer from a few of the editing problems that plague nearly all computer books (yes even the O'Reilly books) in their first printing. It's kind of embarrassing, but even in the sample chapter I found a somewhat bizarre mistake near the end, where a class diagram is drawn up using ERD notation instead of UML. Fortunately, there aren't too many technical errors like this. Another bone to pick was the author's choice to use a hideous scriptlet-heavy JSP instead of a servlet forwarding to a JSP in the small Guest Book application in "Persistence Fundamentals." I know that this is Java Database Best Practices, not Java Model View Controller Best Practices, but scriptlets are both difficult to read and quite frankly scorned as J2EE moves toward JSTL and JSP 2.0. It's a little too bad that View and Controller are mixed up in this example, because the author does an excellent job of explaining how to implement the Model using the Data Access Object pattern.

Finally, I have a feeling this book was named "Java Database Best Practices" for marketing reasons, perhaps to go with O'Reilly's other offering, "Java Enterprise Best Practices". While this is an excellent book about Java database programming, and there are indeed dozens of "Best Practice" tips strewn throughout the book, I think a better name for this book would have been "Java Database Fundamentals."

The summary I didn't want to simplify and rehash the book's "best practices" contents in this review, but rather provide prospective readers with an idea of what to expect from this book. Personally, I got a lot out of the book, but if you've already implemented bean-managed persistence in your EJBs using JDO, then you've probably already gotten past the point where this book is going to be a big help. In your case, it might be worth having around the office if you can get the company to pay for it. However, for those who have learned the Java language and want to get more involved in server-side application development, you're going to want to make sure you're familiar with all of these concepts and this book is the perfect way to get started with that. Where to find more info I'm not going to replicate the table of contents or any of the content in the book, because all of that information as well as the excellent sample chapter are available from O'Reilly's site. I purchased the book from SoftPro Books in Massachusetts (US), a bookstore for computer geeks. This is a good place to peruse the book if you're still riding the fence.

You can purchase the Java Database Best Practices from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

180 comments

  1. jabba by VAXGeek · · Score: 0, Offtopic

    why do i need a database for COFFEE?
    what's with all the COFFEE books?

    --
    this sig limit is too small to put anything good h
  2. Sounds like a winner... by Gortbusters.org · · Score: 3, Interesting

    Seriously, whenever the question of C++ vs Java comes up in a database environment the C++ in ya just wonders what can be done in Java. This book looks like it will shed some light on what ya should do and the various avenues to explore with databases and java.

    Let's all hop on the J-Band Wagon!

    --
    --------
    Free your mind.
    1. Re:Sounds like a winner... by molarmass192 · · Score: 1

      My take is that it depends on the app and your goals. C/C++ is generally faster and you get access to more in-depth APIs, at least with Oracle. Java through JDBC is easier to port to different databases and and platforms. JDBC has what I consider to be an advantage in that a lot of database drivers have "thin-client" implementations which means no additional client-side installs. However, almost all the work I've done with JDBC was for server side apps, typically accessing data through app server connection pools. So, if you want features features, features, the edge goes to C++, if you want portability, database and platform, the edge goes to JDBC.

      --

      Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
    2. Re:Sounds like a winner... by Anonymous Coward · · Score: 0

      ...what?

    3. Re:Sounds like a winner... by yintercept · · Score: 5, Insightful

      I tend to be a database snob, but just about any language that access the database gets its main power from the database. I personally have never seen much difference between accessing a database with Java, C++, PHP, PL/SQL, Visual Basic. Almost all of the programs are dependent on how well you design the database and the code pretty much follows from the relations with in the data.

      Java, of course, is the best language because it was developed with an overall higher level of coolness. It has like this oneness with the world thing going on. C++ goes faster. Visual Basic and PHP are easier for beginnning programmers. Still, ti seems to me that relations within the data are the key to database integration happiness.

    4. Re:Sounds like a winner... by BiteMeFanboy · · Score: 0, Flamebait

      Java, of course, is the best language because it was developed with an overall higher level of coolness. It has like this oneness with the world thing going on Hah. Thus spake the coder with no functional language skills... noob.

    5. Re:Sounds like a winner... by rutledjw · · Score: 1
      C++ is dead.

      It went the way of BSD years ago.

      ba-da-dum BANG

      --

      Computer Science is Applied Philosophy
    6. Re:Sounds like a winner... by Decaff · · Score: 1

      With Java and JDO you can write full-featured database apps, including queries in JDOQL, and ship the binary application, leaving it up to the customer to decide what JDO tool/server to use and what database engine to run the thing on, depending on their needs and budget. This is simply impossible in C++, Visual Basic etc.

      Its the 'Compile Once Deploy Anywhere' of Java that is the real winner.

      (And if you use the latest Java VMs from IBM you often find Java running faster than C++).

    7. Re:Sounds like a winner... by Pfhreakaz0id · · Score: 1

      Well, I wrote a VB app that did this, so I know it is possible. ADO is pretty database-agnostic (although there are some special SQL server techniques). I've personally written an app which just had an ODBC source setup with the common name using OLEDB provider for ODBC. It could use just about any relational db with an OLE db driver. I personally supported customers who used Pervasive SQL, SQL Server, an old Oracle version, and Access (ugh!).

      I did have to use connection.supports to do a few tests at run time to see if certain options were supported that were faster, but it was only in a few cases and I could have left it off if I wanted to.

      Also, couldn't you do this with a plain-jane JDBC implementation in Java? I'm pretty new to Java, so I could be wrong...

    8. Re:Sounds like a winner... by aligma · · Score: 1

      Not to troll, but although Java is good in many areas, C++ still does have its merits. C++ is still very much alive - Borland C++ Builder and Microsoft Visual C++, and Microsoft Visual C++ .NET are all three well supported and widely used IDEs from large companies. Seems to me like someone is getting alot of use from a "dead" language - and for practical business applications too!

    9. Re:Sounds like a winner... by Moraelin · · Score: 2

      Just about any language can gets its power from a database, but only as long as it's well programmed. Never underestimate the power of sloppy design, sloppy coding, lack of clue, or (my all time favourite) including useless buzzword technologies just because they're the latest hype with clueless managers.

      Yes, if you do a solid database design, and a solid program design which uses said database efficiently, in just about any language you can be as efficient as the database allows you to.

      However, you'd be surprised how a clueless design, riddled with inapplicable buzzwords (e.g., converting the data internally to XML and then parsing it right back, just because XML is a buzzword) and going through a billion unneeded and mis-designed extra software layers, can _crawl_ even when the database is mostly idle. Or generate a flurry of 1,000,001 individual querries to read 1,000,000 records, instead of doing it all in one go. (The n+1 querries problem is best known with Entity EJB, but in all honesty any badly designed OOP program can end up with the exact same problem.)

      Which I guess is why books are useful.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    10. Re:Sounds like a winner... by Hognoxious · · Score: 1
      Yes, if you do a solid database design, and a solid program design which uses said database efficiently, in just about any language you can be as efficient as the database allows you to.
      True. But unfortunately the guy who does does
      a clueless design, riddled with inapplicable buzzwords (e.g., converting the data internally to XML and then parsing it right back, just because XML is a buzzword) and going through a billion unneeded and mis-designed extra software layers...
      will be considered by the manglement, the marketroids & subhuman resources to be better, if he puts some animated gifs & rollovers on it. And changes the colour of the scrollbar.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    11. Re:Sounds like a winner... by ynohoo · · Score: 0, Flamebait

      Ha - gotta agree, although I think it applies to the reviewer and the author too.

      Java + Database = dumb idea.

      There is no best practice for a dumb idea. Sure, paint your pretty GUI with some inefficient Java on the client side, where the user is used to slow response. But keep it away from the production server database, where speed is of the essence.

    12. Re:Sounds like a winner... by BiteMeFanboy · · Score: 1
      Amen. Unfortunately, in the business world the language choice is usually chosen by the least common denominator. Java is easier (for people who shouldn't be programming in the first place), and a lot of kids coming out of college know only Java.

      Consequently there are projects here that would better be written in a different language, but Java it is.

    13. Re:Sounds like a winner... by jmccay · · Score: 1

      I bet you'd see a difference if you programmed c/c++ using ODBC to connect to databases using bound parameters. I was talking to a good friend who does Java programming, and he could think of something in Java that was equal to it--especially since Java doesn't have any pointers. Bound parameters speed things up a lot.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
    14. Re:Sounds like a winner... by Moraelin · · Score: 1

      Tell me something I don't already know :)

      Yes, I already know how management and marketroids will value graphics gizmos over content, and buzzwords over functionality. I'd think everyone who works in programming already knows that.

      I like to think, though, that that's still no excuse to throw a two hands up salute and produce a sub-par program. Even if you do end up putting animated gifs and rollovers and orange scrollbars on the program anyway, to make it manager-friendly and get your pay. (I ended up programming an orange-on-orange look and feel myself, much as it offended my eyes. Among many other manager-focused aberations.) Still, at the end of the day it's sorta nice to look back and think "well, that was a clean programmed and efficient program... in spite of the pointy haired interface."

      --
      A polar bear is a cartesian bear after a coordinate transform.
    15. Re:Sounds like a winner... by Anonymous Coward · · Score: 0

      > Just about any language can gets its power from a database, but only as long as it's well programmed.

      This is pretty obvious. IT=information technology, AKA the reason programmers exist. Where is information stored? in a database.

      > e.g., converting the data internally to XML and then parsing it right back, just because XML is a buzzword

      Ewwww. xml parsers are notoriously slow. I only use them when I have to. I still prefer quoted csv over xml. I am still having trouble understanding why a data centric document needs all of those stupid tags to increase the file size and obfuscate the data.

      I've been there, done that and still don't see the advantage that building permanently slow applications has over building fast ones. Especially considering it takes just as much, if not more programming knowhow and work to deal with xml.

      XML should only be used for xslt driven web pages and data interchange/SOAP messages and stuff like that. People that use it for anything else need their head examined.

      l8,
      AC

    16. Re:Sounds like a winner... by rutledjw · · Score: 1
      I was kidding. It seems like the "BSD id dead" posts keep appearing, so I thought I'd make a little tie-in.

      Bad joke, I think I'm the only one who got it...

      --

      Computer Science is Applied Philosophy
    17. Re:Sounds like a winner... by Anonymous Coward · · Score: 1, Interesting

      I don't see what bound parameters get you that jdbc PreparedStatements don't. Oh, except I have to do a virtual lookup which takes maybe a couple dozen cpu cycles. If you're trying to get performance gains of that level then your database design and middleware design and deployment must be god-like in its perfection.

      I agree with what others said: design is all here, a good dbase design and a clean middleware design to do sensible dbase hits (most importantly, to not hit the dbase more often than you need to, and to minimise holding dbase locks that block other transactions), is the biggest performance thing around.

      Dbase design is especially important for real enterprise apps: keep the dbase layer design clean and then you can scale your app servers and web servers horizontally to get as much throughput as any app could ever need.

      We're replacing a two-tier system that's heavily stored-proc based with a java app, and improving the performance of the apps key processes as we move it from ugly nested cursors to clean java code. But to achieve that you've got to be J2EE expert: that is, an expert on all 3 tiers, not just someone who does Java.

      Sean

  3. lacking by Boromir+son+of+Faram · · Score: 1, Flamebait

    Looks like they left out the best practice of all:

    Don't use Java.

    --

    Boromir, son of Faramir, King of Gondor and Minas Tirith
    1. Re:lacking by j4ck50n · · Score: 0, Flamebait

      You, with the stupid ass name...you really are an asswipe.

    2. Re:lacking by Anonymous Coward · · Score: 0
      That's funny, since that you once said this:

      http://slashdot.org/comments.pl?sid=55956&cid=5442 265

    3. Re:lacking by AKAImBatman · · Score: 1

      Aren't you the same guy who got the bright idea to run two copies of OSX on the new G5s simply because 64bit is "twice as large"? I hardly think you're qualified to be making a statment like "Don't use Java". Besides, I DO use Java and I even sell a database product based on it. (Keep an eye out over the next week or two for an awesome new version!) And I can say that Java is good for quite a few things *including* database access.

    4. Re:lacking by Anonymous Coward · · Score: 0

      " I even sell a database product [datadino.com] based on it."

      You must be poor then !! JAVA IS OVER

  4. hmmm by Anonymous Coward · · Score: 5, Funny

    "...I do not consider myself to be an expert on the subject."

    Well then, you should fit in perfectly with the rest of the Slashbots!

    1. Re:hmmm by Anonymous Coward · · Score: 0, Troll

      No, many on slashdot *do* consider themselves to be experts. Problem is, they aren't.

    2. Re:hmmm by Anonymous Coward · · Score: 1, Funny

      huh? I don't know about you, but I'm an expert on Java Databases. Sure, I didn't quite pass the community college intro to programming class, but I've thought about installing gentoo on my eMachines.

    3. Re:hmmm by Anonymous Coward · · Score: 2, Interesting
      There is alot of confusion around proper code practices. A better discussion is taking place on theserverside.com. Some people are too entrenched to change away from the rdbms centric approach(stored procedures, triggers, etc.). But for the rest of us, I recommend looking into the JCS code which when matched with an OR tool, gives the programmer ideal mapping tools. Apache is working slowly on a fine tool called OJB that will hopefully someday include full JDO support. Let them know you're interested. CMP - Container Managed Persistence BMP - Bean Managed Persistence JDO - Java Database Objects EJB - Enterprise Java Beans Here's a summary of the future for those of you who just want to observe from the gallery. I prefer open source tools personally, so most of the links are for those tools:
      EJB is problematic. Most(80% I'm guestimating) of programmers don't understand it but think they do. It is not 'THE' CMP solution, but one of them. Containers give you the ability to do clustering between app servers, which is a good thing. But EJB isn't the only one, compared set against ATG's superior repository API. Scope in EJB is also confusing and most programmers get this wrong, but the mapping is thus: request scope: stateless session bean session scope: statefull session bean global scope: entity bean If you don't understand scope, that is a different issue. But it is necessary for proper app server design to know the difference and use them correctly. JDO is most likely the future. It can or may not use a container. And gets around the flaws of every other mapping tool. Here is a synopsys of their flaws: A better architecture does not alter itself to fit the tools one is using but best fits the problem to be solved. For example, most tools like hibernate and castor suffer from the need to force the bean that is persisted to use public getters and setters. If you want to make your getter and/or setter private, default or protected scope, then you're out of luck. JDO doesn't have this limitation. In many designs, not every column in a table needs to be exposed to calling classes. EJB requires that a persisted bean implement an interface or subclass a parent. This also alters the design, and JDO makes no such requirements. Staying true to the best design to fit the problem, will give you the best return. Naturally, the world is moving away from stored procedures, joins and the like. Yes, really it is, you don't have to like it, just live with it. Although most of the foot dragging is by those who's past history doesn't include multi-threading and good OO design. Perl is a prime contributer here. Although Perl can do in memory object caching, most Perl mongers aren't familiar with it. It's much easier in Java though. But in-memory caching is a must have. That is the key concept behind best java database accessing practices. Using only request scoepd objects is less efficient.
      So by next year, JDO will be production ready. Until then use EJB or Cocobase, Castor, Hibernate or the like($) if you must have cluster(multiple app server) support. Otherwise, good old SQL(use a config file to load the SQL statements to avoid embedding) with a BMP design will do quite fine for a single box. Also, design from the object level, and not from the table level. This is heresey to some, but it is a (better)best practice.
      Note:
      With the release of JDK1.5, the use of external XML configuration files will be reduced or eliminated since source code markup will be added.
    4. Re:hmmm by flibuste · · Score: 1

      At least the /. people make useful remarks, unlike you.

  5. When is business speak going to die? by Anonymous Coward · · Score: 0, Offtopic

    "Best Practices" is yet another ridiculous business term that is crossing over into the IT world. It means nothing. Just like Stallman ripped on the term "Intellectual Property" last week, I will say that "Best Practices" is a term used to impress idiot suits. Just like IP, it covers a wide array of topics without giving any of them sufficient attention. Who needs this? Probably the suits who need to be fed pablum because they don't grok tech. But this word is generally useless for a majority of the world. Every time I see it used, I wnt to punch someone. Don't talk about "Best Practices", talk about the real issues: Security, Reliability, Robustness. When you talk about Best Practices, it makes you sound like a marketroid drone or yet another clueless, retarded suit.

    1. Re:When is business speak going to die? by DukeyToo · · Score: 2, Informative

      I think programmers get desensetized (spelling?) to some sorts of phrases, and some of us miss out because of it. Best Practices are actually a Good Thing(tm). They are what separates professional Software Engineers from most coders who don't have a clue about system design, and aren't interested in learning. There are some good books in this area, although the primary one escapes me now...

      --
      Most writers regard truth as their most valuable possession, and therefore are most economical in its use - Mark Twain
    2. Re:When is business speak going to die? by andy1307 · · Score: 5, Funny

      "Best practices" is common sense for 300$ an hr brought to you by an IBM consultant.

    3. Re:When is business speak going to die? by pmz · · Score: 1

      "Best Practices" is yet another ridiculous business term that is crossing over into the IT world.

      It does have a little meaning. Best practices are basically what a person would do after spending some time thinking about what would be an elegant way to solve a problem.

      Best practices are not achieved after one 30-minute meeting. Nor are they achievable by design-by-committee. They require people on a team to be honest, first, and political, last.

      Unfortunately, this rarely occurs in the real world, especailly due to the technological religious fanaticism present among most people.

    4. Re:When is business speak going to die? by f97tosc · · Score: 2, Insightful

      "Best practices" is common sense for 300$ an hr brought to you by an IBM consultant.

      This is true, but many IT departments don't have people with common sense, so this can still be a worthwhile investment. Better, say, than getting new hardware or software based on the IT departments own recommendations.

      Tor

  6. Transactions/Cursors by Twillerror · · Score: 5, Informative

    I always had a problem with APIs doing locking and transaction control.

    If your application really requires these things, you might want to get a database server that has direct support for them and write them as stored procedures. Straight SQL stored procedures can be very powerful, and can keep a lot of this messy logic where it belongs on the database server. Transactions should be short and simple as well.
    Having a hanging transaction is one of a DBAs worst nightmares.

    I think for the most part client/server applications are loosing ground to more of a three tier application scheme. In this case the cursor or the scrollable result set should be dumped, and instead just scroll through once and dump into a two dimensional array and access them this way. Grab and go.

    1. Re:Transactions/Cursors by Anonymous Coward · · Score: 0

      The APIs don't do the locking or transactions, the APIs offer an easy way to ask the database to do them for you.

    2. Re:Transactions/Cursors by Anonymous Coward · · Score: 0

      "Having a hanging transaction is one of a DBAs worst nightmares."

      Not in database systems which implements optimistic concurrency control such as Mimer SQL and Interbase. Locking-based transaction systems will hopefully be a thing of the past in the future...

    3. Re:Transactions/Cursors by sql*kitten · · Score: 1

      Transactions should be short and simple as well. Having a hanging transaction is one of a DBAs worst nightmares.

      I can guess you come from the Sybase world. Come over to Oracle, my friend. Writers do not block readers, readers do not block writers, locks never escalate and deadlocks are automatically detected and resolved. Transactions can therefore be as complex as you want them to be, you can't hurt the database with a bad one.

    4. Re:Transactions/Cursors by Anonymous Coward · · Score: 0

      Hanging transactions?

      Guess you have never heard of
      try
      catch
      finally

    5. Re:Transactions/Cursors by mrjive · · Score: 1

      I've been stuck in the depths of DB2 problems that are caused by these exact issues. Hanging transactions, lock escalations, deadlocks resulting in rollbacks or worse yet, timeouts. It's a mess.

      --
      If you can't beat them, arrange to have them beaten. -George Carlin
    6. Re:Transactions/Cursors by jazir1979 · · Score: 1

      Stored procs aren't so good if you want at least some level of database independance.

      --
      What's your GCNSEQNO?
    7. Re:Transactions/Cursors by Decaff · · Score: 1

      If you use Oracle as your J2EE app server, you can write standard, portable Java the code gets deployed in a VM embedded within the database engine, and runs very fast and optimised. Oracle allow Java to run like this because SecurityManagers can prevent code from doing bad stuff within the database engine. So, there is no performance advantage in using PL/SQL as against Java/JDBC in Oracle

    8. Re:Transactions/Cursors by Malcontent · · Score: 1

      Ask anybody who has done this and they will tell you what a bad idea it is.

      Putting business logic into the database is a tarpit which will doom your application.

      No unit testing, no way to organize your code into discrete files, no compiler to check the sanity of your entire codebase, no object oriented features (for MSSQL anyway), basically crappy SP languages. It goes on and on.

      Having said that most non microsoft databases support java as an SP language and that mitigates a lot of my objections.

      --

      War is necrophilia.

    9. Re:Transactions/Cursors by ChannelX · · Score: 1
      and deadlocks are automatically detected and resolved.

      Really? And just today i had to kill of an oracle process that was causing a deadlock....

      --
      My blog: http://jkratz.dyndns.org/~jason/blog/
    10. Re:Transactions/Cursors by Troll_Kamikaze · · Score: 1

      I can guess you come from the Sybase world. Come over to Oracle, my friend. Writers do not block readers, readers do not block writers, locks never escalate and deadlocks are automatically detected and resolved.

      While that's sound advice, it's not necessarily viable because of Oracle's high price. Note that the open source databases PostgreSQL and Firebird also implement multi-version concurrency control. Of course, Oracle easily outstrips them for overall feature set, but the point is: MVCC is available in much cheaper (free) RDMBSes than Oracle.

  7. Rating? by Tyler+Eaves · · Score: 1

    What's with all the ratings-that-aren't lately?

    --
    TODO: Something witty here...
  8. Beats by Niet3sche · · Score: 1

    the hell outta cursors with C against an Informix DB. That sucked. ;)

    1. Re:Beats by llamalicious · · Score: 1

      Mmmm... tasty, you bring back such fond memories.

      Nothing like plain old C code, with a sprinkling of E-SQL against Infomix SE and Vitamin C ansi libraries for UI handling, all run on SCO 3.2 (and 5.0.5)

      All this to handle dog licenses and deeds for county clerks. Oh the fun!!

      Thank you for making my ordinary day extraordinary! Bleh.

    2. Re:Beats by tcopeland · · Score: 1

      > you bring back such fond memories.

      On a government project a couple of years ago - HPUX, plain old C, Pro*SQL, and an Oracle 7.3 DB. And a text user interface, again written in pure C. The job security implications alone were staggering!

    3. Re:Beats by Anonymous Coward · · Score: 0

      ...all that Hell because They were too cheap to pick Informix 4GL, which eats apps like that for breakfast.

  9. OK, I'll bite by PhysicsGenius · · Score: 1, Troll
    There are many good and valid reasons to use Java, though they don't apply to everyone. For instance, Java is object-orientated which I understand makes code reuse better, I'm guessing because it makes Java plug-n-play. Also, Java has strong datatyping, unlike C, so if you are typing data then you want to use Java. And I think there are Web server modules that let you use Java on a webpage, which improves site usability.

    In short, please try to think before you make rash claims about how lame Java is. It might be too hard for your mother to use, but other people see that as merely being powerful.

    1. Re:OK, I'll bite by Anonymous Coward · · Score: 0

      god...worst...troll...evar. Seriously, just stop already. I've read some of your other trolls, and just when I thought you couldn't get any worse...here it is! I mean, just give up!

      YHNTS

      (You Have No Trolling Skillz)

  10. Skip this book. by donald+knuth+troll · · Score: 2, Funny

    Like all ORA books, this one was typeset using FrameMaker. FrameMaker! I urge you to boycott ORA until they come to their senses and use TeX to produce high-quality typesetting.

    1. Re:Skip this book. by DNS-and-BIND · · Score: 1

      I hate using framemaker. Poorly-ported Mac software is always the worst. Or maybe I'm thinking of pagemaker. Who cares, it sucks.

      --
      Shutting down free speech with violence isn't fighting fascism. It IS fascism!
    2. Re:Skip this book. by pmz · · Score: 1

      Like all ORA books, this one was typeset using FrameMaker.

      Hmm..FrameMaker is the only program I remember using that rivaled TeX in the flexibility of page layout and quality of the output. Framemaker even accepts EPS for embedded graphics.

      We should just be happy that O'Reilly chose a non-Microsoft application, because a Linux book written in Word, for example, would not only be hideous in appearance but leave OSS users seriously conflicted.

    3. Re:Skip this book. by Anonymous Coward · · Score: 0

      Their biography of RMS was written with non-FREE software. I think FrameMaker uses some TeX paragraph justifying algorithms (which is ok because TeX is public domain, and hard to avoid since TeX was the most ambitious and thorough typesetter when it was created).

    4. Re:Skip this book. by Anonymous Coward · · Score: 0

      factoid: the sendmail book and a number of the other unix books are laid out with troff

    5. Re:Skip this book. by mrm677 · · Score: 1

      I hate using framemaker. Poorly-ported Mac software is always the worst. Or maybe I'm thinking of pagemaker. Who cares, it sucks.

      Framemaker was originally developed on Unix.

    6. Re:Skip this book. by fishermonger · · Score: 1

      From (the late) Richard Stevens' site: A friend commented to me that normal evolution would have gone Word to Frame to troff, but instead, the computer industry has gone the other way!

      --
      "...normal evolution would have gone Word to Frame to troff, but instead, the computer industry has gone the other way!"
    7. Re:Skip this book. by Anonymous Coward · · Score: 0
      The dragon book used troff, eqn, pic, and sed (or awk?) to do the bibliography.


      I hate to think of how hard it was *before* computers :)

  11. Nightmares?? by Anonymous Coward · · Score: 0

    Having a hanging transaction is one of a DBAs worst nightmares.

    So, DBAs don't have a whole lot to worry about in this world, eh? If that's your worst nightmare, you should consider yourself a very luck man.

  12. That's not irony! by blissful+ignorant · · Score: 1

    It's just coincidence! I read it on Slashdot -
    See!

    --
    Valete!
  13. Sounds like it is missing... by under_score · · Score: 3, Interesting

    good information about one of the most important aspects of persistance in an object oriented language: Object Relational Mapping. I haven't read the book myself, but if it doesn't cover Java OR mapping layers such as Cocobase, Toplink and EOF (part of WebObjects), or any of the open source OR mapping frameworks, and the theoretical foundation they are all based on, then to me it isn't worth it.

    1. Re:Sounds like it is missing... by leomekenkamp · · Score: 1

      I also missed something on odbms...

      --
      Wenn ist das Nunstueck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.
    2. Re:Sounds like it is missing... by eduardodude · · Score: 1

      The reviewer said the book covers Hibernate. This is an O/R mapping tool.

    3. Re:Sounds like it is missing... by Decaff · · Score: 2, Informative

      There is little need for information about such proprietary OR mapping layers these days, as there is now a standard for such things: Java Data Objects (JDO). This is a full-featured OR API that is well documented (see 'Java Data Objects' by Robin Roos), and has a large number of commercial implementations, and free implementations are available from Sun and Apache.

  14. Insightful Post by GillBates0 · · Score: 3, Funny
    I was excited to read this book when I first noticed it listed as "coming soon" in the Java section of O'Reilly's site back in May. I downloaded and read the sample chapter and waited expectantly for the book to be released. I was hoping that this book would be perfect for me, as nearly all of the Java programming I have done has dealt in some way with database access, though I do not consider myself to be an expert on the subject.

    I was excited to read this title when I first noticed it listed on the Slashdot site soon after lunch. I downloaded and read the first couple paragraphs and waited expectantly for the material to seep through. I was hoping that this article would be perfect for me to post an insightful reply on as nearly all of morning, I have been feeling dull and stupid. though I am usually not so.

    Anyway, I don't think it's working. I give up.

    --
    An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
  15. ROFL by Bame+Flait · · Score: 0, Flamebait

    Your post was so stupid that it got modded troll!

    so if you are typing data then you want to use Java

    that let you use Java on a webpage

    retard

    1. Re:ROFL by Anonymous Coward · · Score: 0

      that's because it was a troll (PhysicsGenius is a known troll). and a stupid one at that.

  16. Sample chapter slashdotted by Anonymous Coward · · Score: 0, Insightful
    1. Re:Sample chapter slashdotted by Anonymous Coward · · Score: 0

      Do not follow parent link. If you have javascript enabled, you'll have to kill the browser window.

  17. Ok here is a java question by ACK!! · · Score: 2, Interesting

    How many people out there use java in their web based apps that interface with a database server backend?

    What platforms do you use for development?

    What Dbs do you use?

    What web server?

    Why?

    Inquiring minds want to check your java intake and output.

    --
    ACK /ak/ interj. 2. [from the comic strip "Bloom County"] An exclamation of surprised disgust, esp. i
    1. Re:Ok here is a java question by Mr.+Competence · · Score: 1

      How many people out there use java in their web based apps that interface with a database server backend?

      My teams do

      What platforms do you use for development?

      Windows

      What Dbs do you use?

      MSSQL

      What web server?

      Apache/Tomcat

      Why?

      Because all of our server side programs are written in Java. We deploy to both windows and Linux, Java has increased our productivity over C++, performance is on par with C++ for our systems (sometimes slower, sometimes faster), it means we have one technology for web and programming, we like WebStart for internal apps, etc.

      Before anyone asks, we have been doing this since 2000 so C# wasn't even an option.

      Inquiring minds want to check your java intake and output

      --
      Those who open their minds too far often let their brains fall out.
    2. Re:Ok here is a java question by pmz · · Score: 3, Interesting

      How many people out there use java in their web based apps that interface with a database server backend?

      I would bet that nearly all the use of Java is for web-based apps that interface to a database.

      What platforms do you use for development?

      For Java, it would be J2SE from Sun (it includes JDBC).

      What Dbs do you use?

      Oracle, MySQL, PostgreSQL, DB2, etc.

      What web server?

      Apache, WebLogic, Sun ONE, etc.

      These questions, at face value, mainly answer themselves. Perhaps a better question would be: what do Java programmers do to prevent database applications from turning into a quagmire of naive mistakes and bottlenecks making a well-intentioned application into a sick joke of engineering?

      Database programming is one of those things that is simple enough, at first glance, to be attempted by every college sophomore on the planet, but complex enough, in reality, to make people who hired those college sophomores look foolish.

    3. Re:Ok here is a java question by msobkow · · Score: 4, Interesting

      Platform doesn't matter much. Linux, Win32, AIX, Solaris -- they've all got decent Java IDEs and JDKs.

      Databases just need to be full-featured. Sybase, DB/2, Oracle, PostgreSQL -- I don't care as long as it's got a full feature set including sequencers, triggers, and stored procs (in that order of usefulness.)

      Web servers are irrelevant to the back end development. The web server has hooks that redirect certain pages or page types to the "rich" environment of a J2EE or equivalent framework. Even Apache doesn't embed Tomcat, but cooperates with it to share the duties (let Apache do what it does best -- server up simple content, and let Tomcat/J2EE/JSP do what it does best -- serve up functionality with a corresponding performance hit.)

      --
      I do not fail; I succeed at finding out what does not work.
    4. Re:Ok here is a java question by BiteMeFanboy · · Score: 1

      Personally, I've found that Tomcat, with an Apache bridge, on a Linux box, though we still have Sun's floating around, and Oracle does a bang up job. Oracle isn't my personal favorite, but we're doing well with this setup. Heavy use of stored procedures, makes the middle tier code generally short and sweet and a JSP front end makes for quick GUI building. Of course YMMV.

    5. Re:Ok here is a java question by iabervon · · Score: 1

      I'm using Java for a data warehouse web app (which is somewhat different from the usual database app, because there aren't significant amounts of data going in through the application). We develop on Linux and Windows and will deploy on Linux. We're using Oracle and Tomcat.

      We're using Java mainly because we used it for a previous project and it worked well; switching to a different language, including evaluating, leaning, and determining good practices would not be worthwhile. We're using Oracle and Tomcat for similar reasons. We're going to deploy on Linux because it has better performance, and because it's Oracle's primary platform.

    6. Re:Ok here is a java question by jabber01 · · Score: 1

      I do.

      JBuilder, and now increasingly Eclipse.

      Oracle.

      WebSphere.

      Because that's what the company has bought.

      --

      The REAL jabber has the user id: 13196
      What you do today will cost you a day of your life

    7. Re:Ok here is a java question by markv242 · · Score: 2, Interesting
      What platforms do you use for development?
      NetBeans hooked into a CVS server. It offers a huge amount of functionality (nearly competitive with JBuilder) and it is free.
      What Dbs do you use?
      Oracle 8i, although we're migrating to Oracle 9 fairly shortly. High-availability, clustering, and reliability. Oracle cannot be beaten.
      What web server?
      Apache 2.0 in "worker" MPM mode. Multi-threaded, multi-process. Provides the stability of Apache 1.3 (multi-process so if one process crashes, no problem, they just get started right back up) along with a huge speed increase due to the multithreading. Changing from Apache 1.3 to Apache 2.0 in worker mode, tuned correctly, will give you a 500% capacity and speed boost, easily. We have gone from approximately 85 simultaneous connections max, running at about 200 requests per second, to over 2500 simultaneous connections running at 900 requests per second, on the same hardware.
      Why?
      You forgot the most important question. "What application server are you using?" We aren't using EJBs, so we only need to run a servlet runner. Resin is an amazingly quick app server for our purposes.
    8. Re:Ok here is a java question by BigGerman · · Score: 1

      several projects over last 5 years:

      os/web server/application server/database

      Linux/Apache/Oracle AS( piece of shit) / Oracle
      NT/IIS/Tomcat/SQL Server
      NT/IIS/Web Logic/SQL Server
      Linux/Apache/Web Logic/Oracle
      Solaris/Apache/Oracle AS/Oracle

    9. Re:Ok here is a java question by easter1916 · · Score: 1

      Solaris is Oracle's "primary" platform, if there is such a thing.

    10. Re:Ok here is a java question by Anonymous Coward · · Score: 0

      < posting as AC >

      How many people out there use java in their web based apps that interface with a database server backend?

      < raises hand >

      What platforms do you use for development?

      Local environments run on Win2K or XP Pro. Some developers have "stealth" environments running some flavor of Linux. JBuilder 8 Enterprise. TogetherJ modeling tools. Our test and production systems run Solaris exclusively. I use Win2K myself and XML Spy is my primary tool of trade.

      What Dbs do you use? Sybase.

      What web server? Tomcat for the app server (with Xalan performing the XSL transformations of XML to HTML), Apache for the front end. Our architecture is rather monolithic--ideally we would be doing XSL transformations on the Apache cluster, where it would probably go a lot faster. Part of the reason for this, perhaps, is that we must continue to interface with that most monolithic computing monstrosity, the GDS mainframe (GDS = Global Distribution System, a provider of worldwide travel reservation information).

      Why? Heh, good question. I think our "standardization" on Solaris is mostly political (we did use Linux on our Apache clusters at one time). Our technical Powers That Be seem awfully suspicious of anything that even whispers "open source," yet we dropped WebLogic in favor of Tomcat due to horrible performance.

      Inquiring minds want to check your java intake and output.

      More like we output a shitload of XML, but it's all driven by Java and a Sybase back-end.

    11. Re:Ok here is a java question by Anonymous Coward · · Score: 0

      How many people out there use java in their web based apps that interface with a database server backend?

      What platforms do you use for development?
      Win2k
      What Dbs do you use?
      Oracle
      What web server?
      IIS
      Why?
      company-wide initiative to write all "gadgets" for our portal in java (from asp)

    12. Re:Ok here is a java question by Anonymous Coward · · Score: 0

      1. lots of people

      2. Linux, various Win32 (each developer gets to choose his own desktop OS)

      3. Oracle, Sybase, Postgres, Mysql

      4. WebSphere, Tomcat/Apache, JServ/Apache deployed variously on AIX, SunOS, NT

      5. Minimize development time/costs.

    13. Re:Ok here is a java question by ceswiedler · · Score: 1

      Provides the stability of Apache 1.3 (multi-process so if one process crashes, no problem, they just get started right back up) along with a huge speed increase due to the multithreading.

      Are you running Apache on Windows?

      I'm not aware of any other platforms that gain much from multithreading. Though possibly NPTL on Linux will change that (but surely you aren't running the 2.5 kernel).

    14. Re:Ok here is a java question by znaps · · Score: 1
      How many people out there use java in their web based apps that interface with a database server backend?

      Almost everyone.

      What platforms do you use for development?

      Eclipse, Websphere Studio Application Developer

      What Dbs do you use?

      SQL Server 2000

      What web server?

      Apache/Tomcat/JBoss

      Why?

      Because they're all any 2 of the following 3:

      a) Free
      b) Easy to use/configure
      c) Powerful

      Actually, Websphere is only (c), but meh...

    15. Re:Ok here is a java question by markv242 · · Score: 1
      Solaris.

      The problem with Apache 1.3 is that each connection requires a separate instance of the child process, which in turn takes up 2 megs (or so) of memory. Multiply that by 500 concurrent clients, and you see the bottleneck right there.

      With 2.0 in MPM mode, each process (which we have configured to take 250 threads/children) takes up about 30-40 megs of memory. 500 concurrent clients takes up 80 megs of memory, as opposed to the 1 gig of memory with Apache 1.3.

      So the issue isn't that multithreading necessarily speeds up individual requests, but you can handle a lot more requests with a lot less footprint.

    16. Re:Ok here is a java question by Anonymous Coward · · Score: 0

      I've been told, by people in a position to know, that Oracle does their development on SuSE Linux.

      Also, according to http://www.cioupdate.com/trends/article.php/156082 1 three-quarters of Oracle's servers ran Linux as of December 2002.

    17. Re:Ok here is a java question by markv242 · · Score: 1
      "yet we dropped WebLogic in favor of Tomcat due to horrible performance."
      If all you're doing is XSL transformations, Weblogic shouldn't be any slower than Tomcat if you're using the same XSL parser. That said, I understand the memory/services overhead that Weblogic has. If you aren't doing EJB, Weblogic is serious overkill.

      This may sound like a bad pitch/endorsement, but you may want to consider switching from Tomcat to Resin. Resin provides all the same functionality that Tomcat does, and is quite a bit faster. Tomcat, remember, is still just a "reference implementation" of the Servlet and JSP specs. Resin has been written from the ground up to be speedy. Its DataSource pooling is second to none, and (imho) changing an application's configuration is a lot less painful under Resin than under Tomcat. Last I checked, Resin had a price tag of $500 -- comparable to Weblogic Express without all the BEA hassle.

    18. Re:Ok here is a java question by semanticgap · · Score: 1

      Apache 2.0 in "worker" MPM mode. Multi-threaded, multi-process. Provides the stability of Apache 1.3 (multi-process so if one process crashes, no problem, they just get started right back up) along with a huge speed increase due to the multithreading. Changing from Apache 1.3 to Apache 2.0 in worker mode, tuned correctly, will give you a 500% capacity and speed boost, easily. We have gone from approximately 85 simultaneous connections max, running at about 200 requests per second, to over 2500 simultaneous connections running at 900 requests per second, on the same hardware.

      Just curious - does performance of Apache really matter, i.e. wouldn't you reach the capacity of your app server (Resin in this case) way before you reach any limit of Apache?

    19. Re:Ok here is a java question by markv242 · · Score: 1
      Just curious - does performance of Apache really matter, i.e. wouldn't you reach the capacity of your app server (Resin in this case) way before you reach any limit of Apache?
      Nope. Think about this-- say you have a page that is made up of:

      - 1 JSP page
      - 1 CSS file
      - 1 JS file
      - 7 images

      90% of your content is static, and can therefore be served up by Apache. Even by limiting Resin's threads to 250 simultaneous, you can safely set Apache up to handle 2500 concurrent requests, realizing that 90% of those requests will be handled by Apache itself.

      Another bonus speed boost that we use in Resin is the ExpiresFilter, which (for pages that don't use sessions) acts as a reverse proxy (in memory). By setting the filter to cache pages for even as little as 5 minutes, you get a huge performance increase by serving up 99% of your JSP hits straight from cache. That will cause that thread in Resin to be returned to the thread pool that much quicker.

      It's the small tuning pieces that add up to really big performance gains; I can honestly say that I can serve up pages almost as fast as a server that's doing nothing but static content.

    20. Re:Ok here is a java question by man2525 · · Score: 1

      Database programming is one of those things that is simple enough, at first glance, to be attempted by every college sophomore on the planet, but complex enough, in reality, to make people who hired those college sophomores look foolish.

      Unfortunately, I can relate. When I explained the difficulties of designing a web-based reservation system for my department to my boss, he said, "We'll just have to have someone do it for a class project."

      I work at a college.

    21. Re:Ok here is a java question by iabervon · · Score: 1

      Solaris used to be their preferred platform, but it's now Linux. At least, that's what Oracle sales told me this May. Evidently, they've gotten enough of the features they want into recent kernels.

    22. Re:Ok here is a java question by praxis · · Score: 1

      A full featured database, for me, should include these features (in order of usefulness):

      1) transactions
      2) sequencers
      3) stored procedures
      4) triggers

    23. Re:Ok here is a java question by rutledjw · · Score: 1
      Oracle isn't my personal favorite, but we're doing well with this setup.

      Try DB2, you'll be loving Oracle in no time.

      Unless you can try a MySQL or PostGRES, I don't know much about either, but have heard good things about them both.

      --

      Computer Science is Applied Philosophy
    24. Re:Ok here is a java question by Anonymous Coward · · Score: 0

      >How many people out there use java in their web based apps that interface with a database server backend?

      from the responses to your post, apparently almost everyone. In fairness, I use Tomcat/JSP for the web-based stuff and mostly program standalone application clients.

      >What platforms do you use for development?

      All those which support Java ( mostly OS X, in my case ).

      >What Dbs do you use?

      PostgresQL.

      >What web server?

      Apache w/Tomcat

      >Why?

      beats the hell out of the alternatives in any metric I can care about. Why would you use anything else, unless you like being tied to a specific hardware or software platform?

    25. Re:Ok here is a java question by dekashizl · · Score: 1

      What platforms do you use for development?
      Linux and win32 servers (doesn't matter), win32 dev machines, cmdline build tools (ant, javac, etc.), personal editors of choice.
      What Dbs do you use?
      MySQL 4. It is free, fast, small footprint, and now supports transactions.
      What web server?
      Tomcat. Free, simple.
      Why?
      Building a SOAP-based server with persistence. App runs on Axis on Tomcat on MySQL, with custom direct persistence. Minimize number of components to simplify system and possibility of failure/bugs. For more performance, load balance onto extra servers (cost of cheapo hardware only, since all sw OS/db/middleware is free) and/or beef up DB machine depending on bottleneck.

      In general, if you have small tight components, you understand very well how they work and what they are doing, and you design your models well, then your app has the chance of running efficiently without needing mega servers and a huge development crew.

    26. Re:Ok here is a java question by Jmstuckman · · Score: 1

      How many people out there use java in their web based apps that interface with a database server backend?

      Me

      What platforms do you use for development?

      Win32

      What Dbs do you use?

      DB2

      What web server?

      WebSphere Application Server

      Why?

      That's what my company has.

    27. Re:Ok here is a java question by Mr.+Piddle · · Score: 1

      "We'll just have to have someone do it for a class project."

      I swear that Universities get by with the cheapest renewable labor force possible. Class projects, computer programmer summer jobs at $6.50/hour, etc....

      Unfortunately, it just ends up creating a pile of square wheels collecting dust somewhere, and the resulting experience graduates and moves out of state.

      --
      Vote in November. You won't regret it.
    28. Re:Ok here is a java question by Tsali · · Score: 1

      No Java.NET adopters? :-P

      ducks...

      --
      This space for rent.
    29. Re:Ok here is a java question by ChannelX · · Score: 1

      ummm..you can write Java on .NET just as easily as C#. J# lets you access all .NET stuff with Java syntax.

      --
      My blog: http://jkratz.dyndns.org/~jason/blog/
    30. Re:Ok here is a java question by Tsali · · Score: 1

      True, but who's using it?

      --
      This space for rent.
    31. Re:Ok here is a java question by BiteMeFanboy · · Score: 1
      I prefer MySQL. Documentation tends to be more accessible, and it tends to be faster. However, there are obvious features missing when compared to Oracle.

      Those are the only two I've had extensive experience with though.

  18. "Best Practices" by kin_korn_karn · · Score: 1

    If there are these "Best Practices" that are endorsed by the language makers, then why the hell don't they just constrain the language to only allow you to program in the "best practice" way? I mean, why allow you to screw up and use "worst practices" when they already know the best way? It seems like a setup to me.

    1. Re:"Best Practices" by smack.addict · · Score: 4, Interesting
      Disclaimer: I am the author of the book being reviewed.

      I have never quite figured out why some developers have a visceral negative reaction to the expression "best practices". In any field, a best practice is nothing more than a rule of thumb that guides your decision making. It is a heuristic.

      Best practices cannot be fully incorporated into a language. Java does a good job of that, but new best practices grow from further use. As the reviewer noted, the chapters on newer technologies (e.g. JDO) were lighter in this book because programmers simply have not had as much experience in developing best practices with those technologies as with older ones (e.g. JDBC).

      Furthermore, a best practice is not something you get sent to the electric chair for violating. When your decision violates a best practice, the "best practice" status simply indicates that you need to understand why it is a best practice and make sure you go to great lengths to justify its violation. On the other hand, you do not need to think a lot about sticking with a best practice.

      By leveraging best practices, you simply gain a short-cut in decision-making. For those people who would say "short-cuts in decision making are bad", get real. Short cuts are necessary. You cannot analyze all possibilities resulting from every decision you make. Otherwise, you would never manage to flip a switch to turn on a light bulb.

    2. Re:"Best Practices" by kin_korn_karn · · Score: 2, Insightful

      Thanks for the thoughtful response.

      I think a lot of us react negatively because Best Practices are often pushed by architect types that don't write code but they have all the Best Practice books and they use those to evaluate your output. In other words, they can be used as a crutch for the unknowledgable.

      Also, there are the questions of "just who decided that these were the Best Practices anyway?" and "What exactly about them makes them Best?" Those are questions that aren't usually answered before the Best Practice is pushed on you.

      Some developers have egos that keep them from from using any sort of guide to coding past the learning stage. These people feel that if you always follow a "Best Practice", coding becomes little more than cutting and pasting. I'm guilty of this sometimes, but my main gig is maintaining old Perl/CGI apps, something I've been doing for 7-8 years. Sometimes to maintain my sanity I HAVE to do it differently.

    3. Re:"Best Practices" by homebru · · Score: 1
      ... why the hell don't they just constrain the language ...

      Because when language developers constrain the language to what they want users (application developers) to do, you wind up with something like dBase II; primitive, non-extensible, and extremely frustrating.

    4. Re:"Best Practices" by haystor · · Score: 1

      I think the greater problem with hearing "best practices" from the Java crowd is that they keep changing them.

      Also, a lot of these "best prctices" are pushed out by Sun's marketing well before any sort of performance is up to par.

      And finally, if people were really capable of following "best practices" why the hell did Java have to be dumbed down to the lowest common denominator? If we assume people can code to "best practices" then Java would never have come about. That's its chief selling point, you can find just any java programmer to fill in.

      --
      t
    5. Re:"Best Practices" by JaredOfEuropa · · Score: 1

      "I have never quite figured out why some developers have a visceral negative reaction to the expression "best practices". In any field, a best practice is nothing more than a rule of thumb that guides your decision making. It is a heuristic. "

      Developers are allergic to the expression, not to the concept. Call it "design patterns" next time and you'll have them all worshipping at your feet.

      --
      If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
    6. Re:"Best Practices" by smack.addict · · Score: 2, Insightful
      Every language, not just Java, has best practices. In fact, every thing--from using scissors (don't run with them) to playing right field (play to your right when a right-handed batter is at the plate)--has best practices.

      And best practices are always evolving. Many past best practices for Java are no longer best practices because Java has changed. Sometimes best practices help you get around a flaw in the underlying tool (like closing result sets and statements in JDBC code). Those best practices eventually become addressed by the tool itself and thus become outdated.

      In short, there is nothing wrong with the fact that best practices change. Furthermore, I seriously doubt Sun's marketing department is in any way involved with the concept of best practices.

      And finally, if people were really capable of following "best practices" why the hell did Java have to be dumbed down to the lowest common denominator?

      As I stated before, a best practice sometimes should be violated. Java cannot and should not enforce every best practice since sometimes you need to violate it. Java tries very hard to choose the right point in the continuum between best practice and "coding law".

      Sometimes it may come down on the wrong side by treating some things as best practices that should be law or as treating as law something that should be a best practice. All in all, I think they did a great job even if not close to perfection.

    7. Re:"Best Practices" by Hognoxious · · Score: 1
      Java cannot and should not enforce every best practice since sometimes you need to violate it.
      So why is it does it enforce the object paradigm? Math.sin() indeed. Why no operator overloading - except where they think it's OK e.g. string concatenation?
      Java tries very hard to choose the right point in the continuum between best practice and "coding law".
      Tries schmies. I judge by yardage gained, not sweat expended.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    8. Re:"Best Practices" by smack.addict · · Score: 1
      Tries schmies. I judge by yardage gained, not sweat expended.

      Is there a language that does this perfectly? No. Few languages even try. Of those, IMHO, Java is the best at making the balance, even if imperfect.

    9. Re:"Best Practices" by haystor · · Score: 1

      Java didn't really try to do this or else we wouldn't have primitives today. If someone cares to say something about speed and optimization, I'd like to preemptively reply, "are you kidding?"

      Java was not made to be useful. It was made to be less complex so that the common programmer can understand it.

      A "best practice" should of course change as appropriate, but the shouldn't be changing this damn fast.

      Oops, just replying to the wrong point in the thread. If you take offense, please offend someone else until it reaches the right person.

      I hear your pain about Math.sin(). Even VB and JavaScript can fix that problem for you. Java requires you to wrap a local function around it however. I suppose that does add to lines of code and that's productivity.

      --
      t
    10. Re:"Best Practices" by Hognoxious · · Score: 1
      No. Few languages even try.
      Wonder why? Maybe, just matbe, it's because it's not the language's job to do that.
      Do languages prevent you from clone & hack disease?
      Do languages prevent you calling your variables things like BVBVBVBV8UBVBW8V?
      Do langauges enforce meaningful commenting?
      Java doesn't even have a goto FFS, how broken is that?
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    11. Re:"Best Practices" by smack.addict · · Score: 1
      Wonder why? Maybe, just matbe, it's because it's not the language's job to do that.

      No, that is not why. It is simply a relatively new philosophy in language design. And it seems to work a hell of a lot better since it lowers the learning curve and empowers people to successfully build software that previously could not.

      Java doesn't even have a goto FFS, how broken is that?

      Not broken at all. There is no need for goto.

    12. Re:"Best Practices" by Anonymous Coward · · Score: 0

      No need to pack a sad, just because people have been ragging your book.

  19. Best Practices in IT by yintercept · · Score: 3, Insightful
    People have been using the term "best practices" in IT for as long as I can remember.
    Don't talk about "Best Practices", talk about the real issues: Security, Reliability, Robustness.
    Let's see: Security. The biggest issue in security is generally the people...how they define passwords, what things they let go through firewalls, what things they should and shouldn't do. The security expert cannot completely make a network safe...they must define a best practices and go from there.

    Reliability: I may be totally off base, but it seems to me that consistency is a factor in reliability. Assuring that things are written in a consistent manner generally involves defining best practices. I have seen many programs fail because a coder used inconsistent naming conventions.

    Likewise Robustness seems to follow from having defined best practices.
  20. Thanks by Anonymous Coward · · Score: 0

    This place needs more rational arguments like yours and less knee-jerk reactions like the parent post. Moderators, please don't let this gem slip under your radar.

  21. ODBMS by Anonymous Coward · · Score: 1, Funny

    I agree, they need more coverage on ODBMS, especially since ODBMS will replace the legacy RDBMS by 1999.

  22. n-tier applications by msobkow · · Score: 2, Insightful

    Multi-tiered applications still require database code, database locking, and data sharing. While the client does not have access to a cursor or "scrollable result set", those features are still used at the back end where the system interfaces to the persistant storage (RDBMS.) Caching them as an array is only viable if the data is stable during your application's execution (lookups), or if your application is the only one accessing the database.

    I agree that using application code to implement locking or sequencers is a poor approach. If those features are required, use a real database that supports them. Butchering an application design to work around limitations of less-robust databases like MySQL is foolish when you can get the desired functionality for free with products like PostgreSQL or a commercial database. It will also save you a lot of coding and debug time, letting you focus on application functionality, not infrastructure features.

    --
    I do not fail; I succeed at finding out what does not work.
    1. Re:n-tier applications by tcopeland · · Score: 1

      > Caching them as an array is only viable
      > if the data is stable during your
      > application's execution

      Or you can do an optimistic locking kind of thing... which takes a little more effort, but works well as long as everyone isn't updating the same row.

      > products like PostgreSQL

      +1. Postgres rocks.

  23. Clustering and Sequences by smack.addict · · Score: 5, Informative
    Implementing a sequencer at the application level (one of the "best practices") is a much better idea if you're not clustering your application servers and other applications will not be performing INSERTs into the database.

    Actually, with some slight transactional modifications, it can be used in a clustered environment as designed. It was, in fact, originally designed to support a clustered pre-EJB application. I made the transaction support for the sake of this book simpler to illustrate the point.

    The key to this scheme is that each application gets its own sequence key, so multiple applications or cluster nodes are free to generate unique IDs without duplication by other nodes or applications.

  24. In Java??? by SuperKendall · · Score: 1

    I was going to just mod you down, but I couldn't find the "crazy" mod.

    In years of working with databases (mostly Oracle) I've yet to have a problem with Java, locking, and transaction control.

    What can happen is you forget to close a connection - but that's just poor coding. Going though the relatively extreme agony of defining a bunch of stored procedures instead of making people using "finally()" for close statements just makes no sense - at least for Java. The JDBC API is very mature, and as someone else noted it's not the library doing the actual locking or transaction work, it's the DB (at least for Oracle, perhaps other drivers do things differently when your database does not support locking(?!).

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  25. Application level sequencer == BAD by wemmick · · Score: 4, Insightful
    ...I myself have recently run into the problem of different sequencing systems on different databases (such as MySQL's AUTO_INCREMENT column type vs PostgreSQL's sequence types). I've worked around it by modifying the application's database calls, but that isn't really a good strategy. Implementing a sequencer at the application level (one of the "best practices") is a much better idea...

    I disagree. Why do you want to reimplement database features such as sequences when the developers of MySQL, PostgreSQL, Oracle, Sybase, etc. have spent plenty of time optimizing it. Ask Tom Kyte (of Oracle) his opinion about doing something like that -- here's his answer.

    "But," you say, "that will mean making different versions of my code for each different database." Not exactly. Take a look at the implementation of Hibernate which uses classes such as OracleDialect and MySQLDialect which are subclasses of Dialect. Each of these specific dialects implements vendor-specific code for sequences (and others). This allows the application level code to maintain its database independence while at the same time taking advantage of the vendor-specific features.

    Doug

    --
    ___
    Cognitive Overflow
    more than yo
    1. Re:Application level sequencer == BAD by smack.addict · · Score: 1
      Application sequencers are the correct approach. You use as the only supporting evidence behind your claim that "Application level sequence == BAD":

      Ask Tom Kyte (of Oracle) his opinion about doing something like that

      In that article, Tom talks about a specific kind of application-level sequencer. The sequence he talks about is, in fact, a bad sequencer. When implementing an application-level sequencer, you must take into account the following:

      • Generated IDs must be guaranteed to be unique.
      • The act of generating a new ID must not impact performance negatively.
      The example I provide in the book meets both conditions. In fact, it gets around common deficiencies in database-specific sequence generation schemes.
    2. Re:Application level sequencer == BAD by Anonymous Coward · · Score: 0

      Mr. Kyte, while often a wealth of knowledge, often makes sweeping pronouncements enabled by his seemingly endless penchant for arrogance. There are indeed very real, efficient, and necessary reasons for use of application-level "sequences". The most obvious would be legacy compatibility. That aside, however, the notion of globally unique identifiers (guids) alone often drives application-level (or middle-ware level) unique id generation. It is, of course, very easy to implement something like this very efficiently using some memory/math tricks of old (c/c++ like), coupled with a componentized service, such as a stateless session bean.

      You have my word, our application regularly handles loads whereby 5,000+ guids are simultaneously requested from the service layer without any significant impact on performance. Perhaps Mr. Kyte can tell us instead why Oracle doesn't address the fact that FORALL doesn't solve context switching problems when dealing with Object-Tables with many levels of nested object tables, and one is forced to use VARRAYs for everything.

    3. Re:Application level sequencer == BAD by pHDNgell · · Score: 1

      That page gave an example of a bad way to do it. There are also good ways to do it. I'm sure there are many implementations of things similar to my GetPK.

      This provides application level sequences in a cluster and bypasses a lot of performance issues. Combined with my hierarchial storage model, it allows us to build out large complex trees of objects where the objects all know the primary keys of all of the objects as they will be if they get stored in the DB. The framework also allows us to ensure the tables get updated in the correct order so the DB can maintain the RI.

      Different keys can have different burn rates so keys that get used up quickly can produce no greater performance hit against the DB than keys that are rarely needed.

      This does not guarantee that the keys are given out exactly in sequence, but I've rarely seen it necessary.

      --
      -- The world is watching America, and America is watching TV.
  26. Junior vs Experienced by msobkow · · Score: 2, Insightful

    The junior and intermediate developers need "best practices" as a guideline while they learn. The experienced developer knows when to step out of the "best practices" to get performance and features that are needed by the application.

    Think of it as driving a car. Most people will never need nor experience the handling of performance car -- the "best practices" of a normal powertrain and suspension are all they need. That doesn't mean there aren't people out there who will make good use of the extra functionality and features.

    --
    I do not fail; I succeed at finding out what does not work.
    1. Re:Junior vs Experienced by kin_korn_karn · · Score: 1

      OK, fair enough - so why do some books and classes for beginners teach outside of the best practices?

    2. Re:Junior vs Experienced by mark_lybarger · · Score: 1

      probably because that's what the authors are learning, and that's the hot topics. 8 years ago, c++ classes were teaching how to code all types of lists. i guess because that's what people did a lot. that or so the people who used the lists had some notion of what a list is and what it does.

      the only reason that someone today would write a list class in java or in c++ or any other oo language is that they _really_ need something specific or they don't understand the power of using tested code. it generally outweighs any performance gain as well as your need to know the implementation detains (which are commonly available for your reference anyway).

      so now we're trading ideas on the other latest and greatest stuff everyone comes up with. once you learn this pattern it's time to move on to the next one..

  27. Persistence with XSL by CyberGarp · · Score: 1

    I'm currently working on an article about an easy way to generate all the base classes you need for persistence. It's a lot of repetitative work to build that interface layer between SQL and target language.

    The basic idea is that one converts SQL into XML, then applies and XSLT to generate all the base classes. I've applied this idea to three projects now, and I've gotten to where the autogenerator handles things like intersects properly.

    So if you get it right in the XSL, one can change the SQL structure of the tables and the code can stay updated automatically. Find a bug in the persistence code, fix it in one place. Voila it propagates to all instances. A serious timesaver this is.

    Just thought I'd throw this in for those interested in this topic. Consider it like an ice-cream topping.

    --

    I used to wonder what was so holy about a silent night, now I have a child.
    1. Re:Persistence with XSL by markv242 · · Score: 1
      Holy cow, but you have done a lot of development work to duplicate existing efforts.

      To give you an idea, in NetBeans/SunONE/JBuilder/etc, you model your database (or import the schema from an existing JDBC connection) and then right-click on the table you're looking to create a bean for, select (something like) "Generate Classes" and poof, the IDE does all your work for you.

    2. Re:Persistence with XSL by Petronius · · Score: 1

      Not to mention things like XDoclet, Jakarta Torque or even Hibernate.

      --
      there's no place like ~
  28. a Troll? by BigGerman · · Score: 0, Troll

    So someone expresses several perfectly valid points - and a Troll?
    /. is getting shallower everyday
    Thanks poster, glad to see some real-life enterprise coders out there.

    1. Re:a Troll? by rutledjw · · Score: 1
      Here here. Usually I see troll and funny mixed up, but troll and insightful?

      Makes me hope to meta-mod this one, and makes me regret there isn't fair/unfair/stone dumb

      --

      Computer Science is Applied Philosophy
    2. Re:a Troll? by Anonymous Coward · · Score: 0

      you're an idiot if you fell for that. that guy is a known troll. look at the rest of his posts. every single one of them is a troll. some of them are good, some of them suck like this particular one.

      maybe you're part of it, hence the reason you got modded as troll, too. dumbass.

  29. Stored Proceedures by Anonymous Coward · · Score: 0

    Pseudo off-topic --

    I should learn how to write stored proceedures. Any book recommendations out there?

    1. Re:Stored Proceedures by BigGerman · · Score: 1

      Despite what vendors say stored procedures use radically different languages and patterns in different database products.
      So really it is vendor-specific flavour you learn. For Oracle (PL/SQL) O'Reilly PL/SQL books are good.

    2. Re:Stored Proceedures by Anonymous Coward · · Score: 0

      Thanks - that's a start!

  30. HBUY Practices? by TheConfusedOne · · Score: 2, Insightful

    Maybe instead of "Best Practices" we can come up with a new term or two:
    HBUY (Haven't Blown Up Yet) Practices
    WNRSWTW (We're Not Really Sure Why They Work) Practices
    DSABAATO (Doesn't Suck As Bad As All The Others) Practices

    I think the idea of "Best Practices" really does aim at security, reliability, and robustness. The idea is that someone/some group has found a set of methods that seems to work quite well in regard to these. So, let's use these as the baseline and improve from their instead of creating the same screwups all over again.

    --
    --- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
  31. What do you recommend? by AKAImBatman · · Score: 0, Offtopic

    I'm somewhat interested in what SQL books people would recommend. At this point I'm proficient in SQL, but there are a lot of people that I'd like to make recommendations to. The problem is that I learned SQL on the internet and really have no idea which books are good and which aren't. Any good recommendations?

    1. Re:What do you recommend? by Sagarian · · Score: 1

      A Visual Introduction to SQL was very helpful for me learning it back in the day. Back in the day before I forgot it and became a PHB that is.

  32. Object persistence by rauhest · · Score: 3, Insightful

    I don't think it is possible to implement a decent persistence framework in C++ that doesn't rely on code generation. Java's reflection API is a big plus here.

    I know it for sure because currently I'm working on a C++-based persistence layer -- after spending several months with OJB and Hibernate :)

  33. Where's all the good stuff? by KDan · · Score: 1

    Seems pretty thin on the content. With a book about persistence I'd expect at least quick introductions to OJB's, Hibernate, iBatis, JISP, Prevayler, etc...

    Daniel

    --
    Carpe Diem
    1. Re:Where's all the good stuff? by smack.addict · · Score: 1

      It is a book on Java database best practices, not third-party persistence tools. Though Justen Stepka did contribute a good overview on alternate third party persistence tools, so the concept is not ignored.

  34. Safari version? by Anonymous Coward · · Score: 0

    How long does it take to get new O'Reilly books on Safari?

  35. How about practical tips by andy1307 · · Score: 1

    I am sick and tired of books warning me that if i do a certain thing in a certain way, i will be tied down to a database. How many projects switch from Oracle to sybase? How many project managers expect the switch, if it is carried out, will be without any changes to the code? books on best practices and performance are good but some of the best practices evolve over time. What may be a critical performance bottleneck now may not be a problem in a few years. I am sure there was a performance "tip" at one time that recommended using 2 characters for storing the year to save on memory.

    1. Re:How about practical tips by Anonymous Coward · · Score: 0
      • You are making a product that needs a database for persistence.
      • One type of customer already has applications built on top of Oracle/MS SQL/DB2/etc.. + the infrastructure to support it. You are going to support customer's db of choice if you are going to sell.
      • One type of customer doesn't have a database yet. You'd like to 'sell' him MySQL with your app.

      So the project isn't switching from oracle to sybase. You're just adapting to customer requirements.
    2. Re:How about practical tips by Anonymous Coward · · Score: 0

      I am sick and tired of books warning me that if i do a certain thing in a certain way, i will be tied down to a database. How many projects switch from Oracle to sybase?

      Maybe not many although I have worked on at least one project that was migrating from MS SQL Server to Oracle. More likely is the small business that starts out on MySQL and needs to migrate to Oracle as their business grows. That is not at all unusual and needs to be planned for.

  36. SCO by Anonymous Coward · · Score: 0

    What does SCO stand for?

  37. Best practice???? by IdleTime · · Score: 1

    I read the chapter that was available on the website in PDF form and best practive my a**!

    When you talk about best practice, you could at least mention the best of them all, esp with databases like Oracle, use of bindvariables.

    The book gives examples in the form of:
    select blah from tableblah where bleh='WHATEVER';
    Everyone with some experience from an enterprise database knows the rule is: "Parse once, execute many times". By replacing 'WHATEVER' with :bindvariable and assign WHATEVER to :bindvariable, you will only have to parse the statement once and whenever someone enters a different search criteria, i.e WHATNOT instead of WHATEVER, the database will not have to consider the select statement as a new and unique statement but use the one already pre-parsed in memory and only substitue the bindvariable with the actual value.

    Now, that's best practice!
    If the rest of the book is as sloppy, then stay away from it.

    --
    If you mod me down, I *will* introduce you to my sister!
    1. Re:Best practice???? by smack.addict · · Score: 1
      Except the example chapter is about database architecture and not database programming. And it comes in the book before I have introduced the concept of bind variables (aka callable statements) or stored procedures. Thus, it is:

      a) Not a best practice in database architecture, so inappropriate to call out as a best practice at that point
      b) Too complex a concept to assume knowledge of at that point in the book

      As a side note, I do call this out as a best practice in a later chapter and all subsequent chapters use callable statements in their examples.

    2. Re:Best practice???? by dekashizl · · Score: 1

      stat.prepareStatement("Yeah, so ?. Go George!");
      stat.bind(1, "stf up");

    3. Re:Best practice???? by Anonymous Coward · · Score: 0
      You come across as someone who does not take criticism well. I haven't read your book (and probably won't now, having read your response), but it is never a good idea to demonstrate worst practice, because you think the reader is unprepared for best practice at that stage, and then go on to correct it later. What if they dip into the book some time later to grab some sample code - are you saying only the examples at the very end are worth grabbing ? There's never a reason to write bad code like this!

      Just use the frigging bind variables in the example and don't call attention to it until later ! Your audience is programmers, they'll follow you ! Bind vars are not rocket science.

    4. Re:Best practice???? by smack.addict · · Score: 1
      Because something is not a best practice does not make it a "worst practice". Bind variables are actually very difficult things when you first encounter them--especially if accompanied with no explanation.

      On the other hand, in simple SQL examples demonstrating join tables outside the context of any higher level programming language, the use of bind variables is completely inappropriate.

      Though you may think I am not taking criticism well, I am simply pointing out that you and the previous poster are looking at the issue outside the proper context. Using bind variables in this chapter would have been WRONG, WRONG, WRONG. On every level.

  38. stored procedures vs. Java application code by GunFodder · · Score: 1

    One other advantage of stored procedures is that they are easier to deploy in a production environment since a server restart is usually not required. However I dislike using stored procedures (in Oracle, anyway) for several practical reasons:

    1. The syntax for stored procedures is awful. I always wondered where the hell they stole their syntax until I finally ran across some COBOL.

    2. The compiler and runtime error checking are poor. The compiler generally stops at the first error it sees, and it doesn't always report the line number correctly. And you practically have to be a DBA to figure out some of the problems that can occur with procedures.

    3. Code maintenance is a hassle. All of our other sources are easily compared to their deployments using basic file commands in the OS. However SQL commands must be used to verify the source in our Oracle DB. And Oracle reformats our procedures even if they compile properly, which means the source cannot be compared to the target anyway.

  39. Strict adherence to methodology by rutledjw · · Score: 1
    This is the only way to develop robust, stable, secure, scalable, and maintainable software. Without this, there can clearly be no quality within the final product. Having several independent methodologies / best practices is simply unacceptable and goes against all common sense and logic.

    At my company we adhere to such a methodology and have delivered software that eventually compiled - every time.

    With that, I'd like to introduce our unified methodology and propose that it be given proper respect through widespread implementation.

    SOP - Seat Of Pants

    You don't even want to know where I work...

    --

    Computer Science is Applied Philosophy
  40. If you think PL/SQL is bad try TSQL it's worse. by BoomerSooner · · Score: 1

    Maybe that's just because I learned to use Oracle PL/SQL first and had to learn Transact SQL at my subsequent jobs. I still prefer PL/SQL. Hell it makes me look better too when our parent company needs help extracting data for our office and they can call me to write them a stored procedure and the other developers cannot (they also call me for linux/solaris help and we *technically* are a MS only shop).

    At least my CIO doesn't have his head up his ass like the rest of the C*Os do.

  41. Re:"Best Practices" by GR/smack.addict by dekashizl · · Score: 2, Funny
    smack.addict said:
    Disclaimer: I am the author of the book being reviewed.
    I bet you would sell more copies of your book if it indicated on the cover "by smack.addict" instead of the more innocent and questionable "George Reese". And instead of that fat hairy cat (wtf is that thing anyway?), you should have had a pic of a spoon with a lighter under it.
  42. JAVA R.I.P. by Anonymous Coward · · Score: 0

    JAVA ??? R.I.P. !!
    Its going , going , going .. GONE !

  43. YHABT by Anonymous Coward · · Score: 0

    (You have also been trolled)

    YHL

    HAND

  44. Why I hate the phrase by mattr · · Score: 1
    It might just be me having a bad day, but a usual I react with a vaulting wave of sheer loathing upon hearing the phrase "Best Practices". Desensitized? Try Over-Sensitized!

    In my experience the only people who use such terms are mediocre Sales & Marketing managers who are supreme bullshitters and such phrases are the way they get this bullshit propogated. Then since they really do not have a clue about things like security, reliability, robustness, risk management, or engineering, nor real success at their own field, they use such terms to get software engineers to defend their decisions ad nauseum.

    You are not going to get an entry-level scripter to become a master programmer by getting him to read a book on "Best Practices", you will not save time, money, or personnel, and you will alienate the true professionals on the team. But, you will be able to attempt closing a large account by using these buzzwords.

    Certainly it is important to base operations on objective reality but this is not the way. What constitutes the best practice must by definition change with time, business requirements, team abilities, and so on. You need not a blind committment to a list of best practices, you need rather a cadre of live human beings who are capable of making a decision about what practice (we call that operational strategy in the real world) will be appropriate. The client is most likely not able to make this decision, they are depending on you to do it and usually want to believe that you have a sincere philosophy based on doing a good job and making them happy.

    In particular "Best Practices" like I suppose J2EE, Weblogic, Oracle, or Sun are usually death to most web-based midsize projects in this economic environment, if the same result can be accomplished with more speed, safety, and cost performance using systems like perl/jsp, mysql/postgres, bsd/linux. Although perhaps J2EE has gotten more economical, if so I've missed it for the past year. The times you really need the high-power products are not going to be discovered with a beginners' book like this one. Although it might be useful for independent developers to read and understand the Language of the Enemy (LotE). It can help you eat their lunch.

    Of course, I haven't read the book and I ought to give them the benefit of the doubt, after all I like O'Reilly a lot. Luckily this book sounds too technical for marketing types so it is probably not a valid target for accusations of pandering. It sounds like there is a lot of good information in there, and the "best practices" term is from the reviewer (after all, who wants to be against "best practices"?) Usually when I hear the term it means anathema to explaining clearly and concisely what kinds of knowledge, decision-making talents, experience, policies and operations are going to promote reliability/security/robustness. Personally, if I must use market speak (almost never I think unless competing against someone who does) I will qualify each word carefully so as to help the client understand that it is about professionalism and committment, not about a power sales technique. Of course if they don't want to think about it I'll still do my best but when somebody else comes along they will have only themselves to blame! Well no point in ranting perhaps.

    Terms like "Best Practices" are still around because some people don't want to think seriously about IT, and those who are serious do not have the conceptual tools to do so. This gives cynical managers tools to leverage fear and uncertainty.

    Where I come from, the best practice is to work very hard at doing The Right Thing but to also consider what the right technical strategy is on a case by case basis, in order to deliver the best cost efficiency and performance. In other words, think about the customer. They want to trust you that you know your business and will do a professional job. They do not (unless they are gullible, which explains a lot about this industry) want to hear buzzwords from marketdroids who

    1. Re:Why I hate the phrase by Hognoxious · · Score: 1
      Well said, Sir!
      Where I come from, the best practice is to work very hard at doing The Right Thing but to also consider what the right technical strategy is on a case by case basis, in order to deliver the best cost efficiency and performance.
      So the best practice is to be intelligent, conscientious, and experienced (The second best is to employ people who are). One of my favourite expressions is that really competent people don't need methodologies - which is kind of saying the same thing.

      The propblem, as ever, is where are all these great people, and how do I stop the 'tards *I'm* lumbered with from cocking things up.
      Again.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  45. Java Enterprise Database Mess by kompiluj · · Score: 1

    The database access in Java is really a mess. On one side we have the EJB technology, now grown up and mature, but still having many problems: you cannot use built-in database sequences, instead you have to resort yourself to the well known hack (in the Java Community a hack is called "the pattern") with session bean and entity bean. Reading from database is rather slow - you have to use DAO (write them by hand or have generated like in OptimalJ) or resort to container specific practices - like in JBoss - where you define how many rows should be read at a time.

    Even more mess is due to arrival of the new technologies duplicating the functionality of the EJB - like the JDO, which (as I have read in: JBoss chooses the JDO) may be the basis of enterprise Java in tommorow meaning not only the betterment of your applications but also meaning that new sources of incopatibility will emerge.

    In this case one fears that his applications will have to be rewritten, the tools will change, the practices you learn now will become obsolete.

    Additionally there is still the problem of using the database effectively. The more indirection you have in accessing the DBMS, the more portability you acquire, the less specific you can be. Those questions need answer if the Java Enterprise Technology shall continue to lead.

    --
    You can defy gravity... for a short time
  46. MOD PARENT UP by Anonymous Coward · · Score: 0

    +5, Funny!

  47. SBCT??? by yintercept · · Score: 1
    And changes the colour of the scrollbar.

    Well, my goal is to be perceived as a database programming guru. I already store XML in the data...but you bring up a good question: Exactly how do you change the color of the scroll bar...

    I mean, if some young buck has a database that changes the color of the scroll bar, I know I am toast. Are there any good acronyms involved in the field of SBCT (ScollBar Changing Technologies)?

    1. Re:SBCT??? by Hognoxious · · Score: 1
      I mean, if some young buck has a database that changes the color of the scroll bar, I know I am toast. Are there any good acronyms involved in the field of SBCT (ScollBar Changing Technologies)?
      I'm sure there are hundreds working on it, and thousands working on patenting it.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  48. Transactions aren't a "feature" by msobkow · · Score: 1

    Transaction commit and rollback are an integral part of databases. Without it, you've just got a keyed file structure, not a database.

    I did, however, forget to mention integrity checking, which is even more useful than sequencers.

    --
    I do not fail; I succeed at finding out what does not work.