Miles to go …

August 18, 2009

LOTD #22: How to inject JPA resources ? – PersistenceUnit vs PersistenceContext

Filed under: glassfish, lotd — Tags: , , , , — arungupta @ 3:00 am

Java Persistence API defines a standard object/relational mapping using POJOs. In JPA, a persistence unit is described using “persistence.xml”, bundled with the web application, injected into your web application and then POJOs are used to access all the information from the underlying persistence mechanism such as a database.

JPA can injected into your application couple of different ways as shown below:

@PersistenceUnit
EntityManagerFactory emf;

and

@PersistenceContext
EntityManager manager;

Which one is preferred, why, and pros/cons are very clearly explained in (slightly old but very relevant) this blog. It also discusses a JNDI approach.

In case you are interested in the summary:

  • Use “@PersistenceUnit EntityManagerFactory” for Servlets because of thread safety
  • Use “@PersistenceContext EntityManager” in EJBs for simpler/cleaner code

Read other JPA related entries.
All previous entries in this series are archived at LOTD.

Technorati: lotd glassfish jpa javaee persistence

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 22, 2009

LOTD #21: Production Deployment Tips for running Rails on GlassFish v2 using Windows

Filed under: lotd, web2.0 — arungupta @ 2:26 pm

SeaChange Affinity uses Rails and GlassFish as their deployment platform. One of their core developers posted tips based upon their experience so far and they are available at:

Rails on GlassFish v2 using Windows

Here are some of the quotes:

Glassfish can really handle a heavy load

and

handling 400 simultaneous users under a supremely heavy load, the memory was holding great

All previous links in this series are archived at LOTD.

Technorati: lotd glassfish jruby rubyonrails windows

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 9, 2009

LOTD #20: How to create a JPA application using GlassFish Tools Bundle for Eclipse ?

Filed under: eclipse, general, lotd — Tags: — arungupta @ 11:30 am

Here is a great screencast (from the community) that shows how to create a JPA application using EclipseLink and deploy on GlassFish v2.1 – all using GlassFish Tools Bundle for Eclipse.

Click on the image below for the video:

Thanks!

I’ll work on a MySQL version of it :)

All previous links in this series are archived at LOTD.

Technorati: lotd glassfish eclipse jpa javadb screencast

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 7, 2009

LOTD #19: Securing GlassFish Installation

Filed under: general, lotd — arungupta @ 4:00 am

Found great (old) blogs (part 1, part 2) by Masoud Kalali that discusses the different ways to secure a GlassFish installation.

Changing master password and admin console passwords (both web-based and CLI) are two fairly trivial operations:

/tmp/glassfish >./bin/asadmin change-master-password
Please enter the new master password>changeit2
Please enter the new master password again>changeit2
Master password changed for domain domain1

and

/tmp/glassfish >./bin/asadmin change-admin-password
Please enter the old admin password>adminadmin
Please enter the new admin password>adminadmin2
Please enter the new admin password again>adminadmin2
Updated .asadminpass file with new password.
Command change-admin-password executed successfully.

And then the blog discusses how to secure administration listener using client-cert authentication or mutual authentication, reduce the visibility of listeners (as appropriate), and other similar techniques. Read Part 1 and Part 2.

The GlassFish Administration Guide provide more details on how to manage your GlassFish installation!

Technorati: glassfish administration security

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 1, 2009

LOTD #18: Campus Ambassadors presenting on GlassFish – France & India

Filed under: lotd, web2.0 — arungupta @ 12:00 pm

Agnieszka and Julien, the Sun Campus Ambassadors at INSA Lyon presented on GlassFish. Read the complete report here and enjoy a picture:

Here is another report on Hibernate/NetBeans/GlassFish presentation – again at INSA Lyon.

Dwarkanath, the Campus Ambassador at Sastra, presented on GlassFish as part of Student Technology Camp. Read the complete report here and enjoy a picture:

If you are interested in learning/talking about GlassFish at your university, spotlight.dev.java.net/start provides a comprehensive set of slides (with speaker notes), demos, screencasts, training materials and other resources to get you started!

All previous links in this series are archived at LOTD.

Technorati: lotd glassfish students campusambassadors france india spotlight

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 9, 2009

LOTD #17: Sun GlassFish Enterprise Server Administration and Deployment Course – SAS 4455

Filed under: lotd, web2.0 — arungupta @ 5:00 am


Interested in learning how to configure, administer, and deploy web applications, EJB applications, and Web services on GlassFish ?

This 4-day instructor-led workshop (with numerous hands-on labs) introduces you to various Sun GlassFish Enterprise Server (GlassFish) concepts and functions ranging from introductory to advanced and provides you with hands-on experience via remote labs. You also learn to enable various advanced GlassFish features, such as in-memory replication, high availability database (HADB), load balancing, monitoring and logging, clustering, and security.

Upon completion of this course, students should be able to:

  • Install, upgrade, migrate, and uninstall GlassFish
  • Configure GlassFish
  • Create a clustered GlassFish environment
  • Deploy applications in GlassFish
  • Perform logging and monitoring in GlassFish
  • Install and configure the load balancer plug-in
  • Configure and use in-memory replication
  • Configure and use HADB for high availability
  • Configure advanced features of GlassFish
  • Configure the security features of GlassFish
  • Configure and work with databases
  • Work with Sun Java System Message Queue (Message Queue) Clustered Application Server

The class is offered in different cities across the United States. You can even request a dedicated class for your organization.

Register today!

If the timings/location don’t work out, you can even take an online version of this course from SAS-1600: GlassFish Application Server: Administration Bundle.

All previous links in this series are archived at LOTD.

Technorati: lotd glassfish administration deployment training course

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

February 4, 2009

LOTD #16: Hotspot Flags, JRuby Version String, and JRuby/MRI Benchmark

Filed under: lotd, web2.0 — arungupta @ 5:00 am

This post shares 3 links that were recently published.

The first one is about the Favorite Hotspot JVM Flags by Charlie. See how you can use them for tweaking performance or investigating runtime metrics.

The second one is about using JRuby Version String. It explains the detailed meaning of the version string printed by “jruby –version”. If you read it carefully then you know the date, hardware, platform, SVN revision and even state of Charlie’s local git-svn clone.

The third and the last one is about benchmark results between MRI and JRuby with the following summary:

From my tests it appears that MRI is faster in single threaded mode, but JRuby makes up for the loss big time in the multi-threaded tests. It’s also interesting to see that the multi-threaded mode gives MRI(green threads) a performance boost, but it’s nowhere close to the boost that JRuby(native threads) can squeeze out from using multiple threads.

Read Igor’s report for more results.

And while you are reading this entry, did you know that GlassFish Gem 0.9.2 was recently released ? Use it for running your Rails applications seamlessly :)

All previous entries in this series are archived at LOTD.

Technorati: lotd glassfish v3 gem jruby ruby hotspot vm

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

December 3, 2008

LOTD #15: Deploying Merb application on GlassFish v3 using Warbler

Filed under: lotd, web2.0 — arungupta @ 9:14 am

GlassFish v3 with Merb and Warbler explains how to use Warbler to deploy a Merb application on GlassFish v3. Here is a quote from the blog:

this lovely server had a gem which you can use to fire up a Glassfish server. Easy as pie and within no time at all we were developing our Merb app on Glassfish.

The blog requires some workaround for Warbler and Nick is planning to fix them in the next rev. And other workaround is required because of Webrat’s recently introduced dependency on Nokogiri which does not run on JRuby yet.

In addition, TOTD #52 explains how to deploy a Merb application using GlassFish gem and TOTD #53 explains how to create a scaffold in Merb.

Submit your Merb/GlassFish bugs here, talk to us using GlassFish Forum, and get the latest information on JRuby wiki.

All previous entries in this series are archived at LOTD.

Technorati: lotd glassfish v3 gem warbler merb

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 24, 2008

LOTD #14: New Whitepaper: GlassFish High Availability Reference Configurations for a Virtualized Environment

Filed under: general, lotd — arungupta @ 5:00 am


GlassFish v2 allows you to configure cluster of multiple nodes/instances to meet various availability requirements, from the highly scalable service availability configuration to the business-critical, 99.999% service-and-data availability configuration. A cluster can be deployed using different toplogies with a choice of service/data availability, in-Memory/HADB, co-located/non-colocated and other factors. This new white paper explains reference configurations on that can be used for deploying business services.

Access it here!

All previous entries in this series are archived at LOTD.

Technorati: lotd glassfish clustering whitepaper

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 12, 2008

LOTD #13: Warbling with RMagick on GlassFish

Filed under: lotd, web2.0 — arungupta @ 5:30 am

GlassFish with RMagick explains the Warbler configuration required for using RMagick with GlassFish.

Did you know Rails application can be natively deployed on GlassFish v3 Prelude ? And you can even buy production support!

All previous entries in this series are archived at LOTD.

Technorati: lotd rubyonrails rmagick glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Older Posts »

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress