The majority of developers building Java applications will find that the GlassFish application server offers distinct advantages compared with JBoss. This paper summarizes the features and capabilities that make GlassFish a superior choice for building, deploying, and managing enterprise-class Java applications and Web services.
Here are some other recently published GlassFish white papers:
MacBook Pro Cycle Count means the number of times a battery’s entire power is used up. It’s formally defined as:
A charge cycle means using all of the battery’s power, but that doesn’t necessarily mean a single charge. For instance, you could use your notebook for an hour or more one day, using half its power, and then recharge it fully. If you did the same thing the next day, it would count as one charge cycle, not two, so you may take several days to complete a cycle.
It can be easily determined by clicking on "Apple", "About This Mac", "More Info…", "Hardware", "Power", "Health Information:". MacBook Pro with a replaceable battery retains 80% of its original capacity after 300 cycles as mentioned here. But in all practical cases, I’ve heard users replacing the batteries closer to 300 counts. This number goes upto 750 for MacBook Air and 1000 for newer MacBook Pro so there is relief already.
My MBP cycle count hit 283 on Friday and the scary part was "Full charge capacity" was down to 258 mAh. In usage terms, a fully charged battery was getting drained out in 10 minutes
A new battery was rushed, installed and the new count is certainly the expected number:
Exadata v2 runs Oracle database faster than any other machine on the planet. With Exadata v1, the advantages were pretty obvious with customers reducing query times from 24 hours to 30 mins and 30 min to 1 min and some observing 10x – 72x improvements. Exadata v2 is much faster and bigger than v1 with 400 GB of DRAM + 5 TB of flash gives spectacular random IO memory (1 million I/Os per second).
Arnold Schwarzenegger made a surprise appearance during Larry’s keynote to talk about the technology innovation. Watch him speak in the 2-part videos below:
This was my first experience to watch Arnold speaking live at a conference and must say I was truly impressed, and feel honored, by our esteemed governor. He is a great business men who did not deter from the opportunity to sell "Kaalifornia" to all the conference attendees. And he still very much carry the charm & persona from his previous life as a superstar.
The Appreciation Event had an impressive lineup of rocks bands including Aerosmith and Roger Daltrey. There was a boardwalk carnival with Ferris wheel, thrill rides and a games arcade. And of course there were exotic treats to feed you. One thing was clear, Oracle certainly knows how to take care of their customers!
Here are some pictures from yesterday:
And the complete album at:
After attending Oracle Open World 2009 for four days, I’m more than eagerly waiting for the merger to complete now. Now whether they keep me or not, I’m confident that they’ll be able to turn Sun around and make money out of it. If they keep me, I’m part of that success. If not, I’ll get job elsewhere but at least will be happy to see Sun’s products generating revenue
Day 3 of Oracle Open World 2009 (Day 1, Day 2) started on an adventurous note for me. The San Francisco Bay Area got hit with the strongest October storm in 47 years and so the ride from home to Moscone Center took almost 30 extra minutes, because of flooded roads, strong winds, other accidents, and hydroplaning multiple times. Anyway only missed first few minutes of Thomas Kurian’s keynote. Kurian is no stranger to the Java crowd because he is a regular keynote speaker at JavaOne. However it was totally impressive to see customer endorsements (both quality and quantity) and how they are using Oracle to solve operational problems.
Some more observations from the floor:
The last session gets over at 6:30pm and Moscone halls are closed after that, no late night BoFs or AfterDark events.
The game lounge is in the Moscone West only, not sure why. May be because that’s where the Middleware stream is and that’s where the developers are attracted
There is a dedicated slots for Exhibitor Hall where no other formal activities are happening.
I spent some time on the Java EE 6 booth talking about the technology and showcasing GlassFish features such as monitoring and Rails deployment.
Enjoy videos of marketing gimmicks by some vendors at the show floor:
The evening ended with the OOW Bloggers Meetup at LJ’s Martini Club & Grill. It was good to meet fellow bloggers from Oracle and other companies. OTN folks arranged a game to promote social networking. Basically, everybody was given a tee-shirt to wear and whoever has the most signatures from other bloggers wins an HP notebook. A MacBook would’ve been a better incentive to compete for me Anyway there was beer and muchies to keep the bloggers happy. Thanks to Justin (aka "King of OTN") for picking the bill!
Following from Day 1, the Day 2 started with Charles Phillips and Safra Catz keynote. The keynotes at Open World are significantly different from JavaOne or any other developer conference I’ve attended so far. Of course they are expected to be because Open World is not primarily a developer’s conference. Oracle Develop (OD) certainly closely mimic any of the conferences I’ve typically attended. My "exhibitor" badge restricted me from attending any of the sessions at OD though
Here are some interesting statistics about the conference:
5 content streams (Database, Applications, Industries, Management & Infrastructure, & Middleware) 314 demo kisosk 401 partners & customer exchibiting 1966 educational sessions (10% more than last year) 4500 Oracle developers/experts for you 81,266 hotel room nights 170,000 cups of coffee 182,000 online participation
Here are some interesting sightings from the Open World exhibitor pavilion:
Tata Consultancy Services, Infosys, HCL, Wipro, Mahindra Satyam, Birlasoft, Cognizant and a host of other companies based in India are exhibiting in the pavilion. This is a pleasant surprise from JavaOne which typically does not see these many companies out of India.
Poker, Ducati, Glider, Beatles Guitar, Sumo wrestler, Callaway Golf, Mini Cooper and other similar sightings were spotted. Check out complete set of images here.
Lot more attendees are wearing a suit, quite unlike JavaOne or RailsConf which is typically denim/t-shirt rich.
On a personal front, everything that possibly could went wrong as part of the demo installation yesterday and rehearsal for my talks earlier today. NetBeans was not able to connect to the Oracle database (couple of machine restarts solved that), GlassFish Tools Bundle for Eclipse was timing out attempting to start GlassFish (removing workspace solved that problem), NetBeans’s RESTful tooling not recognizing JPA entities, and also found a blocking bug (issue #10166) in deploying Rails app to latest GlassFish promoted build. These demos have worked seamlessly for me all the time time and fortunately worked well during the talk.
Sun Microsystems is the innovation sponsor of Oracle Open World 2009. And that’s what was the theme of Scott McNealy‘s keynote on a "Sun"day. It’s been a while that I’ve seen Scott on the keynote stage and it truly was an enjoyable experience. In his characteristic way, he gave top 10 reasons that "Engineers have gone wild" as:
10. Who needs thumb drive in the shape of sushi ? 9. "Noble prize" recently awards for gas mask bra – no more ridiculous than other noble prizes recently awarded 8. OS/2 7. Patent awarded for face mask with voice modification capability 6. I could do an entire top 10 of worlds strangest keyboards (strangest being iPhone, "Friends don’t let friends type on iPhone") 5. Windows 7 4. Man uses SPARCstation for his ashses 3. New market in "family size’ plots 2. Mainframe running Linux 1. Some one came up with this crazy idea for a ‘Java Ring’
And then on a more serious note, and keeping with the keynote theme, top 10 innovations from Sun:
10. NFS/PC-NFS Technology (1983) 9. SPARC (1989) 8. Open Source Software (Berkeley Unix, "Red Hat of Berkeley Unix", #1 contributor to OSS community) 7. BSD + UNIX System 5 = Solaris 6. Java (Java card, EE/SE/ME, JavaFX) 5. E10K (64-way Solaris, no longer mainframe required) 4. ZFS/Open Storage/Flash (Exadata) 3. Project Blackbox, world’s first modular datacenter 2. SunRay 1. Chip multithreading "CoolThreads"
And the biggest innovation from Sun:
Kicked Butt Had Fun Didn’t CHeat Loved our customers Changed computing for ever
Scott explained why SPARC, Solaris, MySQL, Java are here to stay. "Kick Butt, Have Fun" is truly the spirit at Sun
James Gosling, the father of Java, showed up on the stage to talk about Java’s relevance for Oracle. Also showed "The Gospel of Java according to James" and the video is shown below:
On a personal note, this is my first Open World and am totally amazed by the size of attendees, and it’s only a Su
nday. The entire Howard St is shutdown and tents are installed to accommodate the conference. All 3 Moscone halls (North, South, and West) are used. A scale down replica of Larry’s "Rising Sun" is also displayed on Howard Street. And for the first time in 10 years, I’m getting only an Exhibitor badge at Moscone
This Tip Of The Day explains how to expose an existing Oracle database table as a RESTful Web service endpoint using NetBeans tooling and deployed on GlassFish.
Create a new "Web application" and name the project "RestfulOracle":
click on "Next >".
Choose the newly added server and "Java EE 6 Web" as the Java EE version:
and click on "Finish".
Create JPA entities for "HR" schema. The steps outlined below uses NetBeans solely for creating the JPA entities. Alternatively, TOTD #108 explains how to define a JDBC connection pool and JDBC resource using "asadmin" CLI and then use that resource from within NetBeans. Either way, the JDBC resource is stored in the underlying "domain.xml".
Right-click on the project and select "New", "Entity Classes from Database…".
In "Data Source:" select "New Data Source…" as shown below:
Specify the JNDI name as "jdbc/hr" and choose the pre-configured database connection as shown below:
TOTD #107 explains how to configure Oracle database in NetBeans.
In the list of "Available Tables:", select "EMPLOYEES" and click on "Add >" to see the following:
Notice the list of related tables are included as well. Click on "Next >".
Specify the package name as "model".
Click on "Create Persistence Unit…", take the defaults, and click on "Create":
and click on "Finish". Notice EclipseLink, the reference implementation for JPA 2.0, is used as the persistence provider. This generates POJOs that provide database access using JPA 2.0 APIs. These APIs are included as part of the Java EE 6 platform.
Create RESTful entities
Right-click on the project and select "RESTful Web Services from Entity Classes…":
Select "Employees (model.Employees)" from "Available Entity Classes:" and click on "Add >" to see the following:
click on "Next >", take the defaults, and click on "Finish". This generates a bunch of wrapper classes using JAX-RS to expose the JPA Entity classes as RESTful Web services. JAX-RS 1.1 is also included as part of the Java EE 6 platform.
Run the Web service
Right-click the project and select "Test RESTful Web Services":
This deploys the created Web application on the selected GlassFish build and displays the following page in the default browser:
Click on "deparmentss" and then on "Test" button to see the output as:
Clicking the "Test" button issues a GET request to "http://localhost:8080/RestfulOracle/resources/departmentss". This uses the generated JAX-RS wrapper classes to talk to the database using JPA entity classes and query the first 10 rows from the "DEPARTMENTS" table. The response is then JSON formatted using JAX-RS wrapper classes and is returned to the requesting page which then displays it nicely formatted in the table. It also shows l-level deep department’s relationship to other entities. If the "expandLevel" on the above page is set to "0", then the following output is shown:
The "Raw View" (JSON data) of the original output looks like:
Notice this is the raw JSON output generated by the JAX-RS wrapper classes. The "Http Monitor" traffic looks like:
The format of data returned can be changed from "application/json" to "application/xml" as shown below:
And even a POST reque
st can be generated.
Do you have the need to expose your Oracle database tables as RESTful entities ?
TOTD #110 explained how to create a brand new Rails application using Oracle database and run it using GlassFish v Gem. This Tip Of The Day explains how to create a scaffold for a sample schema that ships with Oracle database. Even though Rails Scaffold are good for, well, scaffolding but they do get you started easily. This blog will use the sample HR schema that comes along with Oracle database.
Lets get started!
Copy the reverse_scaffold script in the "script" directory of your application created in TOTD #110. This script generates Model and Forms from a pre-existing database table. More details about this script are here.
Edit "config/database.yml" and change the "development" section to:
Edit "app/models/department.rb" and specify the primary key to "department_id" column by adding:
set_primary_key "department_id"
Run the application as:
~/samples/v3/rails/oracle/bookstore >~/tools/jruby/bin/jruby -S glassfish -l
Starting GlassFish server at: 129.145.133.197:3000 in development environment...
Writing log messages to: /Users/arungupta/samples/v3/rails/oracle/bookstore/log/development.log.
Press Ctrl+C to stop.
Oct 6, 2009 2:14:19 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Listening on port 3000
. . .
The application is now accessible at "http://localhost:3000/departments" and looks like:
Similarly, create the model and forms for "employees" table as: