The Artima Developer Community
Sponsored Link

Java Buzz Forum
Configuring default settings on JBoss CMP

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Norman Richards

Posts: 396
Nickname: orb
Registered: Jun, 2003

Norman Richards is co-author of XDoclet in Action
Configuring default settings on JBoss CMP Posted: Aug 4, 2003 5:21 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Norman Richards.
Original Post: Configuring default settings on JBoss CMP
Feed Title: Orb [norman richards]
Feed URL: http://members.capmac.org/~orb/blog.cgi/tech/java?flav=rss
Feed Description: Monkey number 312,978,199
Latest Java Buzz Posts
Latest Java Buzz Posts by Norman Richards
Latest Posts From Orb [norman richards]

Advertisement

In JBoss, everything is configurable. Newcomers to JBoss often get disoriented. I know I was lost when I first started. I've had a couple people ask me about basic JBoss configuration, so I thought I'd write up something real quick to help point people in the right direction.

In JBoss (3.x) there are 2 configuration files that related to CMP beans, jboss.xml and jbosscmp-jdbc.xml. (or jaws.xml if you are still working in 2.4 land) If you've been working with JBoss, you should be familiar with those. What most people don't realize is that those files only tell half the story. JBoss provides system wide versions of those files that contain system-wide defaults. In your conf directory, you should find standardjboss.xml and standardjboss-cmp.xml. Looking at this files will explain a lot of the behaviour you are seeing in JBoss.

For example, if you've ever wondered why your application defaults to the internal hypersonic database, just look at the default cmp file. The default datasource definitions are right there, along with all the database mapping details. What type does your java.sql.Date or your java.lang.Boolean map to for SQL Server? How are locks and constraints managed? It's all there for you to see. Of course you can make changes to the defaults if you want to, but I've found that it's usually better to override the values at the application level instead of at the system level.

Even more interesting is standardjboss.xml. You can see the interceptor chains and caching policies for your beans. You can also see all the standard container configurations for beans. This is incredibly useful. I had to deploy some BMP beans written for weblogic in JBoss not long ago. These beans were written using weblogic's shared database configuration. By default, JBoss will use the Standard BMP EntityBean configuration for beans.

Without getting too technical that configuration uses commit option A. (assumes exclusive database access) I needed to use commit option B (shared database) so the beans would work like they did in weblogic. By looking through standardjboss.xml, I found a configuration that looked like what I wanted, Instance Per Transaction BMP EntityBean. I just needed to refer to that configuration in my jboss.xml file. Of course, if none of the configurations worked, I could have taken the closest one and modified it for my needs.

When working with JBoss, everything is exposed for you to view and tinker with. At first it can be a bit overwhelming, especially when much of JBoss isn't very well documented, but if you play around with it will all start to make sense. Or so I've been told... :)

Read: Configuring default settings on JBoss CMP

Topic: When geeks sail Previous Topic   Next Topic Topic: Know Your Role! (But Fill in Where You're Needed)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use