tag:blogger.com,1999:blog-80904752008-07-17T10:19:11.702-04:00p s v msrihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-8090475.post-26921093778454158232007-04-24T23:34:00.000-04:002007-04-24T23:54:04.344-04:00DBUnit + Sequence numbers + Foreign keys = Nightmare!Setting up my unit tests with reliable fixtures is turning out to be quite a headache.<br /><br />Sparing you arcane application-speak let me use the classic simple EMPLOYEE-DEPARTMENT example to illustrate my problem.<br /><br />Facts:<br /><ul><li>We have the typical EMPLOYEE table and the DEPARTMENT table</li><li> Both use database-generated ids (sequence numbers) as primary keys.</li><li>An EMPLOYEE belongs to a DEPARMENT.</li><li>The DEPT_ID field in the EMPLOYEE table is a foreign key into the ID field of the DEPARTMENT table.</li></ul>So far, so good.<br /><br />Now, consider a method in the <span style="font-family: courier new;">EmploymentDao </span>class that returns all known employments. In SQL speak, it executes<br /><br /><pre>Select e.emp_name, d.dept_name<br />From employee e, department d<br />Where e.dept_id=d.id</pre><br />In order to test this method I need to set up the database with necessary data. I would like to be able to use something like DBUnit to set up my fixtures. However, I have to populate the DEPARTMENT table with at least one department record. Then, I need to get the ID field of <span style="font-style: italic;">that </span>record to insert a record into the EMPLOYEE table. How does one do that ? This is crucial for a test such as<br /><br /><pre>public void testGettingAllEmployments() {<br /> List employments = employmentDao.getAllEmployments();<br /> assertNotNull("Empty list of employments", employments);<br />}</pre><br />Even with a simplification of suppressing foreign key constraints, I will have to do something like:<br /><ul><li>Insert a record into the DEPARTMENT table with a DBUnit fixture. <br /></li><li>Insert a record in the EMPLOYEE table (with a bogus dept_id)</li><li>Then read the record, from the DEPARTMENT table to get at its id</li><li>Update the record in theEMPLOYEE table to set the dept_id</li></ul>Wow! That's a lot of preamble -- not to mention using of the very DAO methods I want to test!!srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-7514627058689512982007-02-21T22:58:00.001-05:002007-02-22T09:10:58.155-05:00Hello Google Reader. Goodbye Bloglines<div xmlns="http://www.w3.org/1999/xhtml">I have been a longtime user of Bloglines. Sometime last year when Google introduced the Google Reader (GR) I took a looksee and was severely underwhelmed and so I stayed with Bloglines. One of my primary reasons was that GR did not work with my reading style. You see I like the blog posts grouped by feed -- all Slashdot posts together, all Javablogs together -- separated from the Slashdot posts.<br /><br />Of course, the choice of Bloglines over over a locally installed reader was a no-brainer; I did not want to have to maintain a copy of my blogroll on each machine that I used during a typical day.<br /><br />I recently peeked over to Google-land and lo and behold, this one feature that had been the deal-breaker for me had been added. In addition, were some very useful features that won me over. Here are the things that clinched the deal for me:<br /><br /><ul><li>List view -- This allows me to glance at about 50-60 posts in a group at a time. If I am interested, I click on it to expand it and read a synopsis.</li><li>Ability to "star an item"</li><li>Keyboard shortcuts -- Boy! Do they ever have shortcuts. I haven't mastered them all yet</li><li>Ease of renaming feeds</li><li>Ability to selectively mark items as having been read -- Bloglines has a severe problem in that when you select a blog, every unread article in the blog is displayed and (this is the problem) they are all <i>immediately </i>marked as "read". Very often I start looking at feeds from a blog and before I can finish scanning all the unread posts, I am called away. With GR, I <i>know </i>where I left off<br /></li><li>Progressive loading -- The reader doesn't attempt to load every article in the selected grouping in one fell swoop</li><li>Configurable start page -- I like my starred items to be displayed when I bring up the reader since well, I starred the item for a reason -- so that I can read them later!<br /></li></ul>Of course there is always a wishlist. Here's mine:<br /><br /><ul><li>Ability to choose the order of display in the list view <br /></li><ul><li>[UPDATE] Anonymous commenter has shown me how! However I wish this wouldn't be a <span style="font-style: italic;">per-feed </span>setting. OK, have a <span style="font-style: italic;">per-feed </span>setting if you must but the one must be able to customize the default at a <span style="font-style: italic;">blogroll level</span>.<br /></li></ul><li>Ability to mark an item as unread (I wouldn't at all be surprised if this feature is already there and that I just haven't figured out the keyboard shortcut)</li><ul><li>[UPDATE] Thank you, Anonymous commenter for showing me the way!<br /></li></ul><li>Speed it up, please! Were it not for the features, GR's sluggishness would've be a deal-breaker!</li></ul><br /><br /><br /><br /><br /><p class="poweredbyperformancing">powered by <a href="http://performancing.com/firefox">performancing firefox</a></p></div>srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1147707637463658982006-05-15T11:12:00.000-04:002006-05-15T11:40:38.140-04:00JBoss Rules...Well, not quite!I have been attempting to work with JBoss Rules (nee Drools) and have mostly met with frustration.<br /><br />With the acquisition by JBoss, the Drools site (www.drools.org) pointed me to JBoss for v3 of the API. In fact, today, I can't even get to drools.org any more. Now cleverly annointed "JBoss Rules", I downloaded the version 3.0 RC2 of both the binary and the IDE. <br /><br />No joy, however (several errors reading the DRL files). Tried various alternatives including <a href="http://article.gmane.org/gmane.comp.java.drools.user/3931/match=3+2m5">recommendations</a> on their mailing list by some of the project's leading lights that one use Eclipse 3.2 M6 and not 3.2 M5 as indicated by their docs. Still no joy.<br /><br />Finally, I decided to download the source and built v3.0. Pay dirt! Actually, you don't need Eclipse 3.2 M6 -- the docs were right it works just fine on M5.<br /><br />On the subject of docs, they are mere shells. The original Drools site used to have a plethora of documented examples, and usage documentation. Not any more. What is the syntax for the new DRL files? I see "duration" is a long, but what <span style="font-style: italic;">is</span> it? About the DSLs? Why get rid of perfectly good documentation of the concepts?<br /><br />OK, since the docs aren't there yet, I decided to join the mailing list. Again, I followed the <a href="http://labs.jboss.com/portal/jbossrules/lists.html">instructions </a>and tried to subscribe by sending email to user-subscribe@drools.codehaus.org. Again, no joy. I got an automated response that read<br /><br /><blockquote><span style="font-style: italic; color: rgb(102, 102, 204);">Hi. This is the qmail-send program at codehaus.org.</span><br /><span style="font-style: italic; color: rgb(102, 102, 204);">I'm afraid I wasn't able to deliver your message to the following addresses.</span><br /><span style="font-style: italic; color: rgb(102, 102, 204);">This is a permanent error; I've given up. Sorry it didn't work out.</span><br /><br /><span style="font-style: italic; color: rgb(102, 102, 204);"><user-subscribe@drools.codehaus.org>:</span><br /><span style="font-style: italic; color: rgb(102, 102, 204);">Sorry, no mailbox here by that name. </span><br /></blockquote><br />So, what next?<br /><br />JBoss Rules...I don't think so.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1138999462502122562006-02-03T15:43:00.000-05:002006-02-06T09:31:21.796-05:00RailsConf: If you announce it, they will come...The <a href="http://www.railsconf.org/">RailsConf</a> has been getting a lot of press. So methinks let's see what the hullabaloo is all about.<br /><br /><b>Q: What are the sessions going to be?<br /></b>Silly me, that's not been decided yet. Don't worry they have over 80 proposals.<br /><br /><b>Q:Where is it going to be held?</b><br />The web site says: Chicago, Venue TBA. TBA!!? What kind of amateurish prank is this? Oh, well, drill down a few pages further and you figure it's at a Wyndham hotel. Phew! At least I know where I'll be staying!<br /><br />Important details aren't fleshed but they want you to register.... <a href="http://railsconf.org/pages/registration">Do they ever</a>! Better get there soon if you want to catch the "super early bird" blue light special. What gall!<br /><br />That's not all, Mike Clark, Dave Thomas and cohorts (from the NFJS circuit) are drumming up the support on their blogs.<br /><br />I am sure -- given the track record of the names named -- it will be a great conference. However I did not expect such premature promotion from so far east of Redmond. The Ajax Conf (or Experience or whatever they call it) is another example of a conference that was announced, much hyped before any details were available.<br /><br />Is this to be the trend? Announce a conference, announce keynote speakers, build up clientele on the shoulders of the blogosphere an <em>then</em> work out the details?srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1136122704221888352006-01-01T08:17:00.000-05:002006-01-01T09:11:24.143-05:00Wisdom of Amazon crowds?I often find myself relying on the <a href="http://www.amazon.com/gp/product/0385721706/qid=1136121413/sr=8-1/ref=pd_bbs_1/103-0068111-2712619?n=507846&s=books&amp;v=glance">wisdom of crowds </a>to guide my purchasing decision. How so? I go check out the customer reviews at <a href="http://www.amazon.com">Amazon</a>. This has been a very a very good barometer for my purchase.<br /><br />Analyzing my habit a little further, I realized that I don't just pick out the majority opinion. BTW, is there a way to get a summary of the customer reviews for an item? Such as,<br /><br />Acme's New Super duper toaster ratings:<br />95% -- 4+ stars<br />2% -- 3 stars<br />2% -- other<br /><br />probably could using <a href="http://www.amazon.com/gp/browse.html/103-0068111-2712619?node=3435361">Amazon web services</a>. Anyway, what I seek out is the not-so-silent minority. I want to see why, while the page is filled with 5-star or 4-star reviews, there are a discordant few. I do read (some of) the majority opinions. However, you tend to get the drift after the first few. Have you noticed that the majority opinion cites similar reasons? However, the minority seem to have more variety -- or maybe its just a matter of numbers.<br /><br />It is the gripes I pay close attention to: is the review just a sore rant or do the complaints seem to have merit. Are these reasons something that I feel is important to me -- or do I not care that the toaster doesn't have a mirror-like sheen?<br /><br />Such an analysis has held me in good stead over the past few years of major and minor purchases. In retrospect, this seems to weight the <span style="font-weight: bold; font-style: italic;">few </span>heavier than the <span style="font-weight: bold; font-style: italic;">many </span>-- contrary to Surowiecki's contention.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1135631107876277022005-12-26T15:58:00.000-05:002005-12-26T16:42:44.653-05:00AJAX Experience...Yet another boondoggleA colleague of mine upon hearing of the Spring experience, said "what a boondoggle". That captured <span style="FONT-STYLE: italic">exactly </span>how I felt about it.<br /><br />Now, I don't object to one man's opinion of enterprise. I know Jay Zimmerman and <a href="http://srivaths.blogspot.com/2005/06/reasons-to-attend-nofluffjuststuff.html">I applaud him </a>for putting up a fabulous show time and time again with his <a href="http://www.nofluffjuststuff.com/">No Fluff Just Stuff series</a>. However a symposium just on Spring? C'mon. If you are new to Spring, a symposium isn't a way to learn to use it. If you already using Spring, you may get something out of 10-20% of the sessions. How do I figure? Due to many level 101 sessions, and others that you can't attend due to conflicts.<br /><br />Hard on its heels comes the <a href="http://www.theajaxexperience.com/coming_soon.jsp">AJAX experience</a>. A symposium essentially on <span style="FONT-WEIGHT: bold">one Javascript API call</span>! Do we <span style="FONT-STYLE: italic">really </span>need a <span style="FONT-STYLE: italic">conference </span>on <span style="FONT-STYLE: italic">AJAX</span>? Aren't there enough online articles, blogs, and books (don't get me started) on the subject?<br /><br />My prediction: Coming soon shall be a Ruby Experience -- which actually is a topic worthy of an "experience". I guess what I really envy is Jay's entrepreneurial spirit. You go Jay!srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1121959943537030352005-07-21T10:16:00.000-04:002005-07-23T14:44:02.733-04:00Maven catch-22 with multiproject buildsMaven's multiproject plug-in is a very useful tool on a large project that's been organized into several sub-projects. Using the dependencies the reactor figures out the correct order in which to build the entire project. However Maven gets in its own way when doing such builds. Here's how:<br /><br />Consider a multiproject with sibling sub-projects that are interdependent. Having been bitten one too many times for not doing so, I have become fastidious about <span style="font-family:courier new;">maven clean</span>ing before every build. Just as with any other plugin, when you invoke <span style="font-family:courier new;">clean</span>, <span style="font-family:georgia;">Maven checks the dependencies. However, when this happens the first time the multiproject is being built, the dependencies cannot satisfied and so the build quits with a failed dependency.<br /><br />If you are wondering why get so anal about cleaning and that it isn't needed before the first-ever build, consider setting up your builds to be managed by <a href="http://cruisecontrol.sf.net">CruiseControl</a>. That's an automated process and needs to be given the goal(s) that must be executed at <span style="font-style: italic;">every build cycle</span>.<br /><br />So, the only solution I know is to perform a one-off build <span style="font-style: italic;">manually</span> without a <span style="font-family: courier new;">clean </span>and then let CruiseControl loose. Can you suggest a better alternative?<br /><br />Speaking of cleaning and multiprojects, why doesn't <span style="font-family: courier new;">multiproject:clean</span> clean the root directory? Why do I have to <span style="font-family: courier new;">maven clean multiproject:clean</span>?<br /></span>srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1118680478135453932005-06-13T12:10:00.000-04:002005-06-13T13:05:45.510-04:00Reasons to attend a NoFluffJustStuff conferenceI just spent the last three days at my third <a href="http://www.nofluffjuststuff.com/index.jsp">NoFluffJustStuff </a>conference -- the <a href="http://www.nofluffjuststuff.com/show_view.jsp?showId=17">Research Triangle Software Symposium</a>. My brain is full and I am wiped and extremely invigorated!! It is my annual shot-in-the-arm booster that makes me look forward to going to work! Here are some of <span style="font-style:italic;">my</span> reasons why you shouldn't miss the next opportunity. (Of course you can also see <span style="font-style:italic;">their</span> <a href="http://www.nofluffjuststuff.com/top_ten.jsp">top-10 reasons</a>):<br /><br /><span style="font-weight:bold;"><u>The speakers:</u></span> The speakers are uniformly exceptional. They not only know what they are talking about, they <em>want</em> to be on the stage and are good at it. Further, they don't mind answering questions -- and not just during the session. Speakers are routinely found mingling with the attendees at lunch and breaks. <br /><br /><span style="font-weight:bold;"><u>Constant innovations:</u></span> In the three years that I've been attending these conferences, it has constantly been evolving, never leaving well enough alone. First it was end-of-day keynotes, then it was the introduction of .Net topics, then it was BOFs, <a href="http://www.nofluffjuststuff.com/blogs.jsp">web-site with speaker blogs</a>, etc etc.<br /><br /><span style="font-weight:bold;"><u>Timely topics:</u></span>At any given time there are invariably 5 active sessions. The topics being discussed at these session are not only of high quality, they are timely. Let's take the latest conference. There were sessions on AJAX, Tapestry, Spring, Hibernate, Ruby, Rails, the list goes on.<br /><br /><span style="font-weight:bold;"><u>Doesn't cut corners:</u> </span>The high quality doesn't stop with the speakers and the sessions, it includes the other amenities. You get all the session materials on CD, with binders, in a nice laptop carrying case (another innovation for this year). Meals (read: breakfasts, lunches, snacks and opening night dinner) during the conference are provided. Jay Zimmerman (the organizer) could very easily have just thrown in the "continental breakfast" fare. But meals here would put most restaurants to shame. There is of course the obligatory raffle during the conference. Even there this one outshines. There are <span style="font-style:italic;">two </span>raffles. At the recent conference, up for grabs were books, an iPod and the new Sony PSP.<br /><br />I think there are about 28 events over the course of the year at different locations across the US. So, if you are in the country, chances are, there is one in your neighborhood. Don't miss it.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1115872099014154712005-05-12T00:20:00.000-04:002005-05-12T00:28:19.033-04:00Freeware installer recommendation?I have been using <a href="http://nsis.sourceforge.net/">Null Soft's product</a> and frankly, I just don't get the NSI scripting language. It just seems too arcane and doesn't seem to flow right -- if you know what I mean. I spend more time digging through the help docs and Googling to figure out how to get something going. <br /><br />I would welcome any alternative tool recommendation -- freeware of, course :) My target environment is Windows and so the tool doesn't have to be cross-platform capable.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1115737661015095922005-05-10T10:57:00.000-04:002005-05-10T11:07:41.036-04:00Visualizing Web Logic's domain configuration<span style="font-size:85%;">Web Logic's config.xml is the center of WL universe. This is what WL uses to keep track of all servers, deployments, services etc and is one gnarly XML file. Yes it isn't for human consumption but it helps to be able to read it when diagnosing problems. Now you have <a href="http://dev2dev.bea.com/blog/euxx/archive/2005/04/visualize_weblo.html" title="Eugene Kuleshov's blog" target="_blank" _base_href="http://d10616.na.sas.com/roller">a handy-dandy XSL</a> stylesheet that'll present this file in HTML. Element names are hyperlinks. Following these links takes you to the appropriate reference documentation page. Now, why didn't I think of that? This works with IE and Firefox although with the latter it doesn't work for a <code>file://</code> URL. Any ideas why?<p/>Attributes: I can't place the actual blog where I came across this tip. So thank you, anonymous.</span>srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1114030737179286972005-04-20T16:52:00.000-04:002005-04-20T16:58:57.180-04:00StrutsTestCase and TokensHow does one get around the usage of Struts tokens when unit testing using <a href="http://strutstestcase.sf.net">StrutsTestCase</a>? If the action class under tests for duplicate submissions using tokens,<br /><br /><blockquote style="font-family: courier new;">if(isTokenValid(request) == false) {<br /> // don't perform the action and route the user<br /> // to an appropriate location<br />}<br /></blockquote><br />it'll always fail. This is because, the token is set in the request by the <span style="font-family: courier new;"><html:form></span> tag and of course when running a StrutsTestCase, the JSP isn't involved.<br /><br />The application functions correctly, however, I cannot run my unit tests :(srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1112908851560379712005-04-07T17:03:00.000-04:002005-04-15T13:46:31.866-04:00Clustering mutable objects<div> <div><span class="778303622-29032005"><span style=";font-family:Arial;font-size:85%;" ><span style=";font-family:georgia;font-size:100%;" >One of things a clusterable application server (for example, Web Logic) does for an application is to broadcast objects placed in the user's session. This happens (at least with Web Logic) whenever the application invokes the </span><span style=";font-family:Courier New;font-size:100%;" >setAttribute</span><span style=";font-family:georgia;font-size:100%;" ><span style="font-family:courier new;"> </span>method of the </span><span style=";font-family:Courier New;font-size:100%;" >HttpSession</span><span style=";font-family:georgia;font-size:100%;" ><span style="font-family:courier new;"> </span>interface. This has a subtle impact when the thing being placed in the session is a mutable object. To explain, first consider a simple (non-mutable) example</span><br /><br /></span></span></div> <div><span class="778303622-29032005"></span> </div> <div><span class="778303622-29032005" style="font-size:100%;"><span style="font-family:Courier New;"> 1: String name = "John";</span></span></div> <div><span class="778303622-29032005"><span style=";font-family:Courier New;font-size:85%;" ><span style="font-size:100%;"> 2: session.setAttribute("username", name);</span><br /><br /></span></span></div> <div><span class="778303622-29032005"></span> </div> <div><span class="778303622-29032005"><span style=";font-family:Arial;font-size:85%;" ><span style="font-family:georgia;">The application server will serialize the value associated with the key </span><span style=";font-family:Courier New;font-size:100%;" >username</span><span style="font-family:georgia;"><span style=";font-family:courier new;font-size:100%;" > </span>to all the nodes in the cluster. Now suppose that the node executing the above steps turns around and changes the value of </span><span style="font-family:Courier New;">name</span><span style="font-family:georgia;">. IOW</span><br /><span style="font-size:100%;"><br /> </span></span></span></div> <div style="font-family: courier new;"><span class="778303622-29032005" style="font-size:100%;"></span> </div> <div><span class="778303622-29032005"><span style=";font-family:Arial;font-size:85%;" > <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"><span style=""> 1: String name = "John";</span></span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"><span style=""> 2: session.setAttribute("username", name);</span></span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"> ..</span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;">15: name = "Mary";</span></div> <div><span class="778303622-29032005"><span style="font-family:Courier New;"><span style=";font-family:courier new;font-size:100%;" >16: String sessionValue = (String)session.getAttribute("username");<br /></span><br /></span></span></div></span></span></div> <div><span class="778303622-29032005"></span> </div> <div><span class="778303622-29032005"><span style=";font-family:Arial;font-size:85%;" ><span style="font-family:georgia;">Since Java passes a copy of a reference to a method call, </span><span style=";font-family:Courier New;font-size:100%;" >sessionValue</span><span style="font-family:georgia;"><span style="font-size:100%;"><span style="font-family:courier new;"> </span></span>is guaranteed to be </span><span style=";font-family:Courier New;font-size:100%;" >John</span><span style="font-family:Arial;"><span style="font-size:100%;"><span style="font-family:courier new;"> </span></span>-- on all the nodes</span><span style="font-family:georgia;">. No harm. No foul.</span><br /><br /><span style="font-family:georgia;">Now consider placing a </span><em style="font-family: georgia;">mutable </em><span style="font-family:georgia;">object such as a<span style=";font-family:courier new;font-size:100%;" > </span></span><span style=";font-family:Courier New;font-size:100%;" >java.util.List</span><span style="font-family:georgia;"> in the session.</span><br /><br /></span></span></div> <div><span class="778303622-29032005"></span> </div> <div style="font-family:courier new;"><span class="778303622-29032005" style="font-size:100%;"><span style=""> 1: List cart = new ArrayList();</span></span></div> <div><span class="778303622-29032005"><span style=";font-family:Courier New;font-size:85%;" ><span style="font-size:100%;"><span style="font-family:courier new;"> 2: session.setAttribute("shoppingcart", cart);</span><br /></span><br /></span></span></div> <div><span class="778303622-29032005"></span> </div> <div><span class="778303622-29032005"><span style=";font-family:Arial;font-size:85%;" ><span style="font-family:georgia;">Just as with the </span><span style=";font-family:Courier New;font-size:100%;" >String</span><span style="font-family:georgia;"><span style="font-size:100%;"><span style="font-family:courier new;"> </span></span>before, this will get propagated to all the nodes in the cluster. Now suppose the cart is updated in one of the nodes:</span><br /><br /></span></span></div> <div><span class="778303622-29032005"></span> </div> <div><span class="778303622-29032005"><span style=";font-family:Arial;font-size:85%;" > <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"><span style=""> 1: List cart = new ArrayList();</span></span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"><span style=""> 2: session.setAttribute("shoppingcart", cart);</span></span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"> ..</span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;">19: cart.add(aLineItem);</span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"> ..</span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;"> // More business logic</span></div> <div style="font-family: courier new;font-family:courier new;" ><span class="778303622-29032005" style="font-size:100%;">25: List sessionValue = (List)session.getAttribute("shoppingcart");</span></div> <div><span class="778303622-29032005"><span style="font-family:Courier New;"><span style="font-family: courier new;font-size:100%;" >26: System.out.println("Cart size = " + sessionValue.size());<br /></span><br /></span></span></div></span></span></div> <div><span class="778303622-29032005"></span> </div> <div style="font-family:georgia;"><span class="778303622-29032005"><span style="font-size:85%;">Now, line 26 above will display different values depending on the node on which it was executed. The node which added the item to the cart will display <span style="font-size:100%;"><span style="font-family:courier new;">Cart size = 1 </span></span>while the others will display <span style="font-size:100%;"><span style="font-family:courier new;">Cart size = 0</span></span>.<br /><br /></span></span></div> <div style="font-family:georgia;"><span class="778303622-29032005"></span> </div> <div><span style=";font-family:arial;font-size:85%;" ><span style=";font-family:Arial;font-size:85%;" >This is bad! This can be avoided if we place an item in the session as the <strong>last step<em> </em></strong>of responding to a user request.</span><span style="font-family:georgia;"> Application development and application deployment are -- in large part -- independent activities. This is an instance where the developer needs to be aware that (s)he is developing an application that's going to be deployed to a clustered environment.</span><br /></span></div></div>srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1110213393125114382005-03-07T11:33:00.000-05:002005-03-08T23:04:55.490-05:00Jira's service -- Legendary or just a legend<span style="color: rgb(0, 153, 0);">[Updated: See end of posting]</span><br />Recently, we came across some critical problems with our <a href="http://www.atlassian.com/software/jira">Jira</a> installation. When we couldn't figure out/fix the problem ourselves, I posted a support request to <a href="http://support.atlassian.com/">Jira's support site</a>. In response, I received a request for additional information. Since the request involved a fairly sizeable attachment I wrote back to clarify the request. Didn't get a response. I decided to send the attachment anyway and updated the support request with the required information and waited for a response. That was 4 days ago...The silence is deafening.<br /><br />When you stick your neck out so far and claim "<a href="http://atlassian.com/about/legendaryservice.jsp">Legendary services</a>"....well, you have to deliver. Atlassian's web-site quotes Jeff Bezos<br /><br /><span style="font-style: italic;">"If you have an unhappy customer on the Internet, he doesn't tell his six friends, he tells his 6,000 friends"</span><br /><br />The trouble is, there is no apparent way to escalate an issue. I couldn't find a phone number to call or any other email addresses -- other than for sales. I finally located <a href="http://atlassian.com/about/contactform.jsp">a contact page</a>. I filled out the form stressing the urgency of our problem and asking about an escalation process. Still not a peep.<br /><br />We were considering purchasing <a href="http://www.atlassian.com/software/confluence">Confluence</a>. The one reservation that I had thus far was the lack of coherent documentation. I am now wondering if going for Confluence would be wise given the trouble I'm having with Jira; which, btw has excellent documentation.<br /><br />I realize the irony of using <a href="http://www.javablogs.com/">javablogs</a> to publish my gripe...<br /><br /><span style="color: rgb(0, 153, 0);">[Update: Mar 9 2005 2300]</span><br />Since originally posting the above, I <span style="font-style: italic;">have</span> heard back from Atlassian. I hope the timing was just a coincidence.<br /><br />The problems <span style="font-style: italic;">are </span>being handled.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1106713883422516252005-01-25T23:26:00.000-05:002005-01-25T23:41:15.856-05:00Struts and checkboxesThe following is a reminder to those working on implementing checkboxes on their pages. <br /><p/> <br />It is <span style="font-style:italic;">essential</span> that you implement the <code>ActionForm</code>'s <code>reset()</code> method. In this method, you must set the fields that populate the checkboxes to false. The reason is that an HTTP request only includes values for selected checkboxes. Any de-selected box will not be a part of the request and so the server-side will be none the wiser that a user un-checked a box. <br /> <br />An important side note (one that cost me quite a while): The <code>reset()</code> method is overloaded with the following variants <br /><pre> <br />void reset(ActionMapping mapping, ServletRequest request) <br /></pre> <br />and <br /><pre> <br />void reset(ActionMapping mapping, HttpServletRequest request) <br /></pre> <br /> <br />For a web UI, you need to implement the latter. If you use your IDE's intellisense, it is easy to accidentally pick the former since it shows up first in the list of choices.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1099069030063434072004-10-29T12:57:00.000-04:002004-10-29T12:57:10.063-04:00President Edwards? A mathematical possibilityStephen Marmon's <a href="http://www.nytimes.com/2004/10/29/opinion/29marmon.html?oref=login&amp;ex=1256788800&amp;#38;en=a55cf721a1a0a0f8&amp;#38;ei=5088&amp;#38;partner=rssnyt">article</a> paints the scenario in which we could have John Edwards in the Oval office come Jan 2005. Interesting, if not anything.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1097786368264093362004-10-14T16:39:00.000-04:002004-10-14T16:39:28.263-04:00Google your desktop -- Sweet!The new <a href="http://desktop.google.com/">Google Desktop Search</a> is really a nice extrapolation (or is it really an intrapolation) of what Google does for the Internet. <br /> <br />You can now just as easily search the contents of your desktop -- including Outlook-based emails. Even nicer, when you search the web using Google, it prefaces the search results with hits on your local machine!srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1096345523690570482004-09-28T01:20:00.000-04:002004-09-28T00:25:23.690-04:00JSF & Struts to co-exist?Craig McClanahan, the creator of Struts and one of the leaders in the JSF 1.0 spec sees a world where JSF is a souped up presentation layer for a Struts-controlled application. He <a href="http://blogs.sun.com/roller/page/craigmcc/20040927#struts_or_jsf_struts_and">writes at length about this</a> in <a href="http://blogs.sun.com/roller/page/craigmcc">his blog</a>. <br />srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1095427984877496582004-09-17T09:28:00.000-04:002004-09-17T09:33:04.876-04:00Continuous Integration Tools' Feature MatrixFound an interesting<a href="http://damagecontrol.codehaus.org/Continuous+Integration+Server+Feature+Matrix"> feature matrix </a>comparing various CI tools. <br /> <br />Aside: I got to this point from some article referring to Damage Control. I looked high and low at the site to see <span style="font-style: italic;">what is</span> Damage Control. I could only <span style="font-style: italic;">infer</span> that it is a tool in the same genre as <a href="http://cruisecontrol.sourceforge.net">CruiseControl</a>. Sure could use better introductory docco. There is a lot of information if you already know what it is and what you need. <br />srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1095194301692637222004-09-14T16:37:00.000-04:002004-09-14T16:38:21.693-04:00AOP popularity inhibitorsDion Almaer <a href="http://www.almaer.com/blog/archives/000440.html">writes about</a> the growing interest in aspect oriented programming. There are, however, several hurdles to large scale adoption of AOP as one of the tricks of the trade. <br /> <br /><ul> <li>Using AOP requires not only a recognition of the cross-cutting concerns but also a paradigm shift programming practices. Conversely once you get into it, everthing starts looking like a cross-cutting concern. It is easy to confuse a candidate for method extraction refactoring with a concern <br /> </li> <li>Another inhibitor is tooling support. For better or for worse we are only as good as our IDE will let us be. It is hard to decipher logic that has been advised without proper in-place annotations. Eclipse's AJDT goes a long way. However if you use Spring's AOP, you are SOL. So you find that AOP is not applied unless the pain (of not using it) is unbearable <br /> </li> <li>Using AOP doesn't -- in most cases -- allow you to do something you couldn't do without it. It just makes it easier, nay logical. If on the other hand if it opened new avenues, it would have taken off gangbusters <br /> </li> <li>Arcane terminology is also a barrier to acceptance</li> </ul> srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1094591085741395932004-09-07T16:56:00.000-04:002004-09-07T17:04:45.740-04:00Customize passwords by applicationWith Nic Wolff's <a href="http://angel.net/%7Enic/passwd.html">nifty script</a> you can now manage the passwords for all the countless sites that need one without having to remember countless different ones. Simply remember a master key, provide the domain you are accessing and it generate a nasty looking one. Very cool! <br /> <br />Surely, you aren't using the same one everywhere...Yeah! Right! <br /> <br />Attribute: <a href="http://weblog.infoworld.com/udell/">Jon Udell's blog</a> <br /> <br />srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1094578900802471672004-09-07T13:34:00.000-04:002004-09-07T13:41:40.803-04:00Hey NASA! There's got to be a better wayNASA is going to use Hollywood stunt helicopter pilots to <a href="http://www.popsci.com/popsci/aviation/article/0,12543,691290,00.html">snag a space capsule</a> from mid-air. Now if <span style="font-style: italic;">I</span> had suggested some such escapade I would have been laughed off the lot. How about a splashdown in the ocean? The Russians have been doing hard earth landings -- with astronauts, nyet cosmonauts on board -- since the sixties.... <br /> <br />Oh! And if I am looking for some mid-air snagging, I don't know about going with a company called Vertigo! <br /> <br />All jokes aside....good luck NASA. I hope you pull it off. <br />srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1094150697383362452004-09-02T14:40:00.000-04:002004-09-02T14:44:57.383-04:00System tray notification for CruiseControlYou can now get feedback for your <a href="http://cruisecontrol.sourceforge.net">CruiseControl</a> builds right on your Windows' system tray. Checkout <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/LightUpYourSystemTray.rdoc">pragmatic automation</a> for instructions.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1094132931648766482004-09-02T09:41:00.000-04:002004-09-02T10:11:00.886-04:00Eclipse annoyances...For all the wonderful things it does, Eclipse is aggravating about other things. . For example <br /> <br /><span style="font-weight: bold;">Code completion not really helpful</span> <br />Code completion is nice if it is a little intelligent about it. For example, if I type <br /><pre> <br />Monkey m = (M <br /></pre> <br />Pressing CTRL+SPACE should automatically populate <code>Monkey</code> as the default for a cast operation instead of giving me a list of gazillion things that it knows about starting with M. <br /> <br /><span style="font-weight: bold;">Paste doesn't work if you have a code segmet folded</span> <br />Say, you have a block of text in the clipboard buffer. You want to paste it thusly <br /> <br /><pre>-- Desired paste location --- <br />--- Next line is the beginning of a folded section ---</pre> <br /> <br />It won't work! The first paste operation (CTRL+V: on Windows) unfolds the folded section. (Pray Why?). A <span style="font-style: italic;">second </span>paste operation will then actually paste it. <br /> <br /> <br />Aaaargh! Wherefore art thou IDEA? <br />srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1094132106963306052004-09-02T09:09:00.000-04:002004-09-02T09:35:06.963-04:00The aliens are coming....The aliens are coming!For the last year or so, the <a href="http://www.seti.org/">SETI</a> project has been following some unusual radio signals from a sector of space detected by the <a href="http://www.naic.edu/">Arecibo</a><a href="http://www.naic.edu/"> observatory</a>. Lately, while most of those signals have disappeared, one of them has become more pronounced. <br /> <br />Now, apparently there is a universal "Ahoy! mate" signal. Scientists poring over the SETI logs have matched the frequency of the signals to the aforementioned greeting. They feel that it is highly unusual for a natural phenomenon to repeatedly send such a signal. <br /> <br />Read more about SHGbo2+14a (now isn't that a cute name) at <a href="http://www.guardian.co.uk/uk_news/story/0,3604,1295569,00.html">the </a><a href="http://www.guardian.co.uk/uk_news/story/0,3604,1295569,00.html">Guardian</a>.srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.comtag:blogger.com,1999:blog-8090475.post-1093700179342589412004-08-28T18:25:00.000-04:002004-08-29T19:38:18.806-04:00Broadband (VoIP) Phone Rocks!I have just had my broadband phone service from <a href="http://www.att.com/callvantage">AT&T</a> for a week and so far it's been outstanding! <br /> <br />After having agonized over it for months researching the technology and comparing offerings from various I settled on AT&amp;T cecause (a) They claimed their differentiator was call quality and (b) because I had a 30-day risk free trial and so I had nothing to lose. An added incentive was $19.99 per month offer during the current promotion. <br /> <br />So far, I have been quite pleased. The call quality has been very good. In fact my international calls have been perceptibly clearer than my original land-line service. <br /> <br /><span style="font-weight: bold;">Pros</span> <br /><ul> <li>Great price</li><li>Lot of features<ul><li>Voice mail -- Can check online, can receive email notification of voice mail</li><li>Call forwarding, waiting, caller id etc etc</li> <li>Can set up multiple phones to ring at the same time to locate you ...cool! <br /></li> </ul></li></ul><span style="font-weight: bold;">Down Side</span> <br /><span style="font-weight: bold;"></span> <ul> <li>When you lose power you'll lose phone service -- Since I lose power <span style="font-style: italic;">maybe</span> once a year, I can live with that <br /></li> <li>You have to dial 10 digits even to call your neighbor -- I think in some bigger locales people already have to do that even with their land-lines <br /></li> <li>You <span style="font-style: italic;">may not</span> be able to keep your existing phone number. This is dependent on whether or not the provider has coverage in my area. If I had gone with Vonage, for example, I could not have kept my existing number. This was a very important for me <br /></li> </ul><span style="font-weight: bold;">Remember to disconnect from your land-line service before hooking the VOIP adapter to your wall outlets.</span> <br />If you are hesitating because the phone adapter that hooks to the cable/DSL modem has only one phone outlet, don't worry. You simply connect that to the traditional phone wall outlet. Since phone lines are wired in parallel all of them will go live! <br />srihttp://www.blogger.com/profile/00178974793936817176noreply@blogger.com