tag:blogger.com,1999:blog-13836958220296239162024-03-17T04:25:18.464-04:00Chris Wong's Development BlogThis is a development-focused blog covering Java software development.Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.comBlogger71125tag:blogger.com,1999:blog-1383695822029623916.post-26653501460039201172024-02-14T10:36:00.001-05:002024-02-14T10:36:43.253-05:00Virtual threads: the limits of infinityJava threads were expensive at scale. When your server needs to handle many requests concurrently, and each request needed a thread, the number of threads spawned could be performance-prohibitive. This led to all sorts of thread-conserving measures. The default server worker pool limit for Spring Boot was just 200, which meant you could only process 200 requests at a time. In desperation, people Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-68392161175807616822024-02-06T14:01:00.004-05:002024-02-07T11:50:08.573-05:00Making concurrent HTTP requests in JavaThere may be occasions when you need to make multiple HTTP requests. The easy way is to simply make one request after another in sequence. If that's all you need, there is no need to read further. This will only complicate your life. Go away. Shoo.The hard way to do this is to make multiple requests concurrently. Generally at scale (otherwise, why bother?). That's what I will play with in this Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-70155056425516054372017-08-06T23:11:00.000-04:002017-08-06T23:11:11.178-04:00Is Scrum obsolete?The blog title may be mischievous, but that thought did run through my mind when I last interviewed for a job. I had spoken to 4 companies at the time, and 3 out of those 4 places deployed to production at least daily. If Scrum is a series of time-boxed sprints or iterations what meaning does it have when you ship stuff daily? I'm not saying Scrum should die, but I do wonder whether it Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-25718985996538295022016-07-25T22:05:00.004-04:002017-08-02T21:35:44.677-04:00Annotations, for better or for worseA recent provocatively titled blog post bashing Java annotations kicked up an
amusing amount of controversy. What I find notable about the post and
its responses is that there doesn’t seem to be much agreement on annotations’
place in Java. My own take on this is that many popular usages of annotations
are questionable, but we’re stuck with them.
Annotations started off innocently enough. Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com4tag:blogger.com,1999:blog-1383695822029623916.post-63791787199619658132014-09-03T23:04:00.001-04:002014-09-03T23:06:15.606-04:00Git, reconsideredI’ve expressed my skepticism before that DVCS (distributed version control systems) like Git offer a lot of benefits over traditional version control systems like Subversion. I’ve had the opportunity to use Git exclusively for quite a few months now, and have had the opportunity to appreciate its benefits. My opinion on this matter is somewhat tempered now. Here are my current thoughts on this.
Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com2tag:blogger.com,1999:blog-1383695822029623916.post-49062343261370149332013-11-19T20:47:00.001-05:002013-11-19T20:47:13.053-05:00Don't swallow Hibernate exceptions!Every once in a while, I see a code pattern that makes me go "hmmm". Once instance of this is code that catches a Hibernate exception within a transaction and swallows it before doing some compensating action. Normally, the usual pattern is that if Hibernate throws an exception, you let it propagate past the transaction boundary, rolling back the transaction, before handling the error. Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-72935827874023061752013-06-26T23:02:00.001-04:002013-06-26T23:06:10.383-04:00Dynamically changing a log4j configurationFor most of my career, I've used log4j as my logging back end. Whether during development, testing or production, I've encountered situations where I need to change the log level of a running web app on Tomcat. Restarting the application is often not feasible: either the situation I'm trying to diagnose would be wiped out, or other users would be impacted. Here's an easy tweak, if you're Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com1tag:blogger.com,1999:blog-1383695822029623916.post-72128890116406954212013-03-28T23:00:00.001-04:002013-03-28T23:01:35.918-04:00Is your language strongly, weakly, statically or dynamically typed?Would you describe a programming language to be strongly typed, weakly typed, statically typed or dynamically typed? People often use the terms "strongly typed" and "statically typed" interchangeably, and likewise "weakly typed" and "dynamically typed" are often used to mean the same thing. I think this imprecision of terminology is unfortunate. That is, Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-59141945945427657642013-02-27T23:53:00.001-05:002013-02-27T23:53:03.814-05:00Yammer/Chatter as an alternative to your daily scrumThe daily standup meeting, also known as the daily scrum, did not work very well for me. One day, we looked at each other and asked "does anyone actually want to do this?" Nobody did, so that was the end of the daily scrum. The intention is admirable: you want team members to get a status update and know what's going on with the rest of the team. But the daily scrum seems the wrong way Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-57383068086414918562013-01-15T08:54:00.001-05:002013-01-29T11:04:07.508-05:00Don’t forget to index your Oracle foreign keysThis is another note-to-myself blog post. Like PostgreSQL, Oracle does not create indexes on foreign key columns. This can lead to both poor performance and deadlocks. This is because when the parent table’s column where the foreign key points to is updated Oracle needs to verify the child table’s FK constraints. In the absence of an index, this means a full table scan and a table lock. Normally Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com2tag:blogger.com,1999:blog-1383695822029623916.post-2568606297092791622013-01-04T20:33:00.001-05:002013-01-04T20:52:24.111-05:00JmsTemplate is not evilA while back, I watched a presentation on JMS messaging where the presenter (Mark Richards) declared that Spring’s JmsTemplate is “evil,” and he had the benchmarks to prove it. Since Mark was kind enough to provide the source code (based on ActiveMQ), I decided to dig a little deeper to determine the cause. It turns out that the apparent poor performance of JmsTemplate was not due to anything Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com6tag:blogger.com,1999:blog-1383695822029623916.post-48153646166290053142012-09-29T23:44:00.001-04:002012-09-29T23:44:22.766-04:00Multithreaded programming is easy!Multithreaded programming is supposed to be perilous. Even for experienced practitioners who are familiar with the concepts of multithreading, the cognitive load of this work is supposed to be too taxing for the human mind to handle reliably. Yet your typical server-side enterprise Java application is inherently multithreaded. Whether deployed on a full Java EE application server or something Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com4tag:blogger.com,1999:blog-1383695822029623916.post-20608580281523270802012-08-13T00:52:00.001-04:002012-08-13T00:52:35.393-04:00Plight of the introvert programmerI have grumbled before about the trend away from private offices towards cubicles and open plan offices. At the same time, there are people who genuinely prefer these offices, which I considered inhumane. Then I read a book: "Quiet: the power of introverts in a world that can't stop talking", by Susan Cain. It helped clarify the differences between introverts and extroverts, the rise ofChristopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com6tag:blogger.com,1999:blog-1383695822029623916.post-16874603519051779092012-08-02T00:47:00.001-04:002012-08-02T00:47:10.152-04:00AppFog: the GMail of PaaSAppFog sent out an email announcement a couple of days ago that made my jaw drop. AppFog is one of the commercial implementations of the open source CloudFoundry PaaS (Platform as a Service). I blogged briefly before about CloudFoundry: it's one of the new generation of PaaS that do not lock you in with vendor-specific APIs. You can provision a standard DB service, upload a war and watch your Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com3tag:blogger.com,1999:blog-1383695822029623916.post-31815200885202894352012-08-02T00:10:00.001-04:002012-08-02T00:10:25.365-04:00Where are the QA engineers?I heard again today from my employer that we still really, really need software QA engineers. This has been going on for quite a while now. I realize that good tech talent is often hard to come by, and newer skills like HTML5 and mobile are red hot. But SQA -- while obviously an important position -- has been around for a long time, yet we've had a hard time hiring them. Is there something in theChristopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com0tag:blogger.com,1999:blog-1383695822029623916.post-71647521650932409932012-07-31T00:21:00.001-04:002012-07-31T00:21:24.041-04:00Revealed: my top secret Grails project I have mentioned in previous postings that I had been working on a Grails project, but neglected to actually say what that project was. Jelastic not only hosts this project on their PAAS cloud, but Judah Johns of Jelastic was kind enough to interview yours truly on their blog: The Jelastic Spotlight: My Hometown Video Now that My Hometown Video (HTV) is out there, it seems unnecessarily Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com1tag:blogger.com,1999:blog-1383695822029623916.post-68089455846686298332012-05-27T22:52:00.004-04:002012-05-27T22:57:22.682-04:00Finding table for Oracle constraint violationWhen Oracle reports a constraint violation, you might get something unhelpfully cryptic like:
ORA-00001: unique constraint (FOO.SYS_C003567231) violated
The constraint is system-generated, based on UNIQUE being specified in the DDL, so the name is unhelpful. With no other information, finding the affected table can be difficult. You can query for the table with the following SQL:
select Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com1tag:blogger.com,1999:blog-1383695822029623916.post-16269038844399529062012-05-24T23:54:00.001-04:002012-05-24T23:54:29.505-04:00Programming at the speed of thought II: JRebelIn my last blog post, I lamented the slow turnaround and overall heaviness of enterprise Java development. I also said that I would be checking out JRebel, a tool designed to let you make code changes and push them out to a running application without restarting the application. My verdict? I loved it, convinced my boss to buy it, and am an enthusiastic user. But it is not flawless, so adopters Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com11tag:blogger.com,1999:blog-1383695822029623916.post-613660882945039052012-02-12T22:50:00.001-05:002012-02-12T23:27:14.548-05:00Programming at the speed of thoughtIn his classic "No Silver Bullets" paper in 1986, Fred Brooks claimed that the "accidents" of software development had been substantially addressed. He used the word "accident" in the Aristotelian sense, meaning tasks not inherently essential to programming like waiting for a program to compile. We were getting close to the being limited only by the essential tasks, Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com2tag:blogger.com,1999:blog-1383695822029623916.post-33942942053388191582012-01-09T22:56:00.001-05:002012-01-09T23:07:05.045-05:00No more cookies for you, says FacebookThe Facebook platform offers a great deal of functionality, and I have been using it recently for user authentication and management for a web application. Last December, Facebook implemented their mandatory migration to OAuth 2.0, causing breaking changes for those of us naïve enough not to monitor their blog. As part of this migration, they changed both their cookie format and policy, which Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com2tag:blogger.com,1999:blog-1383695822029623916.post-6001878185523662912011-12-22T23:20:00.004-05:002011-12-23T08:38:35.977-05:00Do you like your daily Scrum?Over the years, I've attended my fair share of meetings and worked in a couple of places that are sort of "agile". Naturally, I have witnessed some unproductive meetings. It seems to me that the daily scrum -- or daily standup -- are disproportionately dysfunctional. This makes me wonder if there are truly fans of the daily scrum. Consider the following scenes of dysfunction. Have you seen these?Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com7tag:blogger.com,1999:blog-1383695822029623916.post-20686836585119892062011-12-05T00:14:00.001-05:002011-12-05T00:18:50.244-05:00Reconsidering Java cloud hosting with PaaSI have been looking into Java cloud hosting for my Groovy on Grails application, and I am quite pleased at what has been happening in this space. I last explored cloud hosting a couple of years ago. By contrast, today's PaaS (Platform as a Service) options look quite promising, particularly Cloud Foundry and Jelastic. Then -- and now -- Amazon Web Service (AWS) was the big IaaS (InfrastructureChristopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com9tag:blogger.com,1999:blog-1383695822029623916.post-82731640298172378212011-11-28T23:17:00.001-05:002011-11-28T23:17:19.726-05:00Tech conferences on the cheapI like attending developer conferences. Developer-focused conferences bring a huge breadth of thought and concepts, an intoxicating  buffet of technology and learning that widen my knowledge beyond my current job's focus. Alas, technology-focused conferences have not brought the revolution in conference prices that technology has accomplished in other areas. That is, tech conferences remain Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com1tag:blogger.com,1999:blog-1383695822029623916.post-41674727718759523432011-10-22T02:11:00.001-04:002011-10-22T02:12:52.936-04:00Twilight of BlackBerry JavaI have mentioned before in this blog that I develop apps for the BlackBerry as a hobby. For all my apps so far, I used RIM's BlackBerry Java SDK, which has been their the "official" way to develop apps. I just learned that by next year all my apps will be obsolete. I am not exactly overjoyed. Here are my thoughts. The big developer's conference for BlackBerry developers is RIM's Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com5tag:blogger.com,1999:blog-1383695822029623916.post-25437314079085767402011-09-27T23:04:00.001-04:002011-09-27T23:04:39.144-04:00From NoSQL to NoServerI attended an interesting presentation recently on CouchDB, a document store database that helped make the term NoSQL famous. One of the interesting ideas discussed is the idea of CouchApps: pure JavaScript/HTML applications working with and interacting exclusively with CouchDB. So not only do you not need a relational database, you can dump your application server too. I think this is a Christopher Wonghttp://www.blogger.com/profile/16941177380839071164noreply@blogger.com3