RE: [JBoss-user] Beans calling Beans
I would suggest applying the model-view-controller design pattern to this function. The model or data model would be an MBean loaded when the server starts. The session bean could be a view-controller that provides data from the model to worker beans via method calls. Any EJBs that use this session bean have to have their deployment descriptor set up with the correct resource reference. The view-controller could also contain methods to perform administrative operations on the metadata, such as refreshing it if necessary. Check the dtd for ejb-jar. You need to include the ejb-ref tag. -Original Message-From: Brian Farrar [mailto:[EMAIL PROTECTED]]Sent: Thursday, April 19, 2001 9:39 PMTo: [EMAIL PROTECTED]Subject: [JBoss-user] Beans calling Beans I have a service bean (stateless session) which maintains metadata on my system (call it MSB.)MSB is used by other beans (call themWorker Beans.) It appears that I must deploy the MSB first (which I would expect.) However when I deploy the Worker Beans that use the MSB they give an error at deployment because the MSB is unknown (apparently the prior deployment of the MSB does not make it available.) I figure I have two choices, bundle the necessary MSB classes (probably just the home interface) in with the Worker Beans or put these definitions in the JBOSS CLASSPATH so it will be available at deployment of the Worker Beans. I chose the second choice, this does give the appearance of working (one never knows if it is for the right or wrong reason though.) What I am wondering is Should my deployment of the MSB allow for the deployment of the Worker Beans without me forcing the MSB in the JBOSS CLASSPATH (or in the Worker Beans jar file)? What is the proper manner to bundle and deploy beans which are used by or are using other beans? Brian Farrar
RE: [JBoss-user] development / deployment / debug
I have been debugging code for over twenty years and have always found logging output statements much more useful than interactive debuggers. I think that this is especially true in the EJB environment. What I would suggest is the following: 1. instrument your EJB with log statements with different priorty levels. Select these priority levels to correspond to EJB and third party logging priority levels (INFO, WARN, ERROR, DEBUG are common). 2. instrument you EJB with DEBUG statements that capture state transitions and variable values. 3. use the features of the logging package to "turn off" DEBUG logging in production. Leave the code in the EJB. 4. create your own logging wrapper class that wraps the EJB or third party logging. This makes it easy to change logging packages or shut off logging completely. For instance, the Java compiler will eliminate code that will not be executed. example: private static final boolean DEBUG_ON = false; ... myDebugLogger("entered myBusinessMethod: " + varA + ", " + varB); ... public myDebugLogger(String message) { if (DEBUG_ON) { // log the message using the EJB or third party logger } } The above code would handle debug statements in a production environment with little overhead. I'd suggest looking at the org.jboss.logger package. Also, take a look at the log4j project (http://jakarta.apache.org/log4j/docs/index.html). Theres a good article at the Java Developer's Journal site about log4j (Volume 5, Issue 11). -Original Message- From: Nathan Coast [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 4:34 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] development / deployment / debug Hi, I'm starting developing / deploying with jboss and would like to pick the brains of more experienced jboss users about how to work more efficiently. Debug - I'm using jswat (open source debugger) connecting remotely to jboss to debug servlet / ejb code. This is proving too slow to be practical. I'm using embedded tomcat as the web container and I'm starting the jboss with these flags: java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main Is this the most optimal way to debug code? Would different configurations be faster (tomcat in different VM?). Is the debug slow because I'm using jswat - are there other free / open debug tools you'd reccomend? Deployment - This is a bit of a strange one, whenever I make any changes to code, rebuild and redeploy (ear file), the code changes only seem to take effect when I rebuild and redeploy a second time. Any possible reason for this happening or am I just imagining it / messing up deployment somehow? Is it possible to redeploy individual components of an application (ejb jar, war etc) so to not have to do the whole build / deploy process for the ear file? Thanks Nathan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] How to configure compatible DataSource JNDI for WebLogic and JBoss
danch asked How's that going for you? I'm very interested in any issues that crop up under load. I'm using JBoss 2.0 for my testing because it seems stable. I'm still stabilizing the stress testing tool and tweaking the server configurations, but the results so far for JBoss are impressive. I'm stress testing the same EJBs on JBoss and WebLogic. I picked WebLogic because I know it, it's the market leading EJB server, and it works better than other EJB servers I've used (other than JBoss). The framework I've developed is not intended to be a server benchmark tool like ECPerf, but is for stress-testing individual beans. But, I am using it to answer the question of whether JBoss is a contender as world class EJB server. The service times of a stateless and stateful session bean (the shopping bag examples from the Tom Valesky book) are substantially less for JBoss. I attribute this performance advantage to the JBoss architecture - using dynamic proxies rather than instantiating EJB objects. Any comments on this conclusion? Testing up to 1000 concurrent clients, I haven't been able to break JBoss. I have learned a few tuning tricks like: - increase the memory in the java command in the run file (like, duh). example -ms164m -mx164m - increase the maximum for stateful session bean instances in standardjboss.xml Another question: are tuning tips documented anywhere? I expect to have this sorted out in several weeks. But it looks to me like JBoss wins on dynamic deployment, performance and scalability. Bob Swarr -Original Message- From: danch [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:02 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] How to configure compatible DataSource JNDI for WebLogic and JBoss Swarr, Bob wrote: snip! Voila, you've handled an EJB server difference with the deployment descriptor (and this is why we have deployment descriptors). You don't have to recompile the EJB when you run in WebLogic or JBoss. You just need to redeploy it with a different deployment descriptor (you have to do that anyway). This seems to be a pretty solid workaround. I'm using in EJBs that I'm stress testing on WebLogic and JBoss (up to 1000 concurrent clients so far). How's that going for you? I'm very interested in any issues that crop up under load. -danch ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] BMP bean deployement - Need Help
The deployer is correct. The deployment discriptor is invalid. What ever happened to desk-checking? See my comments below. -Original Message- From: ravi kumar rongali [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 9:28 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] BMP bean deployement - Need Help Hi, I am getting an error while deploying a CMP bean in JBOSS. It is saying that 'No valid deployment descriptor was found within this URL: file:/D:/jboss2.0/jBoss-2.0_FINAL/deploy/ship.jar'. The same error is coming when i am deploying Richard Hafel book's chapter 4 ship bean. For BMP bean, do i need to specify any other XML file other than ejb-jar.xml. This my ejb-jar.xml file... ?xml version="1.0"? !DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd" ejb-jar enterprise-beans entity description This bean represents a cruise ship. /description ejb-nameShipBean/ejb-name homecom.titan.ship.ShipHome/home remotecom.titan.ship.Ship/remote ejb-classcom.titan.ship.ShipBean/ejb-class persistence-typeBean/persistence-type prim-key-classcom.titan.ship.ShipPK/prim-key-class reentrantFalse/reentrant resource-ref descriptionDataSource for the Titan database/description res-ref-nameJetEngineDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth resource-ref Put a closing tag here! like this /resource-ref /entity /enterprise-beans assembly-descriptor security-role description This role represents everyone who is allowed full access to the Ship bean. /description role-nameeveryone/role-name /security-role method-permission role-nameeveryone/role-name method ejb-nameShipBean/ejb-name method-name*/method-name /method /method-permission container-transaction method ejb-nameShipBean/ejb-name method-name*/method-name /method trans-attributeRequired/trans-attribute /container-transaction /assembly-descriptor /ejb-jar Please provide a solution for me thank you... ravi kumar. _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Gosh, this is slow !
It looks to me like you are accessing multiple entity beans through individual get methods and that is something you should never, not ever do. It is really, really slow. Depending on the number of addresses, you could be generating a really large number of remote references, going through the whole RMI remote invocation loop over and over. Actually, ten seconds is not bad considering that you are bringing the data into Swing. Here's how you can make it perform: 1. As a general rule don't access entity beans directly from a client. Wrap your entity beans within a stateless session bean. This is especially true when you're accessing data that returns a set. In this case the stateless session bean retrieves the entity beans and packages the data into a vector which it returns to the client. Or, the stateless session bean could retrieve the data and plunk it into a TableModel and send that (serializable) object to the Swing client. In either case, you make the references to the entity bean local and have replaced numerous remote references with just several. This is goodness. The difference in performance will be orders of magnitude. 2. Use bulk get and set operations for retrieving or updating all of the data members of the entiry bean. These methods can be used by the session bean when it retrieves the data. You replace numerous get operations with just one. 3. As a general rule don't use entity beans as wrappers for rows in a database. The intelligent use of an entity bean is as a reusable business object. If you just want to retrieve some rows in a database (especially if it is an ad-hoc query for data) do this in some framework classes that encapsulate the complexities of JDBC and SQL. So, what is the difference between a reusable business object and some rows in a database. I'll offer an example to clarify this point. Let's say that you have something like a customer list and it is used in many different ways in the organization. You want to make sure that it is updated and displayed consistenly throughout the organization. An entity bean is a good way to encapsulate this data. However, rule number 1 still applies. Wrap the access to this entity bean with a stateless session bean. The stateless session bean might also apply some business logic such as are you permitted to view this business object. -Original Message- From: fractals [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 4:48 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] Gosh, this is slow ! OK, this is my first "real" test of JBoss: I tried to make an address book with my own data which consist of ca 300 records. I just want to show the addresses in a JTable, so I use code like so: Object ref = jndiContext.lookup("totg/AddressBook"); AddressBookHome home = (AddressBookHome) PortableRemoteObject.narrow (ref, AddressBookHome.class); AddressBook addressBook = home.create( user.getId () ); VisitCard [] vcards = addressBook.listAll (); java.util.Vector data = new java.util.Vector (); for ( int i=0; ivcards.length; i++ ) { Vector v = new Vector (); v.add ( vcards [i].getFirstname() ); v.add ( vcards [i].getLastname() ); v.add ( vcards [i].getCompany () ); v.add ( vcards [i].getEmail () ); v.add ( vcards [i].getStreetAddress1 () ); v.add ( vcards [i].getStreetNumber () ); v.add ( vcards [i].getCity () ); v.add ( vcards [i].getCountry () ); v.add ( vcards [i].getPhone1 () ); v.add ( vcards [i].getPhone2 () ); data.add ( v ); } DefaultTableModel model = new DefaultTableModel (); Vector columnNames = new Vector (); columnNames.add ( "First name" ); columnNames.add ( "Last name" ); columnNames.add ( "Company" ); columnNames.add ( "E-mail" ); columnNames.add ( "Street address" ); columnNames.add ( "Nr" ); columnNames.add ( "City" ); columnNames.add ( "Country" ); columnNames.add ( "Phone 1" ); columnNames.add ( "Phone2" ); model.setDataVector ( data, columnNames ); addressBookTable.setModel ( model ); ...fairly explicit I think. The whole thing takes approx 10 secs, which is A LOT for something as simple as that. I thought the beans would be instantiated and thus cached for the second time I called them, but nope. But this kind of thing might just not be defaulted, so if someone could hint me on this... Any idea in general to get this thing go faster ? It's quite an essential requirement for me. Thanks in advance, Candide ___ JBoss-user mailing list [EMAIL PROTECTED]
RE: [JBoss-user] Writing a finder which returns max id used
What about java.rmi.server.UID? It has a hashCode() method that returns an integer. -Original Message- From: Peter Routtier-Wone [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 04, 2001 11:45 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Writing a finder which returns max id used You can also use the facilities of the database engine to help with this problem. Oracle has sequences which guarantee a unique number even with concurrent access. Sybase has autoincrement columns. Use of the database as a UID dispenser has its merits with respect to the concurrency issue, but it raises portability issues. Another possibility is one of the few really good ideas to come out of Redmond - the GUID. GUIDs are unique in space and time. The first eight bytes are a machine identifier (based on the MAC address of your network interface, if I remember correctly) and the second eight bytes are a timestamp. The benefit of this approach is that it is not necessary to contact any other computer to derive a unique value. The downside is that string comparisons - and worse yet string based indexes - are *expensive*. But they are seldom as expensive as contacting another machine, or rolling back and re-running a transaction. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] I need ammo. -WL SUX
Another suggestion. Try Weblogic 6.0. It contains many bug fixes, including clustering. It also uses JDK 1.3 and the garbage collection under load with hotspot is much improved. Also, EJB 1.1 or 2.0 works better. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 12:39 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] I need ammo. -WL SUX We've been trying to get an install of Weblogic51 up and running for 4 months! BEA has as of yet been unable to get it run either. They finally admitted that they have a SERIOUS problem with windows and clustering. two thinks to consider, JBoss doesn't offer clustering yet. So the statement is no good. Also, why not cluster on Unix boxes, since you want scalability, Windows is not going to offer it anyway :) :) ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] MySql and JBoss
Currently, I'm running JBoss 2.0 with the Oracle thin driver and the mm.mysql-2.0.4 driver. The main problem I had setting up mySQL as a datasource was setting up users and priveleges in mySQL. Read the mySQL documentation carefully. Here are my configuration entries. jboss.properities jdbc.drivers=org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver jboss.conf MLET CODE = "org.jboss.jdbc.JdbcProvider" ARCHIVE="jboss.jar,classes12.jar,mysql.jar" CODEBASE="../../lib/ext/" /MLET MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar,mysql.jar" CODEBASE="../../lib/ext/" ARG TYPE="java.lang.String" VALUE="mySQLPool" ARG TYPE="java.lang.String" VALUE="org.jboss.minerva.xa.XADataSourceImpl" /MLET jboss.jcml mbean name="DefaultDomain:service=XADataSource,name=mySQLPool" attribute name="Properties"/attribute attribute name="URL"jdbc:mysql://localhost/store/attribute attribute name="GCMinIdleTime"120/attribute attribute name="JDBCUser"store/attribute attribute name="MaxSize"32/attribute attribute name="Password"manager/attribute attribute name="GCEnabled"false/attribute attribute name="InvalidateOnError"false/attribute attribute name="TimestampUsed"false/attribute attribute name="Blocking"true/attribute attribute name="GCInterval"12/attribute attribute name="IdleTimeout"180/attribute attribute name="IdleTimeoutEnabled"false/attribute attribute name="LoggingEnabled"false/attribute attribute name="MaxIdleTimeoutPercent"1.0/attribute attribute name="MinSize"32/attribute /mbean -Original Message- From: Steven Webster [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 31, 2001 1:34 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] MySql and JBoss Hi all, I'm having a real hard time trying to get JBoss working with MySQL; reading through the list archives, all I can really ascertain is that the docs are not necessarily correct with regards to setting up JBoss. Has anyone successfully setup JBoss with MySql, that could perhaps send me the various entries they've made in the properties, conf and jcml files, to get things working ? I've got the driver installed ok, and checked it works with some simple JDBC client code (non EJB code). As an aside; in looking for the answer, I've noticed a few people allude to the jboss.conf file being deprecated, in preference for the jboss.jcml file - is this the case ? Also; when I make changes for logging to the .jcml file, including adding the GUI Logger (I guess I'm answering my own question from earlier today), the changes don't seem to take immediate effect...how often are these files read, and are they parsed into a cached format in any way, shape or form ?? Help :) Steven ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] problem with oracle connection pool, Pl. help me its very urgent
I believe that you're not getting the oracle database, but the "default" datasource. I ran into the same problem (using the Oracle thin driver). I put in a JDBC call that retrieved that database name and displayed it with a System.out.println() to debug this problem. Just follow the directions in the doc until you get it right. -Original Message-From: chandra poluru [mailto:[EMAIL PROTECTED]]Sent: Wednesday, March 28, 2001 11:55 PMTo: [EMAIL PROTECTED]Subject: [JBoss-user] problem with oracle connection pool, Pl. help me its very urgent hi, i am using jboss-2.1, jdk1.3, oracle8i and i have created one connection pool "OracleDb" the pool has been created successfully. iam accessing the connection pool in an entity ejb. iam able get the connection. i have printed the connection object, and it's giving as org.opentools.minerva.jdbc.xa.wrapper.XAConnection@482bad and iam trying to use CallableStatement with that connection, and it's throwing SQLException : This function is not supported how to get the XAOracleConnection instead of this minervaconnection. please provide me with all the scripts in jboss.jcml, jboss.conf and also ejb-jar.xml, jboss.xml. pl. hellp me, its very urgent for me.
RE: [JBoss-user] iplanet
Title: RE: [JBoss-user] iplanet iPlanet is destined for obscurity. WebLogic is increasing its market share over all other competitors, including WebSphere.WebLogic supports Linux. JBoss is the only EJB Server that I''ve tested (including iPlanet and WebSphere) that comes close to WebLogic on performance, functionality, ease of use and conformance to standards. Right now I'nm running a benchmark on both WebLogic and JBoss. If iPlanet makes their product more proprietary the marketplace will punish them severely. -Original Message-From: Sam [mailto:[EMAIL PROTECTED]]Sent: Thursday, March 29, 2001 11:51 AMTo: '[EMAIL PROTECTED]'Subject: RE: [JBoss-user] iplanet Just a warning if you plan on using Linux. Since AOL/Netscape formed their alliance with Sun, iplanet has been systematically dropping Linux support on all product lines. Notice that Directory Server 5.0beta does not have the Linux version. ;-) Sam -Original Message- From: Roman Seidl [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 29, 2001 1:00 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] iplanet Hello, Anyone of you know iplanet appserver? I'd like to know if it has troubles, disadvantages (besides the price) etc. Pls answer to my private email as this is rather off-topic (sorry for that). -- Best regards, Roman mailto:[EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] access modifiers lost in EJB programming ?
According to the java language specification an interface is inherently PUBLIC and ABSTRACT. If you try to use any access attribute such as PROTECTED or PRIVATE, you will get a syntax error. Since the EJB home and remote objects are defined as interfaces, there is no way to limit visibility through access attributes such as PRIVATE or PROTECTED. -Original Message- From: fractals [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 7:36 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] access modifiers lost in EJB programming ? I don't think of an interface as a "pattern specifically about the publicly available views/facets of an object". You can define interfaces that are visible only from the package, and in fact, this is a feature that I use often in my designs. In my opinion, interfaces are a means for specification: they state what you have to implement if you want to be coherent with your designs. That is something that applies as well for what you intend for the general public as for what you intend for your application's internals. In EJB, I see the home and remote interfaces for a specification as well: they state what features you want the container/application server to exhibit from a specification you give and partially implement. I the case of ejb-references, you could want to make calls on remote objects that you wouldn't want others to see. But if I'd like to have something like this in j2ee, it's probably due to the fact that I'm a beginner in using those tools ;-) regards, candide There is no way to define anything but public method in any interface. This is not limited to remote interfaces or EJB. Interfaces are an OO pattern specifically about the publicly available views/facets of an object. If you want to hide some method of an EJB implementation then don't put the method in the public interface. EJB adds the ability to restrict who can access the public methods as well, so if the method should be available to some you have this path as well. - Original Message - From: "fractals" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 05, 2001 2:37 PM Subject: [JBoss-user] access modifiers lost in EJB programming ? AFAIK, there's no way to make a method anything else than public in a remote interface. Sad, because I *would* like to hide some of the methods I define for some of my beans. Really, is there no way to get this cornerstone of OO programming back into the EJB realm ? Thanks, candide ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Hypersonic SQL
Try MySQL. I've tested it with JBoss and it seems to work well. The downloadable binary packaging is nearly commercial slick. O'Reilly puts out a good book on it. A commercial version is available (like Red Hat or Caldera Linux). The implementation of SQL is a fairly complete SQL2. It will be a whole bunch cheaper than Oracle. Bob -Original Message- From: Steven Webster [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 21, 2001 9:12 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] Hypersonic SQL Hi all, I've migrated some development work from Weblogic, over to JBoss, and am initially impressed. However, I'm a bit concerned that the default database used by JBoss for CMP Entity beans, Hypersonic SQL, seems to be no longer supported. What is the stance of the JBoss team on this...is Hypersonic still recommended as the default installation ? I know that I can change things to use Oracle 8i, MS SQL Server, etc, but for the time being, I'd rather stick with JBoss out-of-the-box as much as possible... So, for the time being, is there a client I can use to Hypersonic SQL, that would allow me to query the underlying DB, drop tables, etc ? The problem I'm having, is that having created a CMP Entity Bean, with 4 fields, then changing the CMP Entity Bean to have 5 fields, Hypersonic SQL doesn't seem to want to drop the old table (with 4 columns) and create the new table (with 5 columns). Does this seem sensible ? Any help greatly appreciated, Regards, Steven ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] LOCKING-WAITING
Marc, I think that the body of opinion in CS literature is consistent with your findings. Busy/wait burns cpu and leads to various programming problems (race, starvation, deadlock, etc). To address these problems a number of theorticians in concurrent programming, such as Brinch Hansen, developed the idea of a monitor. I guess today we would call it a design pattern. Some writers claim that Java wait() and notify() implement a monitor, although I've read that Brinch Hansen is critical of the Java implementation. Also, in the EJB benchmarks that I've run I've always found that if you try to run too many threads, you will reach a point where application performance declines, sometimes really dramatically. So, you need use the Goldilocks principle in tuning your application - not too few threads and not too many. Which leads to a question since I'm a JBoss novice. Is there a way to set the number of threads in JBoss? I use WebLogic regularly and it provides a configuration parameter that allows you to set the number of threads in the VM that the server uses. Bob -Original Message- From: Alexander Kogan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 21, 2001 10:07 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] LOCKING-WAITING marc fleury wrote: Just out of curiousity Simone... when we benched at SUN one of the big difference under load was the thread management. The best in terms of resource usage was put the thread to sleep (with a 5 sec timeout) and notify (1) and that REALLY flew and scaled REALLY well because the usage of CPU and sync was really low. This would be very good idea. For now, especially on Tru64 with JDK 1.3-1 LOKING-WAITING stuff eats a lot CPU and much more slow than on Sun. And why do we need timeout there? Is it possible to implement a sort of queue for that? Than you can put a new thread to the waiting list and when the current thread is done with the transaction it can call notify to release the tread from the waiting list. Am I talking junk? Do you put the threads to sleep in the current code base? I couldn't go down and look for myself, plus a little introduction on what you did with the new structure of cache sync would be helpful. As far as I can see from the code - no. Again, sorry if I am mistaken. regards torquemada -- __ Alexander Kogan PTC www.ptc.com [EMAIL PROTECTED]140 Kendrick St. Needham MA 02494 ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user