Re: [JBoss-dev] Connection Pool Configuration

2002-04-03 Thread Dain Sundstrom

Can this be set in the initial connection properties?  I don't know much 
about pool set-up, but David does (and I CCed him on this email).  Does 
the current pool code support setting of properties in the config file?

-dain

Giorgio42 wrote:

> Is JBoss CMP currently making any use
> of proprietary JDBC Driver implementation
> features?
> 
> Specifically, is the method 
> setDefaultRowPrefetch(int rows) provided
> by the Oracle thin client driver used?
> 
> My experience is, that this setting can have
> a huge impact on the performance of data-oriented
> applications, especially if they read large datasets.
> 
> Using reflection, the code need not directly depend on
> on the Oracle driver being in the classpath and still
> get compiled, like this:
> 
> java.lang.reflect.Method method = conn.getClass().getMethod("setDefaultRowPrefetch", 
>new Class[]{ int.class });
> method.invoke(conn, new Object[]{ new Integer(rowPrefetch) });
> 
> This could be added to (standardjboss)cmp-jdbc.xml
> configuration parameters.
> 
> JDBC3.0 defines a (small) set of standard properties for
> pooled connection sources (in section 11.7), so 
> this is a first step in standardizing this process.
> 
> Just a suggestion...
> 
> And a happy easter to the JBoss team!
> 
> Georg
> 
> _
> View thread online: http://main.jboss.org/thread.jsp?forum=66&thread=11768
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Long deployment file names... again

2002-04-03 Thread Dain Sundstrom

My $0.02.

I think that _filename would be the easiest to for developers to 
follow.  Even better would be if the UID was always the same length, so 
they would lineup in with ls or dir.

-dain

Jason Dillon wrote:

> For the cache, I initially implement a reproducable long url -> short 
> url using a CRC32 + shortfilename (which it still does), but I later 
> added a serialized hash for faster lookups + to make startup easier. The 
> cache impl is not really the issue here, it just tickles the real problem.
> 
> The main issue that I have is that our deployment system is pushing on 
> the edge of OS compatiblity by using these really long file names... 
> where it does not appear that we need to do so
> 
> I think we should either revert to number incremented (or new 
> UID().toString() prefixed filenames) or some other simple and shorter 
> reproducable mapping system.
> 
> Perhaps providing a mgmnt operation to reverse the maping is ok?  This 
> can simply be an in memory map, since the tmp/deploy stuff does not live 
> beyond the life of the VM.
> 
> If all we are using full url filenames for is for developer convienece, 
> then scew it, we don't need to be convienent at the expense of being 
> compatible.  If there is a real problem concering security policies, 
> then lets look into what our options are to solving that with out using 
> long filesnames.
> 
> Is there any issue short of developer conveience which motivated us to 
> use long filenames?
> 
> --jason
> 
> 
> David Jencks wrote:
> 
>> We had it working for a while with unique file names, namely an 
>> incremented
>> number/short-jar-name.  I don't care, going back to this is fine with 
>> me. Many people liked being able to find the deployed copy.
>>
>> This however is not reproducible, and I would expect that your cache 
>> would
>> need reproducible mappings.  If I am wrong, wonderful.  Otherwise I can't
>> think of much except a mapping file, maybe properties
>> url=number
>> to identify where the copy is.
>>
>>
>> david jencks
>>
>> On 2002.04.03 17:58:02 -0500 Jason Dillon wrote:
>>

 What is this problem? I think any reproducible 1-1 mapping will work,

>>> but I
>>>
 don't know of any other than using the whole URL.
 david jencks

>>> The problem is that on windows (ick) it limits the length of a 
>>> filename unreasonabily.  This problem shows up with the currently 
>>> deployment scheme of taking the entire URL of a deployment and using 
>>> that as the path under the ${jboss.server.home.dir}/tmp/deploy 
>>> directory.  This means that the length of the filename is now 
>>> "${jboss.server.home.dir}/tmp/deploy".length + url.toString.length.  
>>> If this is > then the giving crappy limit on win32 we are hosed.
>>>
>>> It would be *safer* to employ a different method for the url suffix 
>>> bits, as the first part is a sunk cost.  Sure we can tell users to 
>>> run from a different directory, using a shorter name, but we can't 
>>> really control the URLs that come in for deployment.
>>>
>>> I personally have the following setup (which I don not think
>>> unreasonable):
>>>
>>> base project dir: /home/jason/workspace/jboss/jboss-all (prefixed by 
>>> c:\cygwin for winblows)
>>>
>>> This means that the final value for ${jboss.server.home.dir} is:
>>>
>>> 
>C:\home\jason\workspace\jboss\jboss-all\build\output\jboss-3.0.0beta2\server\default 
>>>
>>>
>>> Now the deployments live under conf/ and deploy/ relative to this 
>>> path, longest filename currently seems to be:
>>>
>>> new-hsqldb-default-service.xml
>>>
>>> which makes the actual deployment file:
>>>
>>> 
>C:\home\jason\workspace\jboss\jboss-all\build\output\jboss-3.0.0beta2\server\default\deploy\new-hsqldb-default-service.xml
> 
>>>
>>>
>>> Now this full path will be constructed under:
>>>
>>> 
>C:\home\jason\workspace\jboss\jboss-all\build\output\jboss-3.0.0beta2\server\default\tmp\deploy
> 
>>>
>>>
>>> making the full deployed filename:
>>>
>>> 
>C:\home\jason\workspace\jboss\jboss-all\build\output\jboss-3.0.0beta2\server\default\tmp\deploy\C:\home\jason\workspace\jboss\jboss-all\build\output\jboss-3.0.0beta2\server\default\deploy\new-hsqldb-default-service.xml
> 
>>>
>>>
>>> with translations applied, I am too lazy for this at the moment.
>>>
>>> Now in comes the cache repository.  If I employed the same scheme, 
>>> then the deployment URL which is given to MainDeployer would be about 
>>> as long as the tmp\deploy version... which would then become even 
>>> longer once it was copied to tmp\deploy.
>>>
>>> See what I mean?  If this is all because of security policies, then I 
>>> suggest we need to find another way to implement the policy, perhaps 
>>> even punting easier configuration until 1.4 is the defacto.  If not 
>>> please explain why we need this, cause I just don't understand.
>>>
>>> These insanely long filenames are going to bite us... they have 
>>> already bitten me several times.
>>>
>>> There must be a better solution, which does

Re: [JBoss-dev] CMP Entity bean error messages

2002-04-03 Thread Dain Sundstrom

This is a user question, and should be posted in the forums or 
jboss-users list.  The problem is you have the ejb 1.1 doctype declared 
in your ejb-jar.xml, and not ejb 2.0 (you are using cmp2 correct?). 
Secondly, you are using jaws.xml which is depreciated, instead of the 
new jbosscmp-jdbc.xml file.  For more info on that file read the dtd, or 
buy my docs.

-dain

David Gadd wrote:

> I am creating and deploying a CMP Entity Bean into jBoss using the 
> example in chapter 7 of Mastering EJBs, 2nd edition (Roman). I am 
> getting error messages (see below). What am I doing wrong?
> 
> Here's what's in the jar:
> 
> remote interface: Product.class - contains getters and setters that 
> throw RemoteException
> home interface: ProductHome.class - a create method and 7 finder methods
> local interface: ProductLocal.class - contains getters and setters
> local home interface: ProductLocalHome.class - a create method and 7 
> finder methods
> primary key class: ProductPK - a wrapper class for the primary key
> 
> the entity bean: ProductBean.class -
> *the class is abstract (and implements EntityBean of course)
> *EntityContexts is the only member variable
> *an empty constructor is declared with no arguments
> *the getters and setters are declared as abstract methods
> *the container methods: ejbActivate(), ejbRemove(), ejbPassivate(), 
> ejbLoad(), ejbStore(), setEntityContext(EntityContext ctx), 
> unsetEntityContext(EntityContext ctx) are all included, but of course 
> have no database calls (its CMP)
> *ejbCreate is included with appropriate calls to the abstract set 
> methods and returning the primary key class
> *ejbPostCreate is included
> 
> ejb-jar.xml - lists the enterprise-beans/entity values: home, remove, 
> local-home, local, ejb-class, persistence, prim-key-class, re-entrant, 
> cmp-version (2.x), abstract-schema-name, and all 4 cmp-field entries. 
> Also lists 6 queries including their ejb-ql declared as CDATA. Also 
> includes the assembly-descriptor.
> 
> jaws.xml - lists the (tested and working) MySQL datasource as 
> java:/MySQLDS and typmapping of mySQL. After default entity I have 
> created a new entity named Product, table name product, and done O-R 
> mapping of all 4 fields to the 4 database columns. The rest of the file 
> is the default type-mappings list from standardjaws.xml (which of course 
> include mySQL).
> 
> jboss.xml - under enterprise-beans I have an entity entry, named by the 
> bean name (Product) and the jndi-name: product/Product and configuration 
> name set to Standard CMP EntityBean. resource-managers is empty, 
> enforce-ejb-restrictions is false, and container-configurations are just 
> the usual from standardjboss.xml
> 
> HERE'S THE ERROR:
> When I copy the jar to the deploy directory, I get two errors:
> [ERROR,ContainerFactory]
> Bean   : Product
> Section: 9.2.2
> Warning: The entity bean class must not be defined as abstract.
> 
> [ERROR,ContainerFactory]
> Bean   : Product
> Section: 9.2.2
> Warning: The entity bean class must define a public constructor that 
> takes no arguments.
> 
> The first one makes no sense. According to the book I'm studying, the 
> whole way a CMP Entity Bean works is that you declare it as abstract so 
> that the container can subclass it and provide its own code for the 
> subclassed abstract methods.
> 
> I don't understand the second error because my abstract entity bean 
> includes the constructor exactly as suggested in the manual, and 
> matching the above requirements:
> 
> public ProductBean() {}
> 
> Can anyone see what I have missed? Or does jBoss handle CMP's 
> differently than the expectations of the practise CMP entity bean I am 
> setting up from chapter 7 of Mastering EJB's?
> 
> Thanks very much,
> 
> David Gadd
> http://www.gaddzeit.com
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] AutoNumber in Jboss 3.0.0

2002-04-03 Thread Dain Sundstrom

I wasn't aware of this.  Are you sure it was removed?  If you are having 
problems, post again, and I'll ask around.

-dain

Marius Kotsbak wrote:

> On ons, 2002-03-27 at 23:13, jessica hekman wrote:
> 
>>I am trying to upgrade from 2.4 to 3.0 in order to use CMP 2.0. However, in moving 
>my application over to 3.0 I'm having trouble using the AutoNumber class. In 2.4 it 
>was in org.jboss.util; in 3.0 it is in org.jboss.varia.autonumber (so far, so good). 
>In 2.4 it was available in ext/jboss.jar; in 3.0 it does not seem to be built into 
>any jar files. Is this intentional? Am I missing it?
>>
>>I have been using AutoNumber to generate unique primary keys, which I understand 
>isn't yet handled in any better way in JBoss (but will be soon; I just need a 
>solution in the meantime).
>>
>>Thanks!
> 
> I see that this module is removed from the normal builds. What are we
> supposed to use for this purpose? the counter service? How does it work?
> 
> Marius
> SW dev. Boostcom.no
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] PK values and CMP commit option A

2002-04-03 Thread Dain Sundstrom

This select just verifies that the row still exists in the database, but 
is shouldn't be called in commit option A.  I was under the impression 
that in commit option A didn't call the actual find if the bean was 
still in the ready cache.  If this is happening after the bean is 
initially created or loaded (assuming you are not loading a ton of 
entities) then it is a bug.  If so, can you post a simple bug report to 
source forge.

Thanks,

-dain

Ignacio Coloma wrote:

> Hi, I am not doing anything weird enough to have this on the DB log when I
> call some CMP findByPrimaryKey with Commit Option A:
> 
> SELECT ID FROM FORMA_PAGO WHERE ID=81
> SELECT ID FROM COMERCIAL WHERE ID=4
> SELECT ID FROM CLIENTE WHERE ID=521
> SELECT ID FROM ZONA WHERE ID=1
> SELECT ID FROM PEDIDO WHERE ID=2166
> SELECT ID FROM PEDIDO WHERE ID=2166
> SELECT ID FROM PEDIDO WHERE ID=2166
> SELECT ID FROM PEDIDO WHERE ID=2166
> SELECT ID FROM PEDIDO WHERE ID=2166
> 
> I don't know if this is a bug or a feature. What is the purpose of checking
> the pk value? The record doesn't get read, though. My app performance would
> boost if these DB access could be avoided.
> 
> PS: No CMR here :)
> 
> 
> Ignacio Coloma Escribano
> Verdino Sistemas de InformaciĆ³n
> 629 151 669 - http://www.iverdino.com
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] JBoss and Apache

2002-03-24 Thread Dain Sundstrom

Scott,

I really can't see anything to gain by becoming a Jakarta project, other 
then more bureaucracy.

BTW, we do have the "whole stack".  We just support a pluggable web tier.

-dain

Scott Sanders wrote:

> As a jakarta committer, I have to say thanks for stating this as
> succintly as you did.
> 
> I also read the article and thought that it was a little harsh, but was
> not too worried about it.
> 
> I admire what Jboss is and what the Jboss group is attempting.  You guys
> are the next Linux/Apache.  Keep up the good work.
> 
> Nevertheless, IMHO IBM/Sun don't affect what Apache is doing to the
> extent that you think. But again MHO.
> 
> I would love to see you guys come to Apache and build the whole stack,
> but I also think you are doing fine where you are.
> 
> Cheers,
> Scott Sanders
> 
> PS.  Save me a tshirt ;)
> 
> 
>>-Original Message-
>>From: marc fleury [mailto:[EMAIL PROTECTED]] 
>>Sent: Saturday, March 23, 2002 3:22 PM
>>To: Ceki Gulcu; [EMAIL PROTECTED]
>>Subject: RE: [JBoss-dev] JBoss and Apache
>>
>>
>>|>The interview states very clearly where I stand...
>>|
>>|Actually, your comments in the interview came though like an 
>>|unwarranted attack against Jakarta whereas now your concern 
>>seems to be 
>>|focused on the business model which is a very legitimate concern.
>>
>>I am sorry if the interview ruffled some feathers. My 
>>intention was not to attack Jakarta. It was simply to state 
>>my view that JBoss Group and Jakarta have different agendas. 
>>JBoss Group does not aspire to be a non-profit organization. 
>>We actually want to pay for J2EE certification. Also, we are 
>>extremely protective of our independence. My feeling is that 
>>IBM is calling the shots at Apache right now. The JBoss LGPL 
>>license and JBoss Group brand are an important part of our 
>>business, as is our independence from larger organizations.
>>
>>|>The Apache Foundation model is incompatible with our professional
>>|vision. I
>>|>view the ASF as a failure of the open source business 
>>model.  I view 
>>|>Linux as an even bigger failure of the open source business 
>>model, so 
>>|>you see... :).
>>|
>>|Apache is rather big, Linux is even bigger. So 
>>characterizing Apache or 
>>|Linux as one big flop is inaccurate. I don't think Apache is about 
>>|financial success.
>>|We measure success by a different yardstick. I would even 
>>adventure to say
>>|that we don't really measure it.
>>
>>I never called Apache a flop. I only stated my opinion that 
>>it's not independent developers calling the shots, but IBM 
>>and to a lesser degree Sun. Apache is a big success from an 
>>open source standpoint, Linux is king in that category.  But 
>>we want to move beyond simple open source success. We want a 
>>business model that favors the developers in the group.  By 
>>this measure, the business of Linux is small, the developers 
>>are in their corner, the Linux distrubtors in another.  
>>Apache... httpd? as a protitable market? Financially, it's 
>>been victimized by its own success. There's no way to make an 
>>independent living out of it. If that's what you and the 
>>Apache guys want, that's fine. It's just not what we want for 
>>JBoss.  J2EE is a different beast altogether.  Everyone says 
>>Open Source needs services as a b-model, well J2EE is an 
>>inherently rich deep integration field.  We want to be a 
>>player in it. We feel, it is only by earning money that we 
>>can achieve our independence and we simply would rather deal 
>>with clients than donors. Fact is that there's no free lunch. 
>>"You're going to have to serve somebody"--in the words of Bob 
>>Dylan. We want to choose who we serve and how.
>>
>>We are about commoditizing the appserver and getting paid as 
>>developers. The major thrust of corporate software is about 
>>pursuing the reverse, commoditize the developer and make 
>>people pay through the nose for the software.
>>
>>JBoss Group is the professional umbrella for a core group of 
>>developers and affiliates.
>>
>>|Why do you think you couldn't pursue the same goals within 
>>Apache? What 
>>|is there to prevent you?
>>
>>See above: it's about maintaining independence vis a vis 
>>other corporations and being able to choose the license we 
>>want. It's about the JBoss Group brand and benefiting the 
>>JBoss developers. Furthermore, right now Apache is not a J2EE 
>>play. You have excellent software (your own log4J, XML 
>>parsers, ANT, etc.), but when it comes to J2EE you only have 
>>20%, with Tomcat JSP servlet spec (done by Sun). We already 
>>implement the other 80% (EJB, JMS, JCA, JMX, etc). With 
>>Jetty, we have the full stack, including HTTPD.
>>
>>We respect your work and philosophy. There's room for difference.
>>
>>Peace,
>>
>>marcf
>>
>>
>>___
>>Jboss-development mailing list [EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
>>
> 
> __

Re: [JBoss-dev] MEJB transactions (invoke deploy)

2002-03-22 Thread Dain Sundstrom

marc fleury wrote:

> OK what you want to do is have the initialization of the Bean in the CMP
> engine (the deploy) CHECK for the presence of a transaction.  SO if the
> deployment is transactional (as done with a Required in MEJB) then you need
> to check for that transaction and only start if not present.


The problem is DDL is not transactional and even worse it auto commits 
all other data in the transaction before the DDL is executed.

 
> It is a fix in the CMP initialization code, and that is Dain's domain.
> 
> Claudio, you were right on the line that barf, really wrong on the MEJB
> solution, for penitence can you give Dain the 3 lines diff that achieves
> this behavior (only start transaction if not present in the initialization
> of the code from Dain)


David, and I can fix this (David helped with this code), but why is 
there a transaction.  Deployment is not a transactional process; this is 
why we have stop/destroy lifecycle events.

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] MEJB transactions (invoke deploy)

2002-03-22 Thread Dain Sundstrom

The JDBCStartCommand executes the create table statements, and some 
database have problems when you execute ddl in the same transactions 
normal sql.  Why would jsr-77 care if I start a new transaction?

I plan I using a private transaction in an autonumber generator when I 
implement the unknown primary key feature.

-dain

marc fleury wrote:

> the container/bean story does not sound right
> 
> why does the CMP engine START a new transaction? that is not it's place what
> persistence engine are you using?
> 
> 
> marcf
> 
> |-Original Message-
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of Vesco
> |Claudio
> |Sent: Friday, March 22, 2002 1:29 AM
> |To: Jboss Dev (Posta elettronica)
> |Subject: [JBoss-dev] MEJB transactions (invoke deploy)
> |
> |
> |Hi alls!
> |
> |When I try to deploy an ear (better, an CMP entity) with MEJB I have an
> |exception in org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand because this
> |class try to start a new transaction.
> |
> |The problem is that MEJB have a transaction management setting to default
> |("Container").
> |
> |I think that is better to set the transaction to "Bean".
> |
> |In jsr-77 I don't have found reference to the transaction mode of the
> |management EJB.
> |
> |When I modify the transaction definition, the deployment go well.
> |
> |Another problem...
> |
> |There is an discrepancy with the pdf jsr-77. The method queryNames in the
> |interface javax.management.j2ee.Management have a query parameter in jsr-77
> |pdf which is not present in the current implementation.
> |
> |If not there are controindications, I'll commit the patches.
> |
> | Claudio
> |
> |___
> |Jboss-development mailing list
> |[EMAIL PROTECTED]
> |https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge RelationSet.java

2002-03-14 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/14 13:59:19

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
RelationSet.java
  Log:
  Changed to allow null as a valid argument to methods that take collections.
  Null is treated as an empty collection.
  
  Revision  ChangesPath
  1.7   +37 -17
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/RelationSet.java
  
  Index: RelationSet.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/RelationSet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RelationSet.java  14 Mar 2002 20:21:21 -  1.6
  +++ RelationSet.java  14 Mar 2002 21:59:19 -  1.7
  @@ -26,7 +26,7 @@
* or the responsibilities of this class.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
*/
   public class RelationSet implements Set {
  private JDBCCMRFieldBridge cmrField;
  @@ -42,7 +42,11 @@
  // CMR field sets my referance to the set to null, so that I know that
  // this set is no longer valid. See the ejb spec for more info.
  //
  -   public RelationSet(JDBCCMRFieldBridge cmrField, EntityEnterpriseContext ctx, 
List[] setHandle) {
  +   public RelationSet(
  + JDBCCMRFieldBridge cmrField, 
  + EntityEnterpriseContext ctx, 
  + List[] setHandle) {
  +
 this.cmrField = cmrField;
 this.ctx = ctx;
 this.setHandle = setHandle;
  @@ -51,7 +55,8 @@
  
  private List getIdList() {
 if(setHandle[0] == null) {
  - throw new IllegalStateException("A CMR collection may only be used within 
the transction in which it was created");
  + throw new IllegalStateException("A CMR collection may only be used " +
  +   "within the transction in which it was created");
 }
 return setHandle[0];
  }
  @@ -74,7 +79,8 @@
 }
   
 if(!relatedLocalInterface.isInstance(o)) {
  - throw new IllegalArgumentException("Object must be an instance of " + 
relatedLocalInterface.getName());
  + throw new IllegalArgumentException("Object must be an instance of " +
  +   relatedLocalInterface.getName());
 }
 
 Object id = ((EJBLocalObject)o).getPrimaryKey();
  @@ -93,7 +99,7 @@
 }
   
 if(c == null) {
  - throw new IllegalArgumentException("Collection is null");
  + return false;
 }
 
 boolean isModified = false;
  @@ -113,7 +119,8 @@
 }
   
 if(!relatedLocalInterface.isInstance(o)) {
  - throw new IllegalArgumentException("Object must be an instance of " + 
relatedLocalInterface.getName());
  + throw new IllegalArgumentException("Object must be an instance of " +
  +   relatedLocalInterface.getName());
 }
   
 Object id = ((EJBLocalObject)o).getPrimaryKey();
  @@ -132,7 +139,7 @@
 }
   
 if(c == null) {
  - throw new IllegalArgumentException("Collection is null");
  + return false;
 }
 
 boolean isModified = false;
  @@ -165,7 +172,11 @@
 }
   
 if(c == null) {
  - throw new IllegalArgumentException("Collection is null");
  + if(idList.size() == 0) {
  +return false;
  + }
  + clear();
  + return true;
 }
 
 // get a set of the argument collection's ids
  @@ -192,7 +203,8 @@
 List idList = getIdList();
   
 if(!relatedLocalInterface.isInstance(o)) {
  - throw new IllegalArgumentException("Object must be an instance of " + 
relatedLocalInterface.getName());
  + throw new IllegalArgumentException("Object must be an instance of " +
  +   relatedLocalInterface.getName());
 }
 
 Object id = ((EJBLocalObject)o).getPrimaryKey();
  @@ -203,7 +215,7 @@
 List idList = getIdList();
   
 if(c == null) {
  - throw new IllegalArgumentException("Collection is null");
  + return true;
 }
 
 // get a set of the argument collection's ids
  @@ -219,14 +231,16 @@
  public Object[] toArray(Object a[]) {
 List idList = getIdList();
   
  -  Collection c = cmrField.getRelatedInvoker().getEntityLocalCollection(idList);
  +  Collection c = cmrField.getRelatedInvoker().getEntityLocalCollection(
  +idList);
 return c.toArray(a);
  }
   
  public Object[] toArray() {
 List idList = getIdList();
   
  -  Collection c = cmrField.getRelatedInvoker().getEntityLocal

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge RelationSet.java

2002-03-14 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/14 12:21:21

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
RelationSet.java
  Log:
  Fixed bug where addAll was would loop forever.  The following line was an
  obvious error:
  
 isModified = isModified || add(iterator.next());
  
  Fixed bug where when addAll is called with another relation set it would
  get a concurent modification exception.
  
  Removed commented out code.
  
  Revision  ChangesPath
  1.6   +6 -29 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/RelationSet.java
  
  Index: RelationSet.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/RelationSet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RelationSet.java  15 Jan 2002 20:52:01 -  1.5
  +++ RelationSet.java  14 Mar 2002 20:21:21 -  1.6
  @@ -12,6 +12,7 @@
   import java.util.Iterator; 
   import java.util.List; 
   import java.util.Set; 
  +import java.util.HashSet; 
   import javax.ejb.EJBException; 
   import javax.ejb.EJBLocalObject; 
   import org.jboss.ejb.EntityEnterpriseContext; 
  @@ -25,7 +26,7 @@
* or the responsibilities of this class.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
*/
   public class RelationSet implements Set {
  private JDBCCMRFieldBridge cmrField;
  @@ -65,12 +66,6 @@
 return idList.isEmpty();
  }
   
  -/*
  -   public int hashCode() {
  -  List idList = getIdList();
  -  return idList.hashCode();
  -   }
  -*/
  public boolean add(Object o) {
 List idList = getIdList();
 if(cmrField.isReadOnly()) {
  @@ -103,9 +98,9 @@
 
 boolean isModified = false;
 
  -  Iterator iterator = c.iterator();
  +  Iterator iterator = (new HashSet(c)).iterator();
 while(iterator.hasNext()) {
  - isModified = isModified || add(iterator.next());
  + isModified = add(iterator.next()) || isModified;
 }
 return isModified;
  }
  @@ -142,9 +137,9 @@
 
 boolean isModified = false;
 
  -  Iterator iterator = c.iterator();
  +  Iterator iterator = (new HashSet(c)).iterator();
 while(iterator.hasNext()) {
  - isModified = isModified || remove(iterator.next());
  + isModified = remove(iterator.next()) || isModified;
 }
 return isModified;
  }
  @@ -193,24 +188,6 @@
 return isModified;
  }
   
  -/*
  -   public boolean equals(Object o) {
  -  List idList = getIdList();
  -
  -  if( !(o instanceof List)) {
  - return false;
  -  }
  -  
  -  // get a set of the argument collection's ids
  -  HashSet argIds = new HashSet();
  -  Iterator iterator = ((Set)o).iterator();
  -  while(iterator.hasNext()) {
  - argIds.add(((EJBLocalObject)iterator.next()).getPrimaryKey());
  -  }
  -
  -  return idSet.equals(argIds);
  -   }
  -*/
  public boolean contains(Object o) {
 List idList = getIdList();
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] RE: [JBoss-user] JBOSS 3.x FINAL

2002-03-14 Thread Dain Sundstrom

Trawick, James wrote:

> Will the final release actually include documentation?


JBossCMP will and already does.

 
> (btw, whoever you went with to sell your JBoss 3 docs should be shot.  i
> went through their process several times, they said they had problems and
> would get back to me.  they never did.  just saying that unless JBoss 3 has
> some form of accessible documentation, i'm afraid that your vision will
> never come to pass.)


Cry me a river.

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] is findByPrimaryKey optimization bad?

2002-03-14 Thread Dain Sundstrom

I think the optimization should to do the query and if the bean is not 
found remove it from the cache.  Not really an optimization, but it 
keeps the cache clean.

-dain

Scott M Stark wrote:

> I would say the optimization is inconsistent with the commit option.
> Why should a third party removing the bean from the store be any
> different than an update to the record?
> 
> 
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> 
> - Original Message -
> From: "Bill Burke" <[EMAIL PROTECTED]>
> To: "Jboss-Dev" <[EMAIL PROTECTED]>
> Sent: Thursday, March 14, 2002 9:46 AM
> Subject: [JBoss-dev] is findByPrimaryKey optimization bad?
> 
> 
> 
>>A BMP findByPrimaryKey is optimized to look in cache first for the active
>>pk.  If it is active in cache, then the pk is just returned, without
>>
> calling
> 
>>ejbFindByPrimaryKey on the BMP.  Should we do this for commit-options 'B'
>>and 'C'?
>>
>>Here's the scenario somebody just submitted as a bug.  They get a BMP (so
>>it's active in cash).  They manually delete the bean through straight JDBC
>>(not calling bean.remove()).  Then findByPrimaryKey(pk) returns a valid
>>Entity when the entity is actually deleted in the DB.  Maybe for commit
>>option b and c we should not do this optimization?
>>
>>Same for CMP?
>>
>>What you all think?
>>
>>
>>Bill
>>
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] is findByPrimaryKey optimization bad?

2002-03-14 Thread Dain Sundstrom

Bill Burke wrote:

> A BMP findByPrimaryKey is optimized to look in cache first for the active
> pk.  If it is active in cache, then the pk is just returned, without calling
> ejbFindByPrimaryKey on the BMP.  Should we do this for commit-options 'B'
> and 'C'?
> 
> Here's the scenario somebody just submitted as a bug.  They get a BMP (so
> it's active in cash).  They manually delete the bean through straight JDBC
> (not calling bean.remove()).  Then findByPrimaryKey(pk) returns a valid
> Entity when the entity is actually deleted in the DB.  Maybe for commit
> option b and c we should not do this optimization?
> 
> Same for CMP?
 

With a create, JBossCMP executes a query to check if the new entity 
already exists, but I think even if it were inserted correctly, we would 
get an inserting an already existing entity exception when the container 
attempts to insert the new key into the cache.

We could assume that if the create executes successfully and the key is 
already in the cache, the current value in the cache is out-of-date and 
just drop it.

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] CMR postCreate

2002-03-14 Thread Dain Sundstrom

No.  My focus is on getting spec compliant features in first. 
Specifically support for unknown pks and a fix for dependent value 
classes.  After that, I haven't decided what I will do first.  My 
choices are insert/delete timing configuration, optimistic 
locking/caching, and using database metadata to control auto generated sql.

-dain

Dobridge, Thomas A wrote:

> Will the 3.x final release fix the problem of  handling non-null constrained
> foreign key fields that are mapped as CMR fields and setup in postCreate()?
> I've been waiting for a fix that would delay sql execution until after
> postCreate() and it's hard to tell from the forums whether this has made it
> in yet.
> 
> thanks,
> 
> Tom D.
> 
> 
>>-Original Message-
>>From: marc fleury [SMTP:[EMAIL PROTECTED]]
>>Sent: Thursday, March 14, 2002 9:50 AM
>>To:   Jboss-Development@Lists. Sourceforge. Net
>>Cc:   Jboss-User@Lists. Sourceforge. Net
>>Subject:  [JBoss-dev] JBOSS 3.x FINAL
>>
>>jboss one is end of march, and we will shoot for mid april for the final
>>release.  this gives us 4 weeks
>>
>>gentlemen put your final touches,
>>
>>4-3-2...
>>
>>marcf
>>
>>
>>___
>>Jboss-development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Do tests need explicit type mapping? Can they all use cmp2?

2002-03-13 Thread Dain Sundstrom

David Jencks wrote:

Some of the tests (e.g. Bank) have an explicit type mapping set to
Hypersonic in their jaws.xml file.  This makes it difficult to run against
other databases.  Does anyone have a problem with my removing these?  (This
is not specifying an sql type for a particular field/column, it is a list
of all hypersonic types vs jdbc types).


It should be fine to remove the type-mapping specification.


Also... I haven't looked to make sure this works, but can we move the cmp1
beans to use Dains cmp2 framework rather than JAWS? Does it also support
cmp1?


JBossCMP supports CMP 1.x, but it has not been thoroughly tested.  Can 
we have two META-INF directories for these tests, one that has JAWS 
config and one that has JBossCMP config?  Then we run the tests once for 
each pm.

-dain




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCEJBQLCompiler.java

2002-03-12 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/12 15:17:20

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCEJBQLCompiler.java
  Log:
  Fixed bug where a collection declaration that only has two parts would not
  have the relation table declared in from clause.
  
  Revision  ChangesPath
  1.3   +11 -1 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java
  
  Index: JDBCEJBQLCompiler.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JDBCEJBQLCompiler.java27 Feb 2002 17:30:11 -  1.2
  +++ JDBCEJBQLCompiler.java12 Mar 2002 23:17:19 -  1.3
  @@ -84,7 +84,7 @@
* Compiles EJB-QL and JBossQL into SQL.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
*/
   public class JDBCEJBQLCompiler extends BasicVisitor {
   
  @@ -726,6 +726,16 @@
 buf.append(" ");
 buf.append(alias);
 leftJoins(path.getPath(), buf);
  +
  +  // add the relation-table
  +  JDBCCMRFieldBridge cmrField = (JDBCCMRFieldBridge)path.getCMRField();
  +  if(cmrField.getRelationMetaData().isTableMappingStyle()) {
  + String relationTableAlias = getRelationTableAlias(path.getPath());
  + buf.append(", ");
  + buf.append(cmrField.getRelationMetaData().getTableName());
  + buf.append(" ");
  + buf.append(relationTableAlias);
  +  }
   
 return buf;
  }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge JDBCCMRFieldBridge.java

2002-03-12 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/12 14:25:51

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
JDBCCMRFieldBridge.java
  Log:
  Fixed bug that when loading a foreign-key mapped relation in which the
  entites use custom primary key types JBossCMP would try to load the value
  of the fk into the wrong type (the type of the current entity's pk).
  
  Revision  ChangesPath
  1.26  +30 -2 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java
  
  Index: JDBCCMRFieldBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- JDBCCMRFieldBridge.java   26 Feb 2002 23:28:55 -  1.25
  +++ JDBCCMRFieldBridge.java   12 Mar 2002 22:25:50 -  1.26
  @@ -55,7 +55,7 @@
*  One for each role that entity has.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.25 $
  + * @version $Revision: 1.26 $
*/
   public class JDBCCMRFieldBridge implements JDBCFieldBridge, CMRFieldBridge {
  // -- Invocation messages --
  @@ -1012,18 +1012,46 @@
  public int loadArgumentResults(
ResultSet rs,
int parameterIndex,
  - Object[] argumentRef) {
  + Object[] fkRef) {
   
 if(!hasForeignKey()) {
return parameterIndex;
 }
   
  +  // value of this field,  will be filled in below
  +  Object[] argumentRef = new Object[1];
 for(Iterator fields = foreignKeyFields.iterator(); fields.hasNext();) {
JDBCCMPFieldBridge field = (JDBCCMPFieldBridge)fields.next();
parameterIndex = field.loadArgumentResults(
  rs,
  parameterIndex,
  argumentRef);
  +  
  + if(field.getMetaData().getPrimaryKeyField() != null) {
  +// if we are tring to set a null value 
  +// into a null pk, we are already done.
  +if(argumentRef[0] != null || fkRef[0] != null) {
  +
  +   // if we don't have a pk object yet create one
  +   if(fkRef[0] == null) {
  +  fkRef[0] = relatedEntity.createPrimaryKeyInstance();
  +   }
  +
  +   try {
  +  // Set this field's value into the primary key object.
  +  field.getMetaData().getPrimaryKeyField().set(
  +fkRef[0],
  +argumentRef[0]);
  +   } catch(Exception e) {
  +  // Non recoverable internal exception
  +  throw new EJBException("Internal error setting foreign-key " +
  +"field " + getFieldName(), e);
  +   }
  +}
  + } else {
  +// This field is the primary key, so no extraction is necessary.
  +fkRef[0] = argumentRef[0];
  + }
 }
 return parameterIndex;
  }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge JDBCCMP2xFieldBridge.java

2002-03-12 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/12 10:19:50

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
JDBCCMP2xFieldBridge.java
  Log:
  Removed commented out code.
  
  Revision  ChangesPath
  1.11  +1 -6  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMP2xFieldBridge.java
  
  Index: JDBCCMP2xFieldBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMP2xFieldBridge.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JDBCCMP2xFieldBridge.java 15 Jan 2002 20:49:11 -  1.10
  +++ JDBCCMP2xFieldBridge.java 12 Mar 2002 18:19:50 -  1.11
  @@ -32,7 +32,7 @@
*  One for each entity bean cmp field.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
*/
   public class JDBCCMP2xFieldBridge extends JDBCAbstractCMPFieldBridge {
   
  @@ -64,11 +64,6 @@
  }
  
  public void setInstanceValue(EntityEnterpriseContext ctx, Object value) {
  -  if(isPrimaryKeyMember() && manager.getEntityBridge().isCreated(ctx)) {
  -// throw new IllegalStateException("A field that is a member " +
  -//   "of the primary key can only be set in ejbCreate");
  -  }
  -  
 FieldState fieldState = getFieldState(ctx);
   
 // short-circuit to avoid repetive comparisons
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc ReadAheadCache.java

2002-03-12 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/12 10:17:04

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc ReadAheadCache.java
  Log:
  Fixed bug where a CMR field was not marked as clean after being pre-loaded.
  
  Revision  ChangesPath
  1.5   +4 -1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/ReadAheadCache.java
  
  Index: ReadAheadCache.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/ReadAheadCache.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReadAheadCache.java   27 Feb 2002 00:07:59 -  1.4
  +++ ReadAheadCache.java   12 Mar 2002 18:17:04 -  1.5
  @@ -31,7 +31,7 @@
* basis. The read ahead data for each entity is stored with a soft reference.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
*/
   public class ReadAheadCache {
  /**
  @@ -264,6 +264,9 @@
relatedManager.getReadAheadCache();
  relatedReadAheadCache.addFinderResult(new FinderResults(
(List)value, cmrField.getReadAhead(), null, null));
  +
  +   // mark this field clean as it's value was just loaded
  +   cmrField.setClean(ctx);
   } else {
  if(log.isTraceEnabled()) {
 log.trace("CMRField already loaded:" +
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge JDBCEntityBridge.java

2002-03-12 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/12 10:19:25

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
JDBCEntityBridge.java
  Log:
  Fixed bug where only the CMP fields and not the CMR fields were marked as
  clean when entire entity was marked as clean.
  
  Revision  ChangesPath
  1.22  +4 -4  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCEntityBridge.java
  
  Index: JDBCEntityBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCEntityBridge.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JDBCEntityBridge.java 26 Feb 2002 23:28:56 -  1.21
  +++ JDBCEntityBridge.java 12 Mar 2002 18:19:25 -  1.22
  @@ -53,7 +53,7 @@
*  One per cmp entity bean type.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.21 $
  + * @version $Revision: 1.22 $
*/
   public class JDBCEntityBridge implements EntityBridge {
  private JDBCEntityMetaData metadata;
  @@ -442,9 +442,9 @@
  }
   
  public void setClean(EntityEnterpriseContext ctx) {
  -  for(Iterator iter = cmpFields.iterator(); iter.hasNext();) {
  - JDBCCMPFieldBridge cmpField = (JDBCCMPFieldBridge)iter.next();
  - cmpField.setClean(ctx);
  +  for(Iterator iter = fields.iterator(); iter.hasNext();) {
  + JDBCFieldBridge field = (JDBCFieldBridge)iter.next();
  + field.setClean(ctx);
 }
  }
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Re: [jetty-discuss] HTTP loadbalancing

2002-03-07 Thread Dain Sundstrom

This looks like a great plan.  Don't forget to include a way to 
transition a sticky session from http to https.  If I remember 
correctly,  Cisco supports this by having an additional ip address added 
to css switch for each child web server.  When the session is 
transitioned from http to https you redirect to one of the specific ip 
addresses.

This is another of the projects I would love to do my self, but I'm to 
busy on the JBossCMP stuff.

Have fun,

-dain

Greg Wilkins wrote:

> 
> While using DNS may well be a naive, I think it is more naive to
> think that user space code running on a general purpose computer is
> a good solution if you are concerned about load and/or failover.
> 
> If you really want performance and reliability, then firmware is the
> solution for you and the 25K will do a little to help my Cisco shares :-)
> 
> However, I do think we need a reasonable solution that works as a
> reasonable introduction to loadbalancing and failover.
> 
> If my understanding of the clustering / session manager is correct, it does
> not really matter if sessions are not 100% sticky.  The clustering stuff 
> will
> cope, but it is just more efficient if it does not need to move 
> everything to
> a new node.
> 
> So this is the approach that I would like to take for this:
> 
>  + Write it in java, because we want to be 100% pure.   If that is not
>fast enough - buy Cisco ( I will declare an interest here as Cisco 
> are the
>prime sponsor of Jetty development !-)
> 
>  + Use java.nio as:
>  * if you care about performance you should be using jdk1.4 anyway
>  * if you want one machine to handle more connections than the sum of
>all your servers, then java.net.ServerSocket aint going to do the 
> job!
>  * I want to play with nio before I write the NioListener for Jetty!
> 
>  * Allow sticky sessions, sticky IP and sticky host options.
> 
>  * If sticky sessions are used, or all new connections look for
>"jsessionid=" in the first packet of the request and the response.   If
>found, associate the ID with the current connecton allocation.
> 
>  * If sticky IP is set, use a hashmap of the source InetAddress to 
> determine
>the connection association.
> 
>  * If sticky host option is set, use hashmap on 
> InetAddress.getCanonicalHostName()
>to determine the connection association.
> 
>  * If multiple options are set, they are tried in the order they we defined
>until an association is found.
> 
>  * Stickyness applies to a listener, so you can have different settings 
> for http and
>https ports.
> 
>  * If you have a new connection, an association to a server will be made 
> via a
>pluggable balance policy.   The default will be round robin or least 
> connections.
> 
>  * If a connections are only re-associated as they break or fail to 
> connect to
>a server.
> 
>  + A failing server will continue to be tried for new connections 
> according to the
>balancing policy - so that it can come back into the fold.
>A fancy balancing policy may wish to exclude a failed server for a 
> period of
>time, or until further notice.
> 
>  + At this stage, there will be no re-balancing of existing associations 
> if the
>load becomes asymmetric due to random chance (or any other reason).
> 
> 
> How does that sound?   It should at least be a start for load balancing 
> and failover.
> 
> I should have something working like this within a day or a month (Now 
> there
> is a broad estimate for you).   I'm happy to do this myself, but would also
> appreciate a keen buddy on this once the skeleton is in place.
> 
> 
> cheers
> 
> 
> Bill Burke wrote:
> 
>> I was looking at the way Apache+Tomcat works.  They use a protocol 
>> between
>> themselves.  Apache decrypts the SSL message and extracts "sticky" 
>> session
>> information as well as SSL information and passes this over a 
>> load-balanced
>> socket over a proprietary protocol to the Tomcat instance.  The message
>> contains the HTTP request as well as all the SSL information.  Tomcat
>> unpacks the message, creates an HttpRequest, and sends the request on 
>> their
>> local "bus".  I guess they call this a Tomcat Connector.
>>
>> ---
>>
>> Marc, I see no reason why you have to be separate from Apache.  The 
>> issues
>> here aren't trivial and they've already done all the work and they're
>> open-source.  Actually their license is much more liberal than LGPL.  
>> Plus
>> for this kind of stuff you probably want something written in C for 
>> speed as
>> Greg suggested.  Jetty already leverages Jasper, why not mod_jk?
>>
>> ---
>>
>> As far as load-balancing based on client IP and AOL, it is even worse 
>> than
>> you think.  Supposedly, a client's IP can change in the middle of the
>> session.(I said supposedly remember ;) You acutally have to stick on a 
>> mask
>> of the IP.  Sure, client IP isn't the best way, but it was the only 
>> thing us
>> ignorant bloaks knew at the time :)

Re: [JBoss-dev] Tests something broke

2002-03-06 Thread Dain Sundstrom

Done.

Adrian Brock wrote:

> Doh!
> 
> Actually Dain's mod just reverts the behaviour to
> 1.1 create :-(
> 
> Could somebody with CVS access apply this change
> in org.jboss.ejb.EntityContainer.setHomeMappingImpl
> [pre]
> else if (isEJB1x == false && methodName.startsWith("create"))
> {
> -   map.put(m[i], this.getClass().getMethod(methodName+append, new 
>Class[] { Invocation.class }));
> +   map.put(m[i], this.getClass().getMethod("create"+append, new Class[] 
>{ Invocation.class }));
> }
> [/pre]
> 
> My testsuite is still blowing up on an XmlFileLoader
> problem in the CMP tests, I need to resynch with HEAD.
> 
> I'll commit the "cloned" 2.0 versions of the bean tests this evening. They work with 
>the above mod, but
> you'll have to take my word for it :-)
> 
> Regards,
> Adrian
> 
> 
>>Sorry all,
>>
>>I did run the tests before commiting that patch.
>>
>>Trouble was, I'd already broken some tests trying
>>to get some sort of server running on Sunday when I
>>hit problems with the RARDeployer being deployed
>>out of sequence.
>>Moan, Moan ... :-(
>>
>>I guess it was stupid to commit mods to CMP when
>>half the CMP tests are already broken.
>>
>>Apologies again. Thanks for fixing it Dain.
>>
>>Regards,
>>Adrian
>>
>>
>>>Thanks kudos to you my friend.
>>>
>>>Newbie spanking time 
>>>Adrian, in my office 
>>>
>>>"do as I say, not as I do"
>>>
>>>marcf
>>>
>>>
>>>|-Original Message-
>>>|From:
>>>
>>[EMAIL PROTECTED]
>>
>>|[mailto:[EMAIL PROTECTED]
>>
>>
>>>On Behalf Of Dain
>>>|Sundstrom
>>>|Sent: Tuesday, March 05, 2002 8:57 PM
>>>|To: Jboss-Development@Lists. Sourceforge. Net
>>>|Subject: Re: [JBoss-dev] Tests something broke
>>>|
>>>|
>>>|Fixed it.  The create patched was keyed
>>>
>>to
>>
>>>always return remote 
>>>|objects.  Once I opened the correct class it was
>>>obvious.
>>>|
>>>|In the future, please run the testsuite before
>>>committing changes, 
>>>|especially changes to the core of the server.
>>>|
>>>|-dain
>>>|
>>>|Dain Sundstrom wrote:
>>>
>>>
>>>___
>>>Jboss-development mailing list
>>>[EMAIL PROTECTED]
>>>
>>>
>>https://lists.sourceforge.net/lists/listinfo/jboss-dev
>>
>>
>>>lopment
>>>
> 
> 
> _
> View thread online: http://main.jboss.org/thread.jsp?forum=66&thread=10237
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityContainer.java

2002-03-06 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/06 10:56:15

  Modified:src/main/org/jboss/ejb EntityContainer.java
  Log:
  Fixed fix to creat patch.  Will now correctly call createHome and
  createLocalHome.
  
  Revision  ChangesPath
  1.73  +2 -2  jboss/src/main/org/jboss/ejb/EntityContainer.java
  
  Index: EntityContainer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- EntityContainer.java  6 Mar 2002 04:42:57 -   1.72
  +++ EntityContainer.java  6 Mar 2002 18:56:14 -   1.73
  @@ -61,7 +61,7 @@
   * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor
   * @author Bill Burke
   * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer
  -* @version $Revision: 1.72 $
  +* @version $Revision: 1.73 $
   *
   * Revisions:
   *
  @@ -780,7 +780,7 @@
   }
   else if (isEJB1x == false && methodName.startsWith("create"))
   {
  -   map.put(m[i], this.getClass().getMethod(methodName+append, new 
Class[] { Invocation.class }));
  +   map.put(m[i], this.getClass().getMethod("create"+append, new Class[] 
{ Invocation.class }));
   }
   else
   {
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Tests something broke

2002-03-05 Thread Dain Sundstrom

Fixed it.  The create patched was keyed to always return remote 
objects.  Once I opened the correct class it was obvious.

In the future, please run the testsuite before committing changes, 
especially changes to the core of the server.

-dain

Dain Sundstrom wrote:

> It appears the the create patch has broken create for CMP 2 
> entities.  Now create always returns null.  Was the testsuite run before 
> this patch was committed?
> 
> I'll see if I can fix it.
> 
> -dain
> 
> 
> Dain Sundstrom wrote:
> 
>> I'm looking into it.
>>
>> -dain
>>
>> Scott M Stark wrote:
>>
>>> All of the new errors are in the org.jboss.test.cmp2.relationship 
>>> package,
>>> and all are NPEs in the unit test code. One example stack trace is:
>>>
>>> N/A
>>>
>>> java.lang.NullPointerException
>>> at
>>> org.jboss.test.cmp2.relationship.oneToOneBidirectional.ABTest.beforeChange(A 
>>>
>>> BTest.java:85)
>>> at
>>> org.jboss.test.cmp2.relationship.oneToOneBidirectional.ABTest.test_a1SetB_a2 
>>>
>>> GetB_Table(ABTest.java:97)
>>> at java.lang.reflect.Method.invoke(Native Method)
>>> at junit.framework.TestCase.runTest(TestCase.java:166)
>>> at junit.framework.TestCase.runBare(TestCase.java:140)
>>> at net.sourceforge.junitejb.EJBTestCase.runBare(EJBTestCase.java:133)
>>> at
>>> net.sourceforge.junitejb.EJBTestRunnerBean.runTestCase(EJBTestRunnerBean.jav 
>>>
>>> a:102)
>>> at 
>>> net.sourceforge.junitejb.EJBTestRunnerBean.run(EJBTestRunnerBean.java:44) 
>>>
>>> at java.lang.reflect.Method.invoke(Native Method)
>>> at
>>> org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles 
>>>
>>> sSessionContainer.java:642)
>>> at
>>> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor 
>>>
>>> .java:96)
>>> at
>>> org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxIntercep 
>>>
>>> torBMT.java:144)
>>> at 
>>> org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
>>> at
>>> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe 
>>>
>>> ssionInstanceInterceptor.java:77)
>>> at
>>> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12 
>>>
>>> 7)
>>> at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
>>> at
>>> org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav 
>>>
>>> a:308)
>>> at org.jboss.ejb.Container.invoke(Container.java:668)
>>> at 
>>> com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
>>> at 
>>> com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
>>> at 
>>> org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:363) 
>>>
>>> at java.lang.reflect.Method.invoke(Native Method)
>>> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
>>> at sun.rmi.transport.Transport$1.run(Transport.java:152)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
>>> at 
>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
>>> at
>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7 
>>>
>>> 06)
>>> at java.lang.Thread.run(Thread.java:484)
>>>
>>> 
>>> Scott Stark
>>> Chief Technology Officer
>>> JBoss Group, LLC
>>> 
>>> - Original Message -
>>> From: "marc fleury" <[EMAIL PROTECTED]>
>>> To: "Jboss-Development@Lists. Sourceforge. Net"
>>> <[EMAIL PROTECTED]>
>>> Sent: Tuesday, March 05, 2002 8:55 PM
>>> Subject: [JBoss-dev] Tests something broke
>>>
>>>
>>>
>>>> Adrian or David,
>>>>
>>>> ok I know I am on shaky grounds to raise a flag (heck I broke the build
>>>>
>>> for
>>>
>>>> a week) but it seems that one of your builds just broke the tests 
>>>> and we
>>>> have 20 more testst that fail since yesterday.
>>>>
>>>> Can you guys double check with the testsuite?
>>>>
>>>> marcf
>>>>
>>>>
>>>
>>>
>>>
>>> ___
>>> Jboss-development mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>
>>
>>
>>
>> ___
>> Jboss-development mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityContainer.java

2002-03-05 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/05 20:42:57

  Modified:src/main/org/jboss/ejb EntityContainer.java
  Log:
  Fixed bug where create of an EJB 2.0 entity was always returning remote
  objects.  The create method mapping was keyed to createHome even for
  local home methods.
  
  Revision  ChangesPath
  1.72  +2 -2  jboss/src/main/org/jboss/ejb/EntityContainer.java
  
  Index: EntityContainer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- EntityContainer.java  5 Mar 2002 18:41:45 -   1.71
  +++ EntityContainer.java  6 Mar 2002 04:42:57 -   1.72
  @@ -61,7 +61,7 @@
   * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor
   * @author Bill Burke
   * @author mailto:[EMAIL PROTECTED]";>Andreas Schaefer
  -* @version $Revision: 1.71 $
  +* @version $Revision: 1.72 $
   *
   * Revisions:
   *
  @@ -780,7 +780,7 @@
   }
   else if (isEJB1x == false && methodName.startsWith("create"))
   {
  -   map.put(m[i], this.getClass().getMethod("createHome", new Class[] { 
Invocation.class }));
  +   map.put(m[i], this.getClass().getMethod(methodName+append, new 
Class[] { Invocation.class }));
   }
   else
   {
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Tests something broke

2002-03-05 Thread Dain Sundstrom

It appears the the create patch has broken create for CMP 2 
entities.  Now create always returns null.  Was the testsuite run before 
this patch was committed?

I'll see if I can fix it.

-dain


Dain Sundstrom wrote:

> I'm looking into it.
> 
> -dain
> 
> Scott M Stark wrote:
> 
>> All of the new errors are in the org.jboss.test.cmp2.relationship 
>> package,
>> and all are NPEs in the unit test code. One example stack trace is:
>>
>> N/A
>>
>> java.lang.NullPointerException
>> at
>> org.jboss.test.cmp2.relationship.oneToOneBidirectional.ABTest.beforeChange(A 
>>
>> BTest.java:85)
>> at
>> org.jboss.test.cmp2.relationship.oneToOneBidirectional.ABTest.test_a1SetB_a2 
>>
>> GetB_Table(ABTest.java:97)
>> at java.lang.reflect.Method.invoke(Native Method)
>> at junit.framework.TestCase.runTest(TestCase.java:166)
>> at junit.framework.TestCase.runBare(TestCase.java:140)
>> at net.sourceforge.junitejb.EJBTestCase.runBare(EJBTestCase.java:133)
>> at
>> net.sourceforge.junitejb.EJBTestRunnerBean.runTestCase(EJBTestRunnerBean.jav 
>>
>> a:102)
>> at 
>> net.sourceforge.junitejb.EJBTestRunnerBean.run(EJBTestRunnerBean.java:44)
>> at java.lang.reflect.Method.invoke(Native Method)
>> at
>> org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles 
>>
>> sSessionContainer.java:642)
>> at
>> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor 
>>
>> .java:96)
>> at
>> org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxIntercep 
>>
>> torBMT.java:144)
>> at 
>> org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
>> at
>> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe 
>>
>> ssionInstanceInterceptor.java:77)
>> at
>> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12 
>>
>> 7)
>> at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
>> at
>> org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav 
>>
>> a:308)
>> at org.jboss.ejb.Container.invoke(Container.java:668)
>> at 
>> com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
>> at 
>> com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
>> at 
>> org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:363)
>> at java.lang.reflect.Method.invoke(Native Method)
>> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
>> at sun.rmi.transport.Transport$1.run(Transport.java:152)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
>> at 
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
>> at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7 
>>
>> 06)
>> at java.lang.Thread.run(Thread.java:484)
>>
>> 
>> Scott Stark
>> Chief Technology Officer
>> JBoss Group, LLC
>> 
>> - Original Message -
>> From: "marc fleury" <[EMAIL PROTECTED]>
>> To: "Jboss-Development@Lists. Sourceforge. Net"
>> <[EMAIL PROTECTED]>
>> Sent: Tuesday, March 05, 2002 8:55 PM
>> Subject: [JBoss-dev] Tests something broke
>>
>>
>>
>>> Adrian or David,
>>>
>>> ok I know I am on shaky grounds to raise a flag (heck I broke the build
>>>
>> for
>>
>>> a week) but it seems that one of your builds just broke the tests and we
>>> have 20 more testst that fail since yesterday.
>>>
>>> Can you guys double check with the testsuite?
>>>
>>> marcf
>>>
>>>
>>
>>
>>
>> ___
>> Jboss-development mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Tests something broke

2002-03-05 Thread Dain Sundstrom

I'm looking into it.

-dain

Scott M Stark wrote:

> All of the new errors are in the org.jboss.test.cmp2.relationship package,
> and all are NPEs in the unit test code. One example stack trace is:
> 
> N/A
> 
> java.lang.NullPointerException
> at
> org.jboss.test.cmp2.relationship.oneToOneBidirectional.ABTest.beforeChange(A
> BTest.java:85)
> at
> org.jboss.test.cmp2.relationship.oneToOneBidirectional.ABTest.test_a1SetB_a2
> GetB_Table(ABTest.java:97)
> at java.lang.reflect.Method.invoke(Native Method)
> at junit.framework.TestCase.runTest(TestCase.java:166)
> at junit.framework.TestCase.runBare(TestCase.java:140)
> at net.sourceforge.junitejb.EJBTestCase.runBare(EJBTestCase.java:133)
> at
> net.sourceforge.junitejb.EJBTestRunnerBean.runTestCase(EJBTestRunnerBean.jav
> a:102)
> at net.sourceforge.junitejb.EJBTestRunnerBean.run(EJBTestRunnerBean.java:44)
> at java.lang.reflect.Method.invoke(Native Method)
> at
> org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles
> sSessionContainer.java:642)
> at
> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
> .java:96)
> at
> org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxIntercep
> torBMT.java:144)
> at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
> at
> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe
> ssionInstanceInterceptor.java:77)
> at
> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12
> 7)
> at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
> at
> org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav
> a:308)
> at org.jboss.ejb.Container.invoke(Container.java:668)
> at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
> at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
> at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:363)
> at java.lang.reflect.Method.invoke(Native Method)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
> at sun.rmi.transport.Transport$1.run(Transport.java:152)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
> 06)
> at java.lang.Thread.run(Thread.java:484)
> 
> 
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> 
> - Original Message -
> From: "marc fleury" <[EMAIL PROTECTED]>
> To: "Jboss-Development@Lists. Sourceforge. Net"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, March 05, 2002 8:55 PM
> Subject: [JBoss-dev] Tests something broke
> 
> 
> 
>>Adrian or David,
>>
>>ok I know I am on shaky grounds to raise a flag (heck I broke the build
>>
> for
> 
>>a week) but it seems that one of your builds just broke the tests and we
>>have 20 more testst that fail since yesterday.
>>
>>Can you guys double check with the testsuite?
>>
>>marcf
>>
>>
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCAbstractQueryCommand.java QueryParameter.java

2002-03-04 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/04 14:27:45

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCAbstractQueryCommand.java QueryParameter.java
  Log:
  Cleaned up typeMapping handling.
  
  Revision  ChangesPath
  1.9   +6 -5  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCAbstractQueryCommand.java
  
  Index: JDBCAbstractQueryCommand.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCAbstractQueryCommand.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JDBCAbstractQueryCommand.java 16 Feb 2002 10:37:54 -  1.8
  +++ JDBCAbstractQueryCommand.java 4 Mar 2002 22:27:45 -   1.9
  @@ -44,13 +44,14 @@
* @author mailto:[EMAIL PROTECTED]";>Marc Fleury
* @author mailto:[EMAIL PROTECTED]";>Joe Shevland
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
*/
   public abstract class JDBCAbstractQueryCommand implements JDBCQueryCommand {
  private JDBCStoreManager manager;
  private JDBCQueryMetaData queryMetaData;
  private Logger log;
   
  +   private JDBCStoreManager selectManager;
  private JDBCEntityBridge selectEntity;
  private JDBCCMPFieldBridge selectField;
  private List preloadFields = new ArrayList(0);
  @@ -69,7 +70,7 @@
   q.getMethod().getName());
   
 queryMetaData = q;
  -  selectEntity = manager.getEntityBridge();
  +  setSelectEntity(manager.getEntityBridge());
  }
   
  public Collection execute(
  @@ -77,10 +78,8 @@
Object[] args,
EntityEnterpriseContext ctx) throws FinderException {
   
  -  JDBCStoreManager selectManager = null;
 ReadAheadCache selectReadAheadCache = null;
 if(selectEntity != null) {
  - selectManager = selectEntity.getManager();
selectReadAheadCache = selectManager.getReadAheadCache();
 }
   
  @@ -209,6 +208,7 @@
  protected void setSelectEntity(JDBCEntityBridge selectEntity) {
 this.selectField = null;
 this.selectEntity = selectEntity;
  +  this.selectManager = selectEntity.getManager();
  }
  
  protected JDBCCMPFieldBridge getSelectField() {
  @@ -218,6 +218,7 @@
  protected void setSelectField(JDBCCMPFieldBridge selectField) {
 this.selectEntity = null;
 this.selectField = selectField;
  +  this.selectManager = selectField.getManager();
  }

  protected List getPreloadFields() {
  @@ -253,7 +254,7 @@
  token = tokens.nextToken();
  if(Character.isDigit(token.charAt(0))) {
 QueryParameter parameter = new QueryParameter(
  -manager,
  +selectManager,
   queryMetaData.getMethod(),
   token);
 
  
  
  
  1.6   +1 -1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/QueryParameter.java
  
  Index: QueryParameter.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/QueryParameter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- QueryParameter.java   22 Feb 2002 04:24:55 -  1.5
  +++ QueryParameter.java   4 Mar 2002 22:27:45 -   1.6
  @@ -192,7 +192,7 @@
 "a primay key field");
}
   
  - // get the jdbc typ object
  + // get the jdbc type object
type = field.getJDBCType();
 } else {
// get jdbc type from type manager
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/metadata XmlFileLoader.java

2002-03-04 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/04 10:58:05

  Modified:src/main/org/jboss/metadata XmlFileLoader.java
  Log:
  Will now throw a DeploymentException if an error occures while validating.
  
  Revision  ChangesPath
  1.27  +18 -2 jboss/src/main/org/jboss/metadata/XmlFileLoader.java
  
  Index: XmlFileLoader.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/XmlFileLoader.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XmlFileLoader.java16 Feb 2002 04:42:23 -  1.26
  +++ XmlFileLoader.java4 Mar 2002 18:58:04 -   1.27
  @@ -38,7 +38,7 @@
*   @author mailto:[EMAIL PROTECTED]";>Wolfgang Werner
*   @author mailto:[EMAIL PROTECTED]";>Darius Davidavicius
*   @author mailto:[EMAIL PROTECTED]";>Scott Stark
  - *   @version $Revision: 1.26 $
  + *   @version $Revision: 1.27 $
*
*   Revisions:
*
  @@ -253,14 +253,21 @@
docBuilderFactory.setValidating(validateDTDs);
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
LocalResolver lr = new LocalResolver();
  - ErrorHandler eh = new LocalErrorHandler( inPath, lr );
  + LocalErrorHandler eh = new LocalErrorHandler( inPath, lr );
docBuilder.setEntityResolver(lr);
docBuilder.setErrorHandler(eh );

Document doc = docBuilder.parse(is);
  + if(validateDTDs && eh.hadError()) {
  +throw new DeploymentException("Invalid XML: file=" + inPath);
  + }
return doc;

 }
  +  catch (DeploymentException e) 
  +  {
  + throw e;
  +  }
 catch (SAXParseException e)
 {
log.error(e.getMessage()+":"+e.getColumnNumber()+":"+e.getLineNumber(), e);
  @@ -379,17 +386,20 @@
 // The xml file being parsed
 private String theFileName;
 private LocalResolver localResolver;
  +  private boolean error;
 
 public LocalErrorHandler( String inFileName, LocalResolver localResolver )
 {
this.theFileName = inFileName;
this.localResolver = localResolver;
  + this.error = false;
 }
 
 public void error(SAXParseException exception)
 {
if ( localResolver.hasDTD() )
{
  +this.error = true;
   log.error("XmlFileLoader: File "
   + theFileName
   + " process error. Line: "
  @@ -404,6 +414,7 @@
 {
if ( localResolver.hasDTD() )
{
  +this.error = true;
   log.error("XmlFileLoader: File "
   + theFileName
   + " process fatal error. Line: "
  @@ -418,6 +429,7 @@
 {
if ( localResolver.hasDTD() )
{
  +this.error = true;
   log.error("XmlFileLoader: File "
   + theFileName
   + " process warning. Line: "
  @@ -426,6 +438,10 @@
   + exception.getMessage()
   );
}//end if
  +  }
  +
  +  public boolean hadError() {
  + return error;
 }
  }// end class LocalErrorHandler
   }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jbosstest/src/resources/cmp2/ejbselect/META-INF jbosscmp-jdbc.xml

2002-03-04 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/04 10:53:50

  Modified:src/resources/cmp2/ejbselect/META-INF jbosscmp-jdbc.xml
  Log:
  fixed invalid metadata
  
  Revision  ChangesPath
  1.3   +0 -1  
jbosstest/src/resources/cmp2/ejbselect/META-INF/jbosscmp-jdbc.xml
  
  Index: jbosscmp-jdbc.xml
  ===
  RCS file: 
/cvsroot/jboss/jbosstest/src/resources/cmp2/ejbselect/META-INF/jbosscmp-jdbc.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jbosscmp-jdbc.xml 1 Feb 2002 01:47:09 -   1.2
  +++ jbosscmp-jdbc.xml 4 Mar 2002 18:53:50 -   1.3
  @@ -9,7 +9,6 @@
 true
 true
 true
  -  foreign-key
  
   
  
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jbosstest/src/resources/cmp2/readonly/META-INF jbosscmp-jdbc.xml

2002-03-04 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/04 10:53:50

  Modified:src/resources/cmp2/readonly/META-INF jbosscmp-jdbc.xml
  Log:
  fixed invalid metadata
  
  Revision  ChangesPath
  1.3   +2 -4  jbosstest/src/resources/cmp2/readonly/META-INF/jbosscmp-jdbc.xml
  
  Index: jbosscmp-jdbc.xml
  ===
  RCS file: 
/cvsroot/jboss/jbosstest/src/resources/cmp2/readonly/META-INF/jbosscmp-jdbc.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jbosscmp-jdbc.xml 1 Feb 2002 01:47:09 -   1.2
  +++ jbosscmp-jdbc.xml 4 Mar 2002 18:53:50 -   1.3
  @@ -9,8 +9,6 @@
 true
 true
 true
  -  300
  -  foreign-key
  
   
  
  @@ -23,8 +21,8 @@


   name
  -name
   true
  +name

 
 
  @@ -48,8 +46,8 @@
  
 
Book-Publisher
  - 
true
  + 

   
publisher-has-books
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] Problem with new deployer

2002-03-04 Thread Dain Sundstrom

I have been working on the XmlFileLoader stuff I discussed yesterday and 
  it has revealed a problem with the new deployer.  When a 
DeploymentException is thrown in the create life cycle method the 
deployer does not remove the ejbs that were registered a part for 
ejb-jar.  Then later when you fix the first problem you have to restart 
the server because you have junk still registered in jndi.

For example, on my first deploy, I get the following exception:

12:28:55,838 ERROR [EntityContainer] Exception in service lifecyle 
operation: create org.jboss.deployment.DeploymentException: Invalid XML: 
file=file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/server/default/tmp/deploy/home/dain/work/jboss/jboss-all/testsuite/output/lib/cmp2-readonly.jar/69.cmp2-readonly.jar!/META-INF/jbosscmp-jdbc.xml
--- Several stack traces here then ---
12:28:55,998 WARN  [ServiceController] Ignoring request to destroy 
non-existant service: jboss.j2ee:service=EJB,jndiName=ejb/EJBTestRunner
12:28:55,998 WARN  [ServiceController] Ignoring request to destroy 
non-existant service: jboss.j2ee:service=EJB,jndiName=PublisherEJB
12:28:55,999 INFO  [EjbModule] Remove JSR-77 EJB Module: 
jboss.management.single 
:J2EEDomain=Manager,name=cmp2-readonly.jar,J2EEServer=Single,J2EEApplication=cmp2-readonly.jar,type=EjbModule
12:28:55,999 INFO  [EjbModule] Remove fake JSR-77 parent Application: 
jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=cmp2-readonly.jar,type=J2EEApplication
12:28:56,000 INFO  [EjbModule] Destroyed
12:28:56,001 INFO  [MainDeployer] Cleaned Deployment 
file:/home/dain/work/jboss/jboss-all/testsuite/output/lib/cmp2-readonly.jar
12:28:56,001 INFO  [MainDeployer] Undeployed 
file:/home/dain/work/jboss/jboss-all/testsuite/output/lib/cmp2-readonly.jar

Then I fix the problem, deploy again, and I get the following exception:

12:35:12,895 INFO  [MainDeployer] Starting deployment of package: 
file:/home/dain/work/jboss/jboss-all/testsuite/output/lib/cmp2-readonly.jar
12:35:12,960 INFO  [EjbModule] Creating
12:35:12,974 INFO  [EjbModule] Deploying PublisherEJB
12:35:12,977 INFO  [EjbModule] Deploying BookEJB
12:35:12,980 INFO  [EjbModule] Deploying EJBTestRunnerEJB
12:35:12,983 ERROR [EjbModule] Initialization failed
javax.management.InstanceAlreadyExistsException: 
jboss.j2ee:service=EJB,jndiName=BookEJB
 at 
com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
 at 
com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:2352)

Any ideas?

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Guidance required EJB1.1/2.0

2002-03-04 Thread Dain Sundstrom

You can detect if a jar is an EJB 2.0 jar by looking at the DOCTYPE.  I 
already do this in ApplicationMetaData, so all you need to do is call 
isEJB2x().

-dain

marc fleury wrote:

> 2.0 is so much more powerful than 1.1 we will support only 2.0 when it is
> stable.  For now we need both,
> 
> marcf
> 
> |-Original Message-
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of
> |Adrian Brock
> |Sent: Monday, March 04, 2002 7:13 AM
> |To: [EMAIL PROTECTED]
> |Subject: [JBoss-dev] Guidance required EJB1.1/2.0
> |
> |
> |Hi,
> |
> |I'm apply the create patches from sourceforge.
> |As the patch says the verifier code is incomplete.
> |The 2.0 verifier does not exist, the patch allows
> |create for 1.1
> |
> |I was wondering, do we need to support both 1.1 and
> |2.0 in the container as well? The spec suggests
> |we should for at least CMP. I couldn't find it
> |stated explicitly for other types.
> |
> |Regards,
> |Adrian
> |
> |_
> |View thread online: http://main.jboss.org/thread.jsp?forum=66&thread=10128
> |
> |___
> |Jboss-development mailing list
> |[EMAIL PROTECTED]
> |https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Testsuite completely broken?

2002-03-03 Thread Dain Sundstrom

> 1. what happens if you move default-hsqldb-service.sar out of deploy so it
> undeploys and then back so it redeploys?


Still doesn't work, but when I undeploy I get the following exceptions.

21:18:08,084 INFO  [HypersonicDatabase] Destroying
21:18:08,084 INFO  [HypersonicDatabase] Destroyed
21:18:08,094 ERROR [JDBCDataSource] Could not destroy JSR-77 JDBC 
DataSource: NoTransDS
java.util.NoSuchElementException
at java.util.HashMap$EmptyHashIterator.next(HashMap.java:695)
at org.jboss.management.j2ee.JDBCDataSource.destroy(JDBCDataSource.java:133)
at 
org.jboss.resource.ConnectionFactoryLoader.preDeregister(ConnectionFactoryLoader.java:394)
at 
com.sun.management.jmx.MBeanServerImpl.preDeregisterInvoker(MBeanServerImpl.java:2292)
at 
com.sun.management.jmx.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:948)
at org.jboss.system.ServiceCreator.remove(ServiceCreator.java:131)
at org.jboss.system.ServiceController.remove(ServiceController.java:505)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy3.remove(Unknown Source)
at org.jboss.deployment.SARDeployer.destroy(SARDeployer.java:562)
at org.jboss.deployment.MainDeployer.destroy(MainDeployer.java:271)
at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:219)
at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:200)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy2.undeploy(Unknown Source)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:317)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:399)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:190)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:179)
21:18:08,099 INFO  [MainDeployer] Cleaned Deployment 
file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/server/default/deploy/hsqldb-default-service.xml
21:18:08,100 INFO  [MainDeployer] Undeployed 
file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/server/default/deploy/hsqldb-default-service.xml
21:18:08,097 ERROR [JDBCDataSource] Could not destroy JSR-77 JDBC 
DataSource: DefaultDS
^ Same stack trace as above

21:18:23,188 INFO  [STDOUT] The database is closed as Embbeded
21:18:23,190 INFO  [STDOUT] hsqldb serverSocket closed
21:18:23,190 INFO  [STDOUT] Calling hsqldb closeServerSocket();
21:18:23,191 INFO  [STDOUT] The database is closed as Embbeded
21:18:35,000 INFO  [STDOUT] The database is closed as Embbeded

 
> 2. looking at port 8082, is the RARDeployer there? How about the
> RARDeployment for Minerva LocalTransaction Resource adapter? How about the
> shared local ConnectionManagerFactory ?


The following are in the jboss.jca section:

service=ConnectionFactoryLoader,name=JmsXA
service=ConnectionManagerFactoryLoader,name=MinervaNoTransCMFactory
service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
service=ConnectionManagerFactoryLoader,name=MinervaXACMFactory
service=RARDeployer
service=RARDeployment,name=JMS Adapter
service=RARDeployment,name=Minerva JDBC XATransaction ResourceAdapter

 
> 3. Is there an mbean for DefaultDS?


Following are under the jboss section:

service=ClientUserTransaction
service=ConnectionFactoryLoader,name=DefaultDS
service=ConnectionFactoryLoader,name=NoTransDS

> I'll do a clean checkout and see what happens.
> 
> david jencks
> 


Thanks for looking at this,

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Testsuite completely broken?

2002-03-03 Thread Dain Sundstrom

Jason Dillon wrote:

> I just ran the testsuite (from a clean cvs) and got 4 failure 2 errors...


I wish.

 
> The problems I say with jbosscx.sar were only when I was explicit with 
> which arhvies to load... which are only local to my workspace (not 
> commited).
> 
> Dain, if you start up the server and check JNDIView, do you see DefaultDS?


No. Please, help.  I want to get some more work done today.

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Testsuite completely broken?

2002-03-03 Thread Dain Sundstrom

What do I need to add to what file?  I'll change it and check it in.

-dain

David Jencks wrote:

> Jason was talking about this, looks like its not fixed.  Either put 
>  element in
> default-hsqldb-service.sar's jboss-service.xml or deploy that sar by hand
> after the RARDeployer is loaded. (i'm not certain where jbosscx.sar is
> right now)
> 
> david jencks
> 
> On 2002.03.03 19:33:31 -0500 Dain Sundstrom wrote:
> 
>>I just did a fresh checkout of jboss-all and almost every test is 
>>failing because it can't find DefaultDS.  A sample error follows:
>>
>>2002-03-03 18:14:03,027 DEBUG [org.jboss.ejb.EntityContainer] failed to 
>>lookup DefaultDS; ignoring javax.naming.NameNotFoundException: DefaultDS 
>>not bound
>>
>>Am I doing something wrong?
>>
>>-dain
>>
>>
>>___
>>Jboss-development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
>>
>>
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] Testsuite completely broken?

2002-03-03 Thread Dain Sundstrom

I just did a fresh checkout of jboss-all and almost every test is 
failing because it can't find DefaultDS.  A sample error follows:

2002-03-03 18:14:03,027 DEBUG [org.jboss.ejb.EntityContainer] failed to 
lookup DefaultDS; ignoring javax.naming.NameNotFoundException: DefaultDS 
not bound

Am I doing something wrong?

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCRelationMetaData.java

2002-03-03 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/03 14:24:55

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCRelationMetaData.java
  Log:
  Added code to verify that a aleast one side of a foreign-key mapped
  relationship has keys and that both sides of a relation-table mapped
  relationship have keys.
  
  Revision  ChangesPath
  1.12  +19 -1 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCRelationMetaData.java
  
  Index: JDBCRelationMetaData.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCRelationMetaData.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JDBCRelationMetaData.java 11 Feb 2002 17:01:20 -  1.11
  +++ JDBCRelationMetaData.java 3 Mar 2002 22:24:55 -   1.12
  @@ -25,7 +25,7 @@
* have set methods.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
*/
   public final class JDBCRelationMetaData {
  private final static int TABLE = 1;
  @@ -307,6 +307,24 @@
   
left.init(right, leftElement);
right.init(left, rightElement);
  +  }
  +
  +  // atleast one side of a fk relation must have keys
  +  if(isForeignKeyMappingStyle() && 
  +left.getKeyFields().isEmpty() &&
  +right.getKeyFields().isEmpty()) {
  + throw new DeploymentException("Atleast one role of a foreign-key " +
  +   "mapped relationship must have key fields: " +
  +   "ejb-relation-name=" + relationName);
  +  }
  +
  +  // both sides of a table relation must have keys
  +  if(isTableMappingStyle() && 
  +(left.getKeyFields().isEmpty() ||
  +right.getKeyFields().isEmpty())) {
  + throw new DeploymentException("Both roles of a relation-table " +
  +   "mapped relationship must have key fields: " +
  +   "ejb-relation-name=" + relationName);
 }
  }
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] XmlFileLoader and validation?

2002-03-03 Thread Dain Sundstrom

If there are no objections to this, I'm going to make the change 
(assuming it doesn't break any test cases).

-dain

Dain Sundstrom wrote:

> It's just eating the exceptions.  I can add code to set a flag in the 
> handler. Then after the whole file is parsed and all error messages are 
> printed, I can throw a Deployment exception.
> 
> Does this sound reasonable?
> 
> -dain
> 
> 
> Scott M Stark wrote:
> 
>> It should be throwing a DeploymentException as well. Look
>> into the LocalErrorHandler that is printing these messages.
>> Maybe its just swallowing the parse exception after printing.
>>
>> 
>> Scott Stark
>> Chief Technology Officer
>> JBoss Group, LLC
>> 
>> - Original Message -
>> From: "Dain Sundstrom" <[EMAIL PROTECTED]>
>> To: "Scott M Stark" <[EMAIL PROTECTED]>
>> Cc: "JBoss-dev" <[EMAIL PROTECTED]>
>> Sent: Sunday, March 03, 2002 11:27 AM
>> Subject: Re: [JBoss-dev] XmlFileLoader and validation?
>>
>>
>>
>>> I use "XmlFileLoader.getDocument(stdJDBCUrl, true)", but all I get are
>>> messages like the following printed to the log:
>>>
>>> 13:25:05,062 ERROR [XmlFileLoader] XmlFileLoader: File
>>>
>>>
>> file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/tmp/deplo 
>>
>> y/home/dain/work/jboss/jboss-
>>
>> all/testsuite/output/lib/cmp2-commerce.jar/64.cmp2-commerce.jar!/META-INF/jb 
>>
>> osscmp-jdbc.xml
>>
>>> process error. Line: 10. Error message: Element "defaults" does not
>>> allow "should-break" here.
>>> 13:25:05,063 ERROR [XmlFileLoader] XmlFileLoader: File
>>>
>>>
>> file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/tmp/deplo 
>>
>> y/home/dain/work/jboss/jboss-
>>
>> all/testsuite/output/lib/cmp2-commerce.jar/64.cmp2-commerce.jar!/META-INF/jb 
>>
>> osscmp-jdbc.xml
>>
>>> process error. Line: 10. Error message: Element type "should-break" is
>>> not declared.
>>>
>>> I like the messages, I just wish that at the end I could detect that the
>>> doc was not valid and throw a Deployment exception.
>>>
>>> Any ideas?
>>>
>>> -dain
>>>
>>> Scott M Stark wrote:
>>>
>>>
>>>> If you have the doc URL then use:
>>>>
>>>> public static Document getDocument(URL url, boolean validateDTDs) 
>>>> throws
>>>> DeploymentException
>>>>
>>>> else, create the document stream and call:
>>>>
>>>> XmlFileLoader(boolean validateDTDs)
>>>> public Document getDocument(InputStream is, String inPath) throws
>>>> DeploymentException
>>>>
>>>> 
>>>> Scott Stark
>>>> Chief Technology Officer
>>>> JBoss Group, LLC
>>>> 
>>>> - Original Message -
>>>> From: "Dain Sundstrom" <[EMAIL PROTECTED]>
>>>> To: "JBoss-dev" <[EMAIL PROTECTED]>
>>>> Sent: Sunday, March 03, 2002 10:13 AM
>>>> Subject: [JBoss-dev] XmlFileLoader and validation?
>>>>
>>>>
>>>>
>>>>
>>>>> How can I know if there were no validation errors when loading a doc
>>>>> with XmlFileLoader?
>>>>>
>>>>> I want to throw a DeploymentException if jbosscmp-jdbc.xml is not 
>>>>> valid.
>>>>>
>>>>> -dain
>>>>>
>>>>>
>>>>> ___
>>>>> Jboss-development mailing list
>>>>> [EMAIL PROTECTED]
>>>>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>>>
>>>>>
>>>>>
>>>>
>>>> ___
>>>> Jboss-development mailing list
>>>> [EMAIL PROTECTED]
>>>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>>
>>>>
>>>
>>>
>>
>>
>> ___
>> Jboss-development mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCStoreManager.java JDBCLoadEntityCommand.java JDBCCreateEntityCommand.java

2002-03-03 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/03 13:37:47

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCStoreManager.java JDBCLoadEntityCommand.java
JDBCCreateEntityCommand.java
  Log:
  Moved entityBridge.setCreated into JDBCStoreManager for better handling.
  
  Revision  ChangesPath
  1.29  +10 -2 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStoreManager.java
  
  Index: JDBCStoreManager.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStoreManager.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- JDBCStoreManager.java 27 Feb 2002 00:07:58 -  1.28
  +++ JDBCStoreManager.java 3 Mar 2002 21:37:46 -   1.29
  @@ -59,7 +59,7 @@
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
* @see org.jboss.ejb.EntityPersistenceStore
  - * @version $Revision: 1.28 $
  + * @version $Revision: 1.29 $
*/
   public class JDBCStoreManager implements EntityPersistenceStore {
   
  @@ -373,7 +373,12 @@
Object[] args,
EntityEnterpriseContext ctx) throws CreateException {
   
  -  return createEntityCommand.execute(createMethod, args, ctx);
  +  Object pk = createEntityCommand.execute(createMethod, args, ctx);
  +
  +  // mark the entity as created
  +  entityBridge.setCreated(ctx);
  +
  +  return pk;
  }
   
  public Object findEntity(
  @@ -403,6 +408,9 @@
}
entityBridge.resetPersistenceContext(ctx);
 }
  +
  +  // mark the entity as created; if it was loading it was created 
  +  entityBridge.setCreated(ctx);
   
 loadEntityCommand.execute(ctx);
  }
  
  
  
  1.18  +1 -4  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCLoadEntityCommand.java
  
  Index: JDBCLoadEntityCommand.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCLoadEntityCommand.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JDBCLoadEntityCommand.java27 Feb 2002 00:07:58 -  1.17
  +++ JDBCLoadEntityCommand.java3 Mar 2002 21:37:46 -   1.18
  @@ -40,7 +40,7 @@
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
* @author mailto:[EMAIL PROTECTED]";>Dirk Zimmermann
* @author mailto:[EMAIL PROTECTED]";>danch (Dan Christopherson)
  - * @version $Revision: 1.17 $
  + * @version $Revision: 1.18 $
*/
   public class JDBCLoadEntityCommand {
  private final JDBCStoreManager manager;
  @@ -163,9 +163,6 @@
   throw new NoSuchEntityException("Entity not found: primaryKey=" +
 ctx.getId());
}
  -
  - // mark the entity as created; if it was loaded it was created 
  - entity.setCreated(ctx);
 } catch(EJBException e) {
throw e;
 } catch(Exception e) {
  
  
  
  1.13  +1 -3  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCCreateEntityCommand.java
  
  Index: JDBCCreateEntityCommand.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCCreateEntityCommand.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JDBCCreateEntityCommand.java  15 Jan 2002 22:14:04 -  1.12
  +++ JDBCCreateEntityCommand.java  3 Mar 2002 21:37:46 -   1.13
  @@ -33,7 +33,7 @@
* @author mailto:[EMAIL PROTECTED]";>Marc Fleury
* @author mailto:[EMAIL PROTECTED]";>Joe Shevland
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
*/
   public class JDBCCreateEntityCommand {
  private JDBCStoreManager manager;
  @@ -130,8 +130,6 @@
 }
 insertEntity(ctx);
   
  -  entity.setCreated(ctx);
  -  
 return pk; 
  }
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] When do DTDs get updated?

2002-03-03 Thread Dain Sundstrom

When do the DTDs get updated on the JBoss site?  The dtd for 
jbosscmp-jdbc.xml hasn't been updated in like a month.  Can we setup a 
redirect (or something similar) to the web cvs version at sf?  The url 
is like this:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/jboss/jboss/src/resources/org/jboss/metadata/jbosscmp-jdbc_3_0.dtd?rev=HEAD&content-type=text/plain

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCDeclaredQueryMetaData.java

2002-03-03 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/03 12:02:29

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCDeclaredQueryMetaData.java
  Log:
  Added optional alias element to select in declared-sql for specifing the
  exact alias that will be used for the main select table.
  
  Revision  ChangesPath
  1.11  +16 -1 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCDeclaredQueryMetaData.java
  
  Index: JDBCDeclaredQueryMetaData.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCDeclaredQueryMetaData.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JDBCDeclaredQueryMetaData.java26 Feb 2002 23:59:27 -  1.10
  +++ JDBCDeclaredQueryMetaData.java3 Mar 2002 20:02:29 -   1.11
  @@ -19,7 +19,7 @@
* Imutable class contains information about a declated query.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - *   @version $Revision: 1.10 $
  + *   @version $Revision: 1.11 $
*/
   public final class JDBCDeclaredQueryMetaData implements JDBCQueryMetaData {
  /**
  @@ -64,6 +64,10 @@
  private final String fieldName;
   
  /**
  +* The aliase that is used for the main select table.
  +*/
  +   private final String alias;
  +   /**
   * Read ahead meta data.
   */
  private final JDBCReadAheadMetaData readAhead;
  @@ -124,6 +128,7 @@
   ejbName = null;
   fieldName = null;
}
  + alias = MetaData.getOptionalChildContent(selectElement, "alias");
 } else {
if(method.getName().startsWith("ejbSelect")) {
   throw new DeploymentException("The select element of " +
  @@ -132,6 +137,7 @@
distinct = false;
ejbName = null;
fieldName = null;
  + alias = null;
 }
  }
   
  @@ -211,6 +217,15 @@
   */
  public String getFieldName() {
 return fieldName;
  +   }
  +   
  +   /**
  +* The alias that is used for the select table.
  +* @return the alias that is used for the table from which the entity or
  +* field is selected.
  +*/
  +   public String getAlias() {
  +  return alias;
  }
  
  /**
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCDeclaredSQLQuery.java

2002-03-03 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/03 12:02:28

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCDeclaredSQLQuery.java
  Log:
  Added optional alias element to select in declared-sql for specifing the
  exact alias that will be used for the main select table.
  
  Revision  ChangesPath
  1.5   +14 -3 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCDeclaredSQLQuery.java
  
  Index: JDBCDeclaredSQLQuery.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCDeclaredSQLQuery.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JDBCDeclaredSQLQuery.java 22 Feb 2002 04:24:55 -  1.4
  +++ JDBCDeclaredSQLQuery.java 3 Mar 2002 20:02:28 -   1.5
  @@ -31,7 +31,7 @@
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
* @author mailto:[EMAIL PROTECTED]";>Michel de Groot
* @author danch (Dan Christopherson
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
*/
   public class JDBCDeclaredSQLQuery extends JDBCAbstractQueryCommand {
  
  @@ -130,6 +130,7 @@
sql.append("DISTINCT ");
 }
 
  +  String alias = metadata.getAlias();
 String from = metadata.getFrom();
 if(getSelectField() == null) {
   
  @@ -141,7 +142,12 @@
loadFields.addAll(getSelectEntity().getPrimaryKeyFields());
loadFields.addAll(getPreloadFields());
   
  - if(from != null && from.trim().length()>0) {
  + if(alias != null && alias.trim().length()>0) {
  +sql.append(SQLUtil.getColumnNamesClause(loadFields, alias));
  +sql.append(" FROM ");
  +sql.append(table).append(" ").append(alias);
  +sql.append(" ").append(from);
  + } else if(from != null && from.trim().length()>0) {
   sql.append(SQLUtil.getColumnNamesClause(loadFields, table));
   sql.append(" FROM ").append(table).append(" ").append(from);
} else {
  @@ -153,7 +159,12 @@
// we are just selecting one field
JDBCCMPFieldBridge selectField = getSelectField();
String table = selectField.getMetaData().getEntity().getTableName();
  - if(from != null && from.trim().length()>0) {
  + if(alias != null && alias.trim().length()>0) {
  +sql.append(SQLUtil.getColumnNamesClause(selectField, alias));
  +sql.append(" FROM ");
  +sql.append(table).append(" ").append(alias);
  +sql.append(" ").append(from);
  + } else if(from != null && from.trim().length()>0) {
   sql.append(SQLUtil.getColumnNamesClause(selectField, table));
   sql.append(" FROM ").append(table).append(" ").append(from);
} else {
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/resources/org/jboss/metadata jbosscmp-jdbc_3_0.dtd

2002-03-03 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/03/03 12:01:16

  Modified:src/resources/org/jboss/metadata jbosscmp-jdbc_3_0.dtd
  Log:
  Added optional alias element to select in declared-sql for specifing the
  exact alias that will be used for the main select table.
  
  Revision  ChangesPath
  1.13  +9 -1  jboss/src/resources/org/jboss/metadata/jbosscmp-jdbc_3_0.dtd
  
  Index: jbosscmp-jdbc_3_0.dtd
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/resources/org/jboss/metadata/jbosscmp-jdbc_3_0.dtd,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jbosscmp-jdbc_3_0.dtd 27 Feb 2002 00:13:52 -  1.12
  +++ jbosscmp-jdbc_3_0.dtd 3 Mar 2002 20:01:16 -   1.13
  @@ -331,7 +331,7 @@
   
  -
  +
   
   
   
   
  +
  +
  +
  +
   
   
   

Re: [JBoss-dev] XmlFileLoader and validation?

2002-03-03 Thread Dain Sundstrom

It's just eating the exceptions.  I can add code to set a flag in the 
handler. Then after the whole file is parsed and all error messages are 
printed, I can throw a Deployment exception.

Does this sound reasonable?

-dain


Scott M Stark wrote:

> It should be throwing a DeploymentException as well. Look
> into the LocalErrorHandler that is printing these messages.
> Maybe its just swallowing the parse exception after printing.
> 
> 
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> 
> ----- Original Message -
> From: "Dain Sundstrom" <[EMAIL PROTECTED]>
> To: "Scott M Stark" <[EMAIL PROTECTED]>
> Cc: "JBoss-dev" <[EMAIL PROTECTED]>
> Sent: Sunday, March 03, 2002 11:27 AM
> Subject: Re: [JBoss-dev] XmlFileLoader and validation?
> 
> 
> 
>>I use "XmlFileLoader.getDocument(stdJDBCUrl, true)", but all I get are
>>messages like the following printed to the log:
>>
>>13:25:05,062 ERROR [XmlFileLoader] XmlFileLoader: File
>>
>>
> file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/tmp/deplo
> y/home/dain/work/jboss/jboss-
> 
> all/testsuite/output/lib/cmp2-commerce.jar/64.cmp2-commerce.jar!/META-INF/jb
> osscmp-jdbc.xml
> 
>>process error. Line: 10. Error message: Element "defaults" does not
>>allow "should-break" here.
>>13:25:05,063 ERROR [XmlFileLoader] XmlFileLoader: File
>>
>>
> file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/tmp/deplo
> y/home/dain/work/jboss/jboss-
> 
> all/testsuite/output/lib/cmp2-commerce.jar/64.cmp2-commerce.jar!/META-INF/jb
> osscmp-jdbc.xml
> 
>>process error. Line: 10. Error message: Element type "should-break" is
>>not declared.
>>
>>I like the messages, I just wish that at the end I could detect that the
>>doc was not valid and throw a Deployment exception.
>>
>>Any ideas?
>>
>>-dain
>>
>>Scott M Stark wrote:
>>
>>
>>>If you have the doc URL then use:
>>>
>>>public static Document getDocument(URL url, boolean validateDTDs) throws
>>>DeploymentException
>>>
>>>else, create the document stream and call:
>>>
>>>XmlFileLoader(boolean validateDTDs)
>>>public Document getDocument(InputStream is, String inPath) throws
>>>DeploymentException
>>>
>>>
>>>Scott Stark
>>>Chief Technology Officer
>>>JBoss Group, LLC
>>>
>>>- Original Message -
>>>From: "Dain Sundstrom" <[EMAIL PROTECTED]>
>>>To: "JBoss-dev" <[EMAIL PROTECTED]>
>>>Sent: Sunday, March 03, 2002 10:13 AM
>>>Subject: [JBoss-dev] XmlFileLoader and validation?
>>>
>>>
>>>
>>>
>>>>How can I know if there were no validation errors when loading a doc
>>>>with XmlFileLoader?
>>>>
>>>>I want to throw a DeploymentException if jbosscmp-jdbc.xml is not valid.
>>>>
>>>>-dain
>>>>
>>>>
>>>>___
>>>>Jboss-development mailing list
>>>>[EMAIL PROTECTED]
>>>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>>
>>>>
>>>>
>>>
>>>___
>>>Jboss-development mailing list
>>>[EMAIL PROTECTED]
>>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>
>>>
>>
>>
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] Is DatabaseMetaData safe to use?

2002-03-03 Thread Dain Sundstrom

I have been looking at using DatabaseMetaData extensively in the code 
for determining what sql to generate.  Is DatabaseMetaData safe to use? 
I do remember way back some vendors meta data lied.

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] XmlFileLoader and validation?

2002-03-03 Thread Dain Sundstrom

I use "XmlFileLoader.getDocument(stdJDBCUrl, true)", but all I get are 
messages like the following printed to the log:

13:25:05,062 ERROR [XmlFileLoader] XmlFileLoader: File 
file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/tmp/deploy/home/dain/work/jboss/jboss-
all/testsuite/output/lib/cmp2-commerce.jar/64.cmp2-commerce.jar!/META-INF/jbosscmp-jdbc.xml
 
process error. Line: 10. Error message: Element "defaults" does not 
allow "should-break" here.
13:25:05,063 ERROR [XmlFileLoader] XmlFileLoader: File 
file:/home/dain/work/jboss/jboss-all/build/output/jboss-3.0.0beta2/tmp/deploy/home/dain/work/jboss/jboss-
all/testsuite/output/lib/cmp2-commerce.jar/64.cmp2-commerce.jar!/META-INF/jbosscmp-jdbc.xml
 
process error. Line: 10. Error message: Element type "should-break" is 
not declared.

I like the messages, I just wish that at the end I could detect that the 
doc was not valid and throw a Deployment exception.

Any ideas?

-dain

Scott M Stark wrote:

> If you have the doc URL then use:
> 
> public static Document getDocument(URL url, boolean validateDTDs) throws
> DeploymentException
> 
> else, create the document stream and call:
> 
> XmlFileLoader(boolean validateDTDs)
> public Document getDocument(InputStream is, String inPath) throws
> DeploymentException
> 
> 
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> 
> - Original Message - 
> From: "Dain Sundstrom" <[EMAIL PROTECTED]>
> To: "JBoss-dev" <[EMAIL PROTECTED]>
> Sent: Sunday, March 03, 2002 10:13 AM
> Subject: [JBoss-dev] XmlFileLoader and validation?
> 
> 
> 
>>How can I know if there were no validation errors when loading a doc 
>>with XmlFileLoader?
>>
>>I want to throw a DeploymentException if jbosscmp-jdbc.xml is not valid.
>>
>>-dain
>>
>>
>>___
>>Jboss-development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
>>
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] XmlFileLoader and validation?

2002-03-03 Thread Dain Sundstrom

How can I know if there were no validation errors when loading a doc 
with XmlFileLoader?

I want to throw a DeploymentException if jbosscmp-jdbc.xml is not valid.

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] njar still has problems with security manager

2002-03-01 Thread Dain Sundstrom

Have you tried adding it to the primordial class loader?  I think it is 
something like -Xbootclasspath

-dain

Scott M Stark wrote:

> Even if I put the njar protocol handler in the system classpath
> and try a trival hello world main with the following simple
> policy file, running with a security manager fails when the policy
> file parsers goes into an infinitely recursive loop and blows
> out the stack. This is a show stopper for the custom njar protocol.
> 
> Security 944>jar -tf run.jar
> META-INF/
> META-INF/MANIFEST.MF
> HelloMain.class
> org/
> org/jboss/
> org/jboss/net/
> org/jboss/net/protocol/
> org/jboss/net/protocol/njar/
> org/jboss/net/protocol/njar/Handler.class
> org/jboss/net/protocol/resource/
> org/jboss/net/protocol/resource/Handler.class
> org/jboss/net/protocol/resource/ResourceURLConnection.class
> org/jboss/net/protocol/URLStreamHandlerFactory.class
> Security 945>cat server.policy
> grant codeBase "njar:file:run.jar" {
>permission java.security.AllPermission;
> };
> Security
> 946>java -Djava.security.manager -Djava.security.policy=server.policy
> -Djava.protocol.handler.pkgs=org.jboss.net.protocol -jar run.jar
> Exception in thread "main" java.lang.StackOverflowError
> at
> sun.security.action.GetPropertyAction.run(GetPropertyAction.java:69)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.security.provider.PolicyFile.(PolicyFile.java:111)
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:237)
> at java.security.Policy.getPolicyNoCheck(Policy.java:157)
> at
> java.security.SecureClassLoader.getPermissions(SecureClassLoader.java:138)
> at java.net.URLClassLoader.getPermissions(URLClassLoader.java:420)
> at
> sun.misc.Launcher$AppClassLoader.getPermissions(Launcher.java:294)
> at
> java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:1
> 62)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
> at java.net.URL.getURLStreamHandler(URL.java:927)
> at java.net.URL.(URL.java:478)
> at java.net.URL.(URL.java:376)
> at java.net.URL.(URL.java:330)
> at
> sun.security.provider.PolicyFile.getCodeSource(PolicyFile.java:590)
> at
> sun.security.provider.PolicyFile.addGrantEntry(PolicyFile.java:612)
> at sun.security.provider.PolicyFile.init(PolicyFile.java:530)
> at
> sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:330)
> at sun.security.provider.PolicyFile.access$000(PolicyFile.java:89)
> at sun.security.provider.PolicyFile$1.run(PolicyFile.java:232)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.security.provider.PolicyFile.init(PolicyFile.java:230)
> at sun.security.provider.PolicyFile.(PolicyFile.java:120)
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:237)
> at java.security.Policy.getPolicyNoCheck(Policy.java:157)
> at
> java.security.SecureClassLoader.getPermissions(SecureClassLoader.java:138)
> at java.net.URLClassLoader.getPermissions(URLClassLoader.java:420)
> at
> sun.misc.Launcher$AppClassLoader.getPermissions(Launcher.java:294)
> at
> java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:1
> 62)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
> at java.net.URL.getURLStreamHandler(URL.java:927)
> at java.net.URL.(URL.java:478)
> at java.net.URL.(URL.java:376)
> at java.net.URL.(URL.java:330)
> at
> sun.security.provider.PolicyFile.getCodeSource(PolicyFile.java:590)
> at
> sun.security.provider.PolicyFile.addGran

Re: [JBoss-dev] Logger change

2002-02-27 Thread Dain Sundstrom

>public static void main(String[] args)
>{
>   org.apache.log4j.BasicConfigurator.configure();
> 
>   testWrapper();
>   testVolatile();
>}


What if you run the volatile test first and then the wrapper test? 
Maybe you are seeing jit stuff.  I suggest running both, throwing away 
the results, as a warm up, and then running it again.



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] SQL alias-max-length=30

2002-02-27 Thread Dain Sundstrom

Ok I'll make change everything to 30 for startes.

-dain

Karl Koster wrote:

> Dain,
> 
> Most DB's have maximum object names of 30 characters. I know this applies to
> Oracle, Postgresql, Sybase, and MS SQL Server.
> 
> Karl Koster
> [EMAIL PROTECTED]
> Sempra Energy Trading
> 203-355-5182
> 
> -Original Message-
> From: Dain Sundstrom [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 11:27 AM
> To: JBoss-dev
> Subject: [JBoss-dev] Re: [ jboss-Bugs-516835 ] pk constraint name too
> long
> 
> 
> What is the maximum length of an alias in Oracle (or any other dbs that 
> we support) I did add an alias-max-length in the 
> standardjbosscmp-jdbc.xml file, but I set all of them to 32 for starters.
> 
> -dain
> 
> [EMAIL PROTECTED] wrote:
> 
> 
>>Bugs item #516835, was opened at 2002-02-13 00:27
>>You can respond by visiting: 
>>
>>
> http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516835&group_id=
> 22866
> 
>>Category: JBossCMP
>>Group: v3.0 Rabbit Hole
>>Status: Open
>>Resolution: Accepted
>>Priority: 5
>>Submitted By: Georg Schmid (giorgio42)
>>Assigned to: Dain Sundstrom (dsundstrom)
>>Summary: pk constraint name too long
>>
>>Initial Comment:
>>
>>RH 20020212, W2K, Oracle 8.1.7.
>>
>>Supplying a broken jbosscmp-jdbc.xml reveals,
>>that the CMP pk constraint name generation code does
>>not take into account the maximum identifier length
>>allowed by the underlying data source.
>>
>>It seems as if EB and pk field names are simply
>>concatenated without looking at the length of the
>>generated identifier.
>>
>>
>>Georg
>>
>>--
>>
>>
>>
>>>Comment By: Georg Schmid (giorgio42)
>>>
>>>
>>Date: 2002-02-27 08:15
>>
>>Message:
>>Logged In: YES 
>>user_id=437570
>>
>>
>>I already know several places where I can
>>put the great new EJB-QL compiler and its "order by" 
>>capability to good use :), but in the meantime...
>>
>>>From the following custom finder query (two String params):
>>
>>
>>  select object(schedule)
>>from ScheduleTable schedule,
>> IN(schedule.equipments) equipments
>>   where schedule.maintenance.id = ?1
>> and equipments.id = ?2
>>
>>
>>the following SELECT is generated (slightly formatted):
>>
>>SELECT t0_schedule.ID
>>  FROM SCHEDULE t0_schedule,
>>  EQUIPMENT t2_equipments,
>>  MAINTENANCE t1_schedule_maintenance
>> WHERE t1_schedule_maintenance.ID = ?
>>   AND t2_equipments.ID = ?
>>   AND (t0_schedule.FK_MAINTENANCE_ID=t1_schedule_maintenance.ID
>>AND
>>t0_schedule.ID=t3_schedule_equipments_RELATION_.FK_SCHEDULE_ID
>>AND
>>t2_equipments.ID=t3_schedule_equipments_RELATION_.FK_EQUIPMENT_ID)
>>
>>Two problems:
>>
>>- the identifier 
>>t3_schedule_equipments_RELATION_ is too long (Oracle error
>>ORA-00972). 
>>- this identifier is missing in the FROM clause (that's
>>a different bug).
>>
>>This query worked until yesterday.
>>
>>So if this alias name is shortened to something Oracle
>>is able to handle, the semantic checker will complain.
>>
>>I guess, in general the length of relationship table alias 
>>name should be less than
>> max(length(ATableName), length(BTableName)) 
>>(or <= max(length(A_AbstractSchema),length(B_AbstractSchema)))
>>to be on the safe side.
>>
>>Georg
>>
>>
>>--
>>
>>You can respond by visiting: 
>>
>>
> http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516835&group_id=
> 22866
> 
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 
> **
> This e-mail contains privileged attorney-client communications and/or confidential 
>information, and is only for the use by the intended recipient. Receipt by an 
>unintended recipient does not constitute a waiver of any applicable privilege."
> 
> Reading, disclosure, discussion, dissemination, distribution or copying of this 
>information by anyone other than the intended recipient or his or her employees or 
>agents is strictly prohibited.  If you have received this communication in error, 
>please immediately notify us and delete the original material from your computer."
> 
> Sempra Energy Trading Corp. (SET) is not the same company as SDG&E or SoCalGas, the 
>utilities owned by SET's parent company.  SET is not regulated by the California 
>Public Utilities Commission and you do not have to buy SET's products and services to 
>continue to receive quality regulated service from the utilities."
> **
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] Re: [ jboss-Bugs-516835 ] pk constraint name too long

2002-02-27 Thread Dain Sundstrom

What is the maximum length of an alias in Oracle (or any other dbs that 
we support) I did add an alias-max-length in the 
standardjbosscmp-jdbc.xml file, but I set all of them to 32 for starters.

-dain

[EMAIL PROTECTED] wrote:

> Bugs item #516835, was opened at 2002-02-13 00:27
> You can respond by visiting: 
> http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516835&group_id=22866
> 
> Category: JBossCMP
> Group: v3.0 Rabbit Hole
> Status: Open
> Resolution: Accepted
> Priority: 5
> Submitted By: Georg Schmid (giorgio42)
> Assigned to: Dain Sundstrom (dsundstrom)
> Summary: pk constraint name too long
> 
> Initial Comment:
> 
> RH 20020212, W2K, Oracle 8.1.7.
> 
> Supplying a broken jbosscmp-jdbc.xml reveals,
> that the CMP pk constraint name generation code does
> not take into account the maximum identifier length
> allowed by the underlying data source.
> 
> It seems as if EB and pk field names are simply
> concatenated without looking at the length of the
> generated identifier.
> 
> 
> Georg
> 
> --
> 
> 
>>Comment By: Georg Schmid (giorgio42)
>>
> Date: 2002-02-27 08:15
> 
> Message:
> Logged In: YES 
> user_id=437570
> 
> 
> I already know several places where I can
> put the great new EJB-QL compiler and its "order by" 
> capability to good use :), but in the meantime...
> 
>>From the following custom finder query (two String params):
> 
> 
>   select object(schedule)
> from ScheduleTable schedule,
>  IN(schedule.equipments) equipments
>where schedule.maintenance.id = ?1
>  and equipments.id = ?2
> 
> 
> the following SELECT is generated (slightly formatted):
> 
> SELECT t0_schedule.ID
>   FROM SCHEDULE t0_schedule,
>   EQUIPMENT t2_equipments,
>   MAINTENANCE t1_schedule_maintenance
>  WHERE t1_schedule_maintenance.ID = ?
>AND t2_equipments.ID = ?
>AND (t0_schedule.FK_MAINTENANCE_ID=t1_schedule_maintenance.ID
> AND
> t0_schedule.ID=t3_schedule_equipments_RELATION_.FK_SCHEDULE_ID
> AND
> t2_equipments.ID=t3_schedule_equipments_RELATION_.FK_EQUIPMENT_ID)
> 
> Two problems:
> 
> - the identifier 
> t3_schedule_equipments_RELATION_ is too long (Oracle error
> ORA-00972). 
> - this identifier is missing in the FROM clause (that's
> a different bug).
> 
> This query worked until yesterday.
> 
> So if this alias name is shortened to something Oracle
> is able to handle, the semantic checker will complain.
> 
> I guess, in general the length of relationship table alias 
> name should be less than
>  max(length(ATableName), length(BTableName)) 
> (or <= max(length(A_AbstractSchema),length(B_AbstractSchema)))
> to be on the safe side.
> 
> Georg
> 
> 
> --
> 
> You can respond by visiting: 
> http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516835&group_id=22866
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/etc/conf/default standardjbosscmp-jdbc.xml

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 22:46:48

  Modified:src/etc/conf/default standardjbosscmp-jdbc.xml
  Log:
  Changed mySQL java.util.Date jdbc-type to TIMESTAMP. Bug #518197.
  
  Revision  ChangesPath
  1.19  +2 -2  jboss/src/etc/conf/default/standardjbosscmp-jdbc.xml
  
  Index: standardjbosscmp-jdbc.xml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/standardjbosscmp-jdbc.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- standardjbosscmp-jdbc.xml 27 Feb 2002 00:11:04 -  1.18
  +++ standardjbosscmp-jdbc.xml 27 Feb 2002 06:46:48 -  1.19
  @@ -7,7 +7,7 @@
   
   
   
  -
  +
   
   
  
  @@ -918,7 +918,7 @@


   java.util.Date
  -DATE
  +TIMESTAMP
   DATETIME


  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] New EJB-QL compiler (ORDER BY and DynamicQL)

2002-02-26 Thread Dain Sundstrom

Adam Heath wrote:

> On Tue, 26 Feb 2002, Dain Sundstrom wrote:
> 
> 
>>dynamic-ql:
>>The new compiler is eye-blink fast, so I added a new query type
>>dynamic-ql. With dynamic-ql you can generate a JBossQL query and pass it
>>along with the parameters to the engine to be compiled and execute at
>>runtime.  To use this query you add an ejbSelect method to your bean
>>with the following signature:
>>
>> ejbSelect(String jbossQL, Object[] args)
>>
> 
> Damn, that's cool, can't wait until we switch to work to make use of this.
> 
> Does this cache the compiled form, indexed by  and jbossQL?


No, I really don't think it is necessary.  Later if someone proves that 
this is a performance problem I'll add some caching, but I think that 
the compile step will be a insignificant when compare to the time 
required to load the result set.

-dain




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] New EJB-QL compiler (ORDER BY and DynamicQL)

2002-02-26 Thread Dain Sundstrom

The new EJB-QL compiler is finished and checked in tip. The new compiler 
is a complete rewrite in JavaCC, and is much faster, easier to maintain, 
and has error messages.  I was surprised by the number of errors I found 
in the old parser.  You guys haven't been pushing the engine enough, so 
to give you incentive to test the new engine I've added several new 
features.


Error messages:
This is not really a feature but as we didn't have them before it feels 
like a feature.

JBossQL:
I actually wrote two compilers a spec compliant EJB-QL compiler and 
JBossQL compiler. JBossQL is a superset of EJB-QL which adds support for 
ORDER BY. To use JBossQL you override ejb-ql declaration in your 
jbosscmp-jdbc.xml file with a jboss-ql element (i.e. just copy the query 
element from your ejb-jar.xml file, change ejb-ql to jboss-ql and add 
the order by clause. The BNF for order by follows:

JBossQL := select_clause from_clause [where_clause] [order_by_clause]
order_by_clause := ORDER BY order_by_path_expression
  ( , order_by_path_expression)*
order_by_path_expression := ( numeric_valued_path |
  string_valued_path |
  datetime_valued_path ) [ASC | DESC]


dynamic-ql:
The new compiler is eye-blink fast, so I added a new query type 
dynamic-ql. With dynamic-ql you can generate a JBossQL query and pass it 
along with the parameters to the engine to be compiled and execute at 
runtime.  To use this query you add an ejbSelect method to your bean 
with the following signature:

 ejbSelect(String jbossQL, Object[] args)

You must declare the query type in your ejb-jar.xml (required by the 
spec; just leave the ejb-ql element empty) and in your jbosscmp-jdbc.xml 
file override the impl with an empty  element.


For more info specifying the queries, see the jbosscmp-jdbc_3_0.dtd

Please, post follow-ups in the online forum at 
http://main.jboss.org/thread.jsp?forum=46&thread=9743

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/ejbql ASTSelect.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:52:52

  Modified:src/main/org/jboss/ejb/plugins/cmp/ejbql ASTSelect.java
  Log:
  Accidently copied the class declartion line from ASTRangeVariableDeclartion.
  
  Revision  ChangesPath
  1.2   +1 -2  jboss/src/main/org/jboss/ejb/plugins/cmp/ejbql/ASTSelect.java
  
  Index: ASTSelect.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/ejbql/ASTSelect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTSelect.java26 Feb 2002 23:16:40 -  1.1
  +++ ASTSelect.java27 Feb 2002 00:52:52 -  1.2
  @@ -11,9 +11,8 @@
* This abstract syntax node represents a select clause.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
*/
  -public class ASTRangeVariableDeclaration extends SimpleNode {
   public class ASTSelect extends SimpleNode {
  public boolean distinct;
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/bridge EntityBridgeInvocationHandler.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:52:03

  Modified:src/main/org/jboss/ejb/plugins/cmp/bridge
EntityBridgeInvocationHandler.java
  Log:
  Forgot to import javax.ejb.FinderException.
  
  Revision  ChangesPath
  1.15  +2 -1  
jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java
  
  Index: EntityBridgeInvocationHandler.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- EntityBridgeInvocationHandler.java26 Feb 2002 23:24:53 -  1.14
  +++ EntityBridgeInvocationHandler.java27 Feb 2002 00:52:03 -  1.15
  @@ -17,6 +17,7 @@
   import java.util.Map;
   
   import javax.ejb.EJBException;
  +import javax.ejb.FinderException;
   import javax.transaction.Transaction;
   
   import org.jboss.deployment.DeploymentException;
  @@ -37,7 +38,7 @@
*  One per cmp entity bean instance, including beans in pool.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
*/
   public class EntityBridgeInvocationHandler implements InvocationHandler {
  private final EntityContainer container;
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss build.xml

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:47:05

  Modified:.build.xml
  Log:
  Added generate-parsers target which uses JavaCC to generate the EJB-QL and
  JBossQL parsers.
  
  Revision  ChangesPath
  1.72  +40 -2 jboss/build.xml
  
  Index: build.xml
  ===
  RCS file: /cvsroot/jboss/jboss/build.xml,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- build.xml 24 Feb 2002 10:24:31 -  1.71
  +++ build.xml 27 Feb 2002 00:47:04 -  1.72
  @@ -12,7 +12,7 @@
   
   
   
  -
  +
   
   
   
  @@ -69,6 +69,10 @@
   
   
   
  +
  +
  +
  +
   
   
   
  @@ -242,6 +246,7 @@
   
   
   
  +
   
   
   
  @@ -311,7 +316,8 @@
|  documentation compiles.
   -->
 
   
  +  
  +  
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +  
  +
 
 
   
  @@ -394,6 +431,7 @@
  
   
  
  +   
  
  
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCDeclaredQueryMetaData.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:59:27

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCDeclaredQueryMetaData.java
  Log:
  Removed code that attempted to load resultTypeMappingLocal from the
  declared-sql element.  This was an obvious error.
  
  Revision  ChangesPath
  1.10  +2 -17 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCDeclaredQueryMetaData.java
  
  Index: JDBCDeclaredQueryMetaData.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCDeclaredQueryMetaData.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JDBCDeclaredQueryMetaData.java17 Jan 2002 17:26:12 -  1.9
  +++ JDBCDeclaredQueryMetaData.java26 Feb 2002 23:59:27 -  1.10
  @@ -19,7 +19,7 @@
* Imutable class contains information about a declated query.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - *   @version $Revision: 1.9 $
  + *   @version $Revision: 1.10 $
*/
   public final class JDBCDeclaredQueryMetaData implements JDBCQueryMetaData {
  /**
  @@ -94,22 +94,7 @@
 order = MetaData.getOptionalChildContent(queryElement, "order");
 other = MetaData.getOptionalChildContent(queryElement, "other");
   
  -
  - String resultTypeMappingString = MetaData.getOptionalChildContent(
  -queryElement,
  -"result-type-mapping");
  -
  - if(QueryMetaData.LOCAL.equals(resultTypeMappingString)) {
  - resultTypeMappingLocal = true;
  -  } else if(QueryMetaData.REMOTE.equals(resultTypeMappingString)) {
  - resultTypeMappingLocal = false;
  -  } else if(resultTypeMappingString == null) {
  - resultTypeMappingLocal = jdbcQueryMetaData.isResultTypeMappingLocal();
  -  } else {
  - throw new DeploymentException("result-type-mapping, if 
specified, " +
  -   "must be '" + QueryMetaData.REMOTE + "' or '" +
  -   QueryMetaData.LOCAL + "', and it is case sensitive.");
  - }
  +  resultTypeMappingLocal = jdbcQueryMetaData.isResultTypeMappingLocal();
   
 // load ejbSelect info
 Element selectElement = 
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCLoadEntityCommand.java JDBCStoreEntityCommand.java JDBCStoreManager.java JDBCUtil.java ReadAheadCache.java SQLUtil.java

2002-02-26 Thread Dain Sundstrom
  1.28
  @@ -31,6 +31,7 @@
   import org.jboss.ejb.EntityPersistenceStore;
   import org.jboss.ejb.EntityEnterpriseContext;
   import org.jboss.ejb.ListCacheKey;
  +import org.jboss.ejb.plugins.cmp.ejbql.Catalog;
   import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMPFieldBridge;
   import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge;
   import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge;
  @@ -58,7 +59,7 @@
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
* @see org.jboss.ejb.EntityPersistenceStore
  - * @version $Revision: 1.27 $
  + * @version $Revision: 1.28 $
*/
   public class JDBCStoreManager implements EntityPersistenceStore {
   
  @@ -103,24 +104,11 @@
  private JDBCPassivateEntityCommand passivateEntityCommand;
   
  // commands
  -//   private JDBCFindByForeignKeyCommand findByForeignKeyCommand;
  private JDBCLoadRelationCommand loadRelationCommand;
  private JDBCDeleteRelationsCommand deleteRelationsCommand;
  private JDBCInsertRelationsCommand insertRelationsCommand;
   
  /**
  -* A map of data preloaded within some transaction for some entity. This map
  -* is keyed by Transaction, entityKey and CMP field name
  -* and the data is Object containing the field value.
  -*/
  -//   private Map preloadedData = new HashMap();
  -
  -   /**
  -* A set of transactions for which data was preloaded.
  -*/
  -//   private Set transactions = new HashSet();
  -
  -   /**
   * A Transaction manager so that we can link preloaded data to a transaction
   */
  private TransactionManager tm;
  @@ -287,6 +275,14 @@
 // create the bridge between java land and this engine (sql land)
 entityBridge = new JDBCEntityBridge(metaData, this);
   
  +  // add the entity bridge to the catalog
  +  Catalog catalog = (Catalog)getApplicationData("CATALOG");
  +  if(catalog == null) {
  + catalog = new Catalog();
  + putApplicationData("CATALOG", catalog);
  +  }
  +  catalog.addEntity(entityBridge);
  +
 // create the read ahead cache
 readAheadCache = new ReadAheadCache(this);
 readAheadCache.create();
  @@ -402,7 +398,9 @@
  public void loadEntity(EntityEnterpriseContext ctx) {
 // is any on the data already in the entity valid
 if(!ctx.isValid()) {
  - log.debug("RESET PERSISTENCE CONTEXT: id="+ctx.getId());
  + if(log.isTraceEnabled()) {
  +log.trace("RESET PERSISTENCE CONTEXT: id="+ctx.getId());
  + }
entityBridge.resetPersistenceContext(ctx);
 }
   
  @@ -462,13 +460,6 @@
  //
  // Relationship Commands
  //
  -//   public Collection findByForeignKey(
  -// Object foreignKey, 
  -// JDBCCMRFieldBridge cmrField) {
  -//
  -//  return findByForeignKeyCommand.execute(foreignKey, cmrField);
  -//   }
  -
  public Collection loadRelation(JDBCCMRFieldBridge cmrField, Object pk) {
 return loadRelationCommand.execute(cmrField, pk);
  }
  
  
  
  1.9   +9 -9  jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCUtil.java
  
  Index: JDBCUtil.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCUtil.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JDBCUtil.java 24 Nov 2001 21:39:10 -  1.8
  +++ JDBCUtil.java 27 Feb 2002 00:07:59 -  1.9
  @@ -43,7 +43,7 @@
* parameters and loading query results.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
*/
   public class JDBCUtil
   {
  @@ -132,8 +132,8 @@
   */
  public static void setParameter(Logger log, PreparedStatement ps, int index, int 
jdbcType, Object value) throws SQLException
  {
  -  if(log.isDebugEnabled()) {
  - log.debug("Set parameter: " +
  +  if(log.isTraceEnabled()) {
  + log.trace("Set parameter: " +
  "index=" + index + ", " +
  "jdbcType=" + getJDBCTypeName(jdbcType) + ", " +
  "value=" + ((value == null) ? "NULL" : value));
  @@ -193,24 +193,24 @@
 Object[] returnValue = new Object[1];
 if(getNonBinaryResult(rs, index, destination, returnValue))
 {
  - if(log.isDebugEnabled()) {
  -log.debug("Get result: index=" + index + 
  + if(log.isTraceEnabled()) {
  +log.trace("Get result: index=" + index + 
 ", javaType=" + destination.getName() + 
 ", Simple, value=" + returnValue[0]);
}
return returnValue[0];
 } else if(getObjectRes

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCQueryMetaDataFactory.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:01:56

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCQueryMetaDataFactory.java
  Log:
  Added support for DynamicQL and JBossQL queries.
  
  Added support for array parameters.
  
  Revision  ChangesPath
  1.12  +42 -2 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCQueryMetaDataFactory.java
  
  Index: JDBCQueryMetaDataFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCQueryMetaDataFactory.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JDBCQueryMetaDataFactory.java 12 Feb 2002 19:23:06 -  1.11
  +++ JDBCQueryMetaDataFactory.java 27 Feb 2002 00:01:56 -  1.12
  @@ -6,6 +6,7 @@
*/
   package org.jboss.ejb.plugins.cmp.jdbc.metadata;
   
  +import java.lang.reflect.Array;
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
   import java.util.ArrayList;
  @@ -24,7 +25,7 @@
* on the query specifiection type.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
*/
   public class JDBCQueryMetaDataFactory {
  private JDBCEntityMetaData entity;
  @@ -92,6 +93,27 @@
return new JDBCRawSqlQueryMetaData(method);
 }
   
  +  // JBOSS-QL
  +  Element jbossQL = 
  +MetaData.getOptionalChild(queryElement, "jboss-ql");
  +  if(jbossQL != null) {
  + return new JDBCJBossQLQueryMetaData(
  +   jdbcQueryMetaData,
  +   jbossQL,
  +   method,
  +   readAhead);
  +  }
  +
  +  // DYNAMIC-SQL
  +  Element dynamicQL = 
  +MetaData.getOptionalChild(queryElement, "dynamic-ql");
  +  if(dynamicQL != null) {
  + return new JDBCDynamicQLQueryMetaData(
  +   jdbcQueryMetaData,
  +   dynamicQL,
  +   method);
  +  }
  +
 // DECLARED-SQL
 Element delcaredSql = 
   MetaData.getOptionalChild(queryElement, "declared-sql");
  @@ -243,8 +265,26 @@
}
 }
 
  +  int arraySize = 0;
  +  while(name.endsWith("[]")) {
  + name = name.substring(0, name.length()-2);
  + arraySize++;
  +  }
  +
 try {
  - return entity.getClassLoader().loadClass(name);
  + // get the base class
  + Class c = entity.getClassLoader().loadClass(name);
  +
  + // if we have an array get the array class
  + if(arraySize > 0) {
  +int[] dimensions = new int[arraySize];
  +for(int i=0; ihttps://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCTypeMappingMetaData.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:05:42

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCTypeMappingMetaData.java
  Log:
  Added subquery-supported flag, which is used by EJB-QL compiler to
  determine if subqueries or left joins should be used.
  
  Make alias generation elements required.
  
  Revision  ChangesPath
  1.11  +21 -19
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCTypeMappingMetaData.java
  
  Index: JDBCTypeMappingMetaData.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCTypeMappingMetaData.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JDBCTypeMappingMetaData.java  30 Dec 2001 19:11:38 -  1.10
  +++ JDBCTypeMappingMetaData.java  27 Feb 2002 00:05:41 -  1.11
  @@ -17,7 +17,7 @@
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
*   @author Sebastien Alborini
  - *   @version $Revision: 1.10 $
  + *   @version $Revision: 1.11 $
*/
   public final class JDBCTypeMappingMetaData {
  
  @@ -38,6 +38,9 @@
  private final String aliasHeaderPrefix;
  private final String aliasHeaderSuffix;
  private final int aliasMaxLength;
  +
  +   private final boolean subquerySupported;
  +
  private JDBCFunctionMappingMetaData rowLocking = null;
  private JDBCFunctionMappingMetaData fkConstraint = null;
  private JDBCFunctionMappingMetaData pkConstraint = null;
  @@ -108,26 +111,18 @@
  functionMapping);
 }
 
  -  String prefix = 
  -MetaData.getOptionalChildContent(element, "alias-header-prefix");
  -  if(prefix == null) {
  - prefix = "t";
  -  }
  -  aliasHeaderPrefix = prefix;
  +  aliasHeaderPrefix = 
  +MetaData.getUniqueChildContent(element, "alias-header-prefix");
 
  -  String suffix = 
  -MetaData.getOptionalChildContent(element, "alias-header-suffix");
  -  if(suffix == null) {
  - suffix = "_";
  -  }
  -  aliasHeaderSuffix = suffix;
  +  aliasHeaderSuffix = 
  +MetaData.getUniqueChildContent(element, "alias-header-suffix");
 
  -  String max = 
  -MetaData.getOptionalChildContent(element, "alias-max-length");
  -  if(max == null) {
  - max = "32";
  -  }
  -  aliasMaxLength = Integer.parseInt(max);
  +  aliasMaxLength = Integer.parseInt(
  +MetaData.getUniqueChildContent(element, "alias-max-length"));
  +
  +  String subquerySupportedStr = 
  +MetaData.getUniqueChildContent(element, "subquery-supported");
  +  subquerySupported = Boolean.valueOf(subquerySupportedStr).booleanValue();
  }
  
  /**
  @@ -173,6 +168,13 @@
 return aliasMaxLength;
  }
 
  +   /**
  +* Does this type mapping support subqueries?
  +*/
  +   public boolean isSubquerySupported() {
  +  return subquerySupported;
  +   }
  +
  /**
   * Gets the jdbc type which this class has mapped to the specified java 
   * class. The jdbc type is used to retrieve data from a result set and to 
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/resources/org/jboss/metadata jbosscmp-jdbc_3_0.dtd

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:13:53

  Modified:src/resources/org/jboss/metadata jbosscmp-jdbc_3_0.dtd
  Log:
  Added new jboss-ql and dynamic-ql elements.
  
  Made alias generation elements required.
  
  Added subquery-supported element.
  
  Revision  ChangesPath
  1.12  +39 -2 jboss/src/resources/org/jboss/metadata/jbosscmp-jdbc_3_0.dtd
  
  Index: jbosscmp-jdbc_3_0.dtd
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/resources/org/jboss/metadata/jbosscmp-jdbc_3_0.dtd,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jbosscmp-jdbc_3_0.dtd 12 Feb 2002 06:22:50 -  1.11
  +++ jbosscmp-jdbc_3_0.dtd 27 Feb 2002 00:13:52 -  1.12
  @@ -275,7 +275,8 @@
   
  -
  +
   
   
   
  +
  +
  +
  +
  +
  +
  +
  +
   
   
  +
   
  @@ -449,7 +464,8 @@
   This includes both type mapping and function mapping.
   -->
   
  +  fk-constraint-template, alias-header-prefix, alias-header-suffix,
  +  alias-max-length, subquery-supported, function-mapping*, mapping+)>
   
   
   
  +
  +
  +
  +
  +
  +
  +
  +
   
   

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCJBossQLQueryMetaData.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:58:17

  Added:   src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCJBossQLQueryMetaData.java
  Log:
  Initial revison of metadata for new JBossQL queries.
  
  Revision  ChangesPath
  1.1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCJBossQLQueryMetaData.java
  
  Index: JDBCJBossQLQueryMetaData.java
  ===
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.ejb.plugins.cmp.jdbc.metadata;
  
  import java.lang.reflect.Method;
  import org.w3c.dom.Element;
  import org.jboss.deployment.DeploymentException;
  import org.jboss.metadata.MetaData;
  import org.jboss.metadata.QueryMetaData;
  
  /**
   * Immutable class which contains information about an JBossQL query.
   *
   * @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
   * @version $Revision: 1.1 $
   */
  public final class JDBCJBossQLQueryMetaData implements JDBCQueryMetaData {
 /**
  * The method to which this query is bound.
  */
 private final Method method;
  
 /**
  * The ejb-ql fro the query.
  */
 private final String jbossQL;
  
 /**
  * Should the query return Local or Remote beans.
  */
 private final boolean resultTypeMappingLocal;
  
 /**
  * Read ahead meta data.
  */
 private final JDBCReadAheadMetaData readAhead;
  
 /**
  * Constructs a JDBCJBossQLQueryMetaData with JBossQL declared in the 
  * jboss-ql elemnt and is invoked by the specified method.
  * @param queryMetaData the metadata about this query
  */
 public JDBCJBossQLQueryMetaData(
   JDBCQueryMetaData jdbcQueryMetaData,
   Element element,
   Method method,
   JDBCReadAheadMetaData readAhead) throws DeploymentException {

this.method = method;
this.readAhead = readAhead;
jbossQL = MetaData.getElementContent(element);
if(jbossQL==null || jbossQL.trim().length()==0) {
   throw new DeploymentException("jboss-ql element is empty");
}
resultTypeMappingLocal = jdbcQueryMetaData.isResultTypeMappingLocal();
 }
  
 // javadoc in parent class
 public Method getMethod() {
return method;
 }
  
 /**
  * Gets the JBossQL query which will be invoked.
  * @return the ejb ql String for this query
  */
 public String getJBossQL() {
return jbossQL;
 }
  
 // javadoc in parent class
 public boolean isResultTypeMappingLocal() {
return resultTypeMappingLocal;
 }
  
 /**
  * Gets the read ahead metadata for the query.
  * @return the read ahead metadata for the query.
  */
 public JDBCReadAheadMetaData getReadAhead() {
return readAhead;
 }
  
 /**
  * Compares this JDBCJBossQLQueryMetaData against the specified object.
  * Returns true if the objects are the same. Two JDBCJBossQLQueryMetaData
  * are the same if they are both invoked by the same method.
  * @param o the reference object with which to compare
  * @return true if this object is the same as the object argument; 
  *false otherwise
  */
 public boolean equals(Object o) {
if(o instanceof JDBCJBossQLQueryMetaData) {
   return ((JDBCJBossQLQueryMetaData)o).method.equals(method);
}
return false;
 }
  
 /**
  * Returns a hashcode for this JDBCJBossQLQueryMetaData. The hashcode is
  * computed by the method which invokes this query.
  * @return a hash code value for this object
  */
 public int hashCode() {
return method.hashCode();
 }
 /**
  * Returns a string describing this JDBCJBossQLQueryMetaData. The exact
  * details of the representation are unspecified and subject to change, but
  * the following may be regarded as typical:
  * 
  * "[JDBCJBossQLQueryMetaData: method=public org.foo.User
  *   findByName(java.lang.String)]"
  *
  * @return a string representation of the object
  */
 public String toString() {
return "[JDBCJBossQLQueryMetaData : method=" + method + "]";
 }
  }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCReadAheadMetaData.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 16:03:25

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCReadAheadMetaData.java
  Log:
  Added new constructor that takes all state info as parameters.
  
  Revision  ChangesPath
  1.6   +19 -1 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCReadAheadMetaData.java
  
  Index: JDBCReadAheadMetaData.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCReadAheadMetaData.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JDBCReadAheadMetaData.java15 Jan 2002 21:19:43 -  1.5
  +++ JDBCReadAheadMetaData.java27 Feb 2002 00:03:25 -  1.6
  @@ -19,7 +19,7 @@
* It loads its data from standardjbosscmp-jdbc.xml and jbosscmp-jdbc.xml
*
* @author mailto:[EMAIL PROTECTED]";>Oleg Nitz
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
*/
   public final class JDBCReadAheadMetaData {
   
  @@ -72,6 +72,24 @@
 strategy = ON_LOAD;
 pageSize = 255;
 eagerLoadGroup = "*";
  +   }
  +
  +   /**
  +* Constructs read ahead meta data with specified strategy, pageSize and 
  +* eagerLoadGroup.
  +*/
  +   public JDBCReadAheadMetaData(
  + String strategy, 
  + int pageSize, 
  + String eagerLoadGroup) {
  +  
  +  this.strategy = (byte) STRATEGIES.indexOf(strategy);
  +  if(this.strategy < 0) {
  + throw new IllegalArgumentException("Unknown read ahead strategy '" + 
  +   strategy + "'.");
  +  }
  +  this.pageSize = pageSize;
  +  this.eagerLoadGroup = eagerLoadGroup;
  }
   
  /**
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCTypeFactory.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:55:46

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCTypeFactory.java
  Log:
  Added method to get type metadata.  This is used by the EJB-QL compiler.
  
  Revision  ChangesPath
  1.10  +5 -1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCTypeFactory.java
  
  Index: JDBCTypeFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCTypeFactory.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JDBCTypeFactory.java  12 Feb 2002 06:17:15 -  1.9
  +++ JDBCTypeFactory.java  26 Feb 2002 23:55:46 -  1.10
  @@ -27,7 +27,7 @@
* this class is to flatten the JDBCValueClassMetaData into columns.
* 
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
*/
   public class JDBCTypeFactory {
  // the type mapping to use with the specified database
  @@ -78,6 +78,10 @@
   
  public int getJDBCTypeForJavaType(Class clazz) {  
 return typeMapping.getJdbcTypeForJavaType(clazz);
  +   }
  +
  +   public JDBCTypeMappingMetaData getTypeMapping() {
  +  return typeMapping;
  }
   
  private JDBCTypeComplex createTypeComplex(
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata JDBCDynamicQLQueryMetaData.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:57:40

  Added:   src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata
JDBCDynamicQLQueryMetaData.java
  Log:
  Initial revision of metadat for new DynamicQL syle queries.
  
  Revision  ChangesPath
  1.1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCDynamicQLQueryMetaData.java
  
  Index: JDBCDynamicQLQueryMetaData.java
  ===
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.ejb.plugins.cmp.jdbc.metadata;
  
  import java.lang.reflect.Method;
  import org.w3c.dom.Element;
  import org.jboss.deployment.DeploymentException;
  import org.jboss.metadata.MetaData;
  import org.jboss.metadata.QueryMetaData;
  
  /**
   * Immutable class which contains information about an DynamicQL query.
   *
   * @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
   * @version $Revision: 1.1 $
   */
  public final class JDBCDynamicQLQueryMetaData implements JDBCQueryMetaData {
 /**
  * The method to which this query is bound.
  */
 private final Method method;
  
 /**
  * Should the query return Local or Remote beans.
  */
 private final boolean resultTypeMappingLocal;
  
 private final JDBCReadAheadMetaData readAhead;
 /**
  * Constructs a JDBCDynamicQLQueryMetaData with DynamicQL declared in the 
  * jboss-ql elemnt and is invoked by the specified method.
  * @param queryMetaData the metadata about this query
  */
 public JDBCDynamicQLQueryMetaData(
   JDBCQueryMetaData jdbcQueryMetaData,
   Element element,
   Method method) throws DeploymentException {

this.method = method;
resultTypeMappingLocal = jdbcQueryMetaData.isResultTypeMappingLocal();
  
Class[] parameterTypes = method.getParameterTypes();
if(parameterTypes.length != 2 ||
  !parameterTypes[0].equals(String.class) ||
  !parameterTypes[1].equals(Object[].class)) {
   throw new DeploymentException("Dynamic-ql method must have two " +
 "parameters of type String and Object[].");
}
  
readAhead = new JDBCReadAheadMetaData(
  "on-find",
  255,
  "*");
 }
  
 // javadoc in parent class
 public Method getMethod() {
return method;
 }
  
 // javadoc in parent class
 public boolean isResultTypeMappingLocal() {
return resultTypeMappingLocal;
 }
  
 /**
  * Gets the read ahead metadata for the query.
  * @return the read ahead metadata for the query.
  */
 public JDBCReadAheadMetaData getReadAhead() {
return readAhead;
 }
  
 /**
  * Compares this JDBCDynamicQLQueryMetaData against the specified object.
  * Returns true if the objects are the same. Two JDBCDynamicQLQueryMetaData
  * are the same if they are both invoked by the same method.
  * @param o the reference object with which to compare
  * @return true if this object is the same as the object argument; 
  *false otherwise
  */
 public boolean equals(Object o) {
if(o instanceof JDBCDynamicQLQueryMetaData) {
   return ((JDBCDynamicQLQueryMetaData)o).method.equals(method);
}
return false;
 }
  
 /**
  * Returns a hashcode for this JDBCDynamicQLQueryMetaData. The hashcode is
  * computed by the method which invokes this query.
  * @return a hash code value for this object
  */
 public int hashCode() {
return method.hashCode();
 }
 /**
  * Returns a string describing this JDBCDynamicQLQueryMetaData. The exact
  * details of the representation are unspecified and subject to change, but
  * the following may be regarded as typical:
  * 
  * "[JDBCDynamicQLQueryMetaData: method=public org.foo.User
  *   findByName(java.lang.String)]"
  *
  * @return a string representation of the object
  */
 public String toString() {
return "[JDBCDynamicQLQueryMetaData : method=" + method + "]";
 }
  }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCStartCommand.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:53:07

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCStartCommand.java
  Log:
  Minor changes due to changes in CMRFieldBridge interface.
  
  Revision  ChangesPath
  1.22  +4 -4  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java
  
  Index: JDBCStartCommand.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JDBCStartCommand.java 12 Feb 2002 06:15:17 -  1.21
  +++ JDBCStartCommand.java 26 Feb 2002 23:53:06 -  1.22
  @@ -40,7 +40,7 @@
* @author mailto:[EMAIL PROTECTED]";>Joe Shevland
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
* @author mailto:[EMAIL PROTECTED]";>Michel de Groot
  - * @version $Revision: 1.21 $
  + * @version $Revision: 1.22 $
*/
   public class JDBCStartCommand {
   
  @@ -96,7 +96,7 @@
JDBCRelationMetaData relationMetaData = cmrField.getRelationMetaData();
   
// if the table for the related entity has been created
  - if(cmrField.getRelatedEntity().getTableExists()) {
  + if(cmrField.getRelatedJDBCEntity().getTableExists()) {
   
   // create the relation table
   if(relationMetaData.isTableMappingStyle() &&
  @@ -281,8 +281,8 @@
 cmrField.getEntity().getTableName(),
 cmrField.getFieldName(),
 cmrField.getForeignKeyFields(),
  -  cmrField.getRelatedEntity().getTableName(),
  -  cmrField.getRelatedEntity().getPrimaryKeyFields());
  +  cmrField.getRelatedJDBCEntity().getTableName(),
  +  cmrField.getRelatedJDBCEntity().getPrimaryKeyFields());
}
 } else {
log.debug("Foreign key constraint not added as requested: " + 
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCQueryManager.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:52:01

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCQueryManager.java
  Log:
  Added support for new DynamicQL and JBossQL queries.
  
  Revision  ChangesPath
  1.4   +12 -2 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCQueryManager.java
  
  Index: JDBCQueryManager.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCQueryManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JDBCQueryManager.java 15 Jan 2002 22:23:17 -  1.3
  +++ JDBCQueryManager.java 26 Feb 2002 23:52:01 -  1.4
  @@ -19,6 +19,8 @@
   import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCAutomaticQueryMetaData;
   import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaData;
   import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCDeclaredQueryMetaData;
  +import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCDynamicQLQueryMetaData;
  +import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCJBossQLQueryMetaData;
   import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQlQueryMetaData;
   import org.jboss.logging.Logger;
   
  @@ -30,7 +32,7 @@
* @author mailto:[EMAIL PROTECTED]";>Marc Fleury
* @author mailto:[EMAIL PROTECTED]";>Joe Shevland
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
*/
   public class JDBCQueryManager {
  private final Map knownQueries = new HashMap();
  @@ -169,7 +171,15 @@
JDBCQueryMetaData q = (JDBCQueryMetaData)definedFinders.next();
   
if(!knownQueries.containsKey(q.getMethod()) ) {
  -if(q instanceof JDBCDeclaredQueryMetaData) {
  +if(q instanceof JDBCJBossQLQueryMetaData) {
  +   knownQueries.put(
  + q.getMethod(), factory.createJBossQLQuery(q));
  +  
  +} else if(q instanceof JDBCDynamicQLQueryMetaData) {
  +   knownQueries.put(
  + q.getMethod(), factory.createDynamicQLQuery(q));
  +  
  +} else if(q instanceof JDBCDeclaredQueryMetaData) {
  knownQueries.put(
q.getMethod(), factory.createDeclaredSQLQuery(q));
 
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCLoadRelationCommand.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:51:03

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCLoadRelationCommand.java
  Log:
  Minor changes due to changes in CMRFieldBridge interface.
  
  Revision  ChangesPath
  1.15  +7 -7  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCLoadRelationCommand.java
  
  Index: JDBCLoadRelationCommand.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCLoadRelationCommand.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JDBCLoadRelationCommand.java  16 Feb 2002 10:37:54 -  1.14
  +++ JDBCLoadRelationCommand.java  26 Feb 2002 23:51:03 -  1.15
  @@ -33,7 +33,7 @@
* Loads relations for a particular entity from a relation table.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
*/
   public class JDBCLoadRelationCommand {
  private final JDBCStoreManager manager;
  @@ -195,7 +195,7 @@
 List relatedKeyFields = getRelatedKeyFields(cmrField);
 List preloadFields = getPreloadFields(cmrField);
 String relationTable = getRelationTable(cmrField);
  -  String relatedTable = cmrField.getRelatedEntity().getTableName();
  +  String relatedTable = cmrField.getRelatedJDBCEntity().getTableName();
 
 // do we need to join the relation table and the related table
 boolean join = (preloadFields.size() > 0 && 
  @@ -246,7 +246,7 @@
whereClause.append(SQLUtil.getJoinClause(
 relatedKeyFields,
 relationTable,
  -  cmrField.getRelatedEntity().getPrimaryKeyFields(),
  +  cmrField.getRelatedJDBCEntity().getPrimaryKeyFields(),
 relatedTable));
whereClause.append(") AND (");
 }
  @@ -304,7 +304,7 @@
return cmrField.getRelatedCMRField().getTableKeyFields();
 } else if(cmrField.getRelatedCMRField().hasForeignKey()) {
// related has foreign key
  - return cmrField.getRelatedEntity().getPrimaryKeyFields();
  + return cmrField.getRelatedJDBCEntity().getPrimaryKeyFields();
 } else {
// i have foreign key
return cmrField.getForeignKeyFields();
  @@ -337,7 +337,7 @@
return cmrField.getRelationMetaData().getTableName();
 } else if(cmrField.getRelatedCMRField().hasForeignKey()) {
// related has foreign key
  - return cmrField.getRelatedEntity().getTableName();
  + return cmrField.getRelatedJDBCEntity().getTableName();
 } else {
// i have foreign key
return entity.getTableName();
  @@ -360,9 +360,9 @@
}
 } else if(cmrField.getRelatedCMRField().hasForeignKey()) {
// related has foreign key
  - if(cmrField.getRelatedEntity().getMetaData().hasRowLocking()) {
  + if(cmrField.getRelatedJDBCEntity().getMetaData().hasRowLocking()) {
   selectTemplate =
  -   
cmrField.getRelatedEntity().getMetaData().getTypeMapping().getRowLockingTemplate();
  +   
cmrField.getRelatedJDBCEntity().getMetaData().getTypeMapping().getRowLockingTemplate();
   if(selectTemplate == null) {
  throw new IllegalStateException("row-locking is not allowed " +
"for this type of datastore");
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCEJBQLCompiler.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:46:27

  Added:   src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCEJBQLCompiler.java
  Log:
  Compiles EJB-QL and JBossQl, which is a superset of EJB-QL, to SQL.
  
  Revision  ChangesPath
  1.1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java
  
  Index: JDBCEJBQLCompiler.java
  ===
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package org.jboss.ejb.plugins.cmp.jdbc;
  
  import java.io.StringReader;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
  
  import org.jboss.ejb.plugins.cmp.bridge.CMPFieldBridge;
  
  import org.jboss.ejb.plugins.cmp.ejbql.ASTAbs;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTAbstractSchema;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTAnd;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTApproximateNumericLiteral;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTArithmeticComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTArithmeticParenthetical;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTBetween;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTBooleanComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTBooleanLiteral;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTCollectionMemberDeclaration;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTConcat;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTConditionalParenthetical;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTDatetimeComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTEJBQL;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTEntityComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTExactNumericLiteral;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTFrom;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTIdentifier;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTIn;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTIsEmpty;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTLength;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTLike;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTLocate;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTMemberOf;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTMultDiv;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTNegation;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTNot;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTNullComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTOr;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTOrderBy;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTOrderByPath;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTParameter;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTPath;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTPlusMinus;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTRangeVariableDeclaration;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTSelect;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTSqrt;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTStringComparison;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTStringLiteral;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTStringParenthetical;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTSubstring;
  import org.jboss.ejb.plugins.cmp.ejbql.ASTWhere;
  import org.jboss.ejb.plugins.cmp.ejbql.SimpleNode;
  
  import org.jboss.ejb.plugins.cmp.ejbql.BasicVisitor;
  import org.jboss.ejb.plugins.cmp.ejbql.BlockStringBuffer;
  import org.jboss.ejb.plugins.cmp.ejbql.Catalog;
  import org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser;
  import org.jboss.ejb.plugins.cmp.ejbql.JBossQLParser;
  import org.jboss.ejb.plugins.cmp.ejbql.JBossQLParserVisitor;
  import org.jboss.ejb.plugins.cmp.ejbql.EJBQLTypes;
  import org.jboss.ejb.plugins.cmp.ejbql.Node;
  
  import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCFieldBridge;
  import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMPFieldBridge;
  import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge;
  import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCTypeMappingMetaData;
  
  /**
   * Compiles EJB-QL and JBossQL into SQL.
   *
   * @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
   * @version $Revision: 1.1 $
   */
  public class JDBCEJBQLCompiler extends BasicVisitor {
  
 // input objects
 private final Catalog catalog;
 private Class returnType;
 private Class[] parameterTypes;
 private JDBCReadAheadMetaData readAhead;
  
 // alias info
 private String aliasHeaderPrefix;
 private String aliasHeaderSuffix;
 private int aliasMaxLength;
 private int aliasCount;
 private Map aliases = new HashMap();
 private Map relationTableAliases = new

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCEJBQLQuery.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:47:10

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCEJBQLQuery.java
  Log:
  Changed to use new JDBCEJBQLCompiler based on JavaCC.
  
  Revision  ChangesPath
  1.6   +25 -37
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLQuery.java
  
  Index: JDBCEJBQLQuery.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLQuery.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JDBCEJBQLQuery.java   22 Feb 2002 04:24:55 -  1.5
  +++ JDBCEJBQLQuery.java   26 Feb 2002 23:47:10 -  1.6
  @@ -8,12 +8,7 @@
   package org.jboss.ejb.plugins.cmp.jdbc;
   
   import org.jboss.deployment.DeploymentException;
  -import org.jboss.ejb.plugins.cmp.ejbql.Assembly;
  -import org.jboss.ejb.plugins.cmp.ejbql.Parser;
  -import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMPFieldBridge;
  -import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge;
  -import org.jboss.ejb.plugins.cmp.jdbc.ejbql.EJBQLParser;
  -import org.jboss.ejb.plugins.cmp.jdbc.ejbql.SQLTarget;
  +import org.jboss.ejb.plugins.cmp.ejbql.Catalog;
   import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQlQueryMetaData;
   import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaData;
   
  @@ -21,7 +16,7 @@
* This class generates a query from EJB-QL.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
*/
   public class JDBCEJBQLQuery extends JDBCAbstractQueryCommand {
   
  @@ -32,44 +27,37 @@
 super(manager, q);
   
 JDBCQlQueryMetaData metadata = (JDBCQlQueryMetaData)q;
  -  getLog().debug("EQL-QL: "+metadata.getEjbQl());
  -  
  -  // get a parser
  -  Parser ejbql = new EJBQLParser().ejbqlQuery();
  -  
  -  // initialize the assembly
  -  Assembly a = new Assembly(metadata.getEjbQl());
  -  a.setTarget(new SQLTarget(
  -q.getMethod(),
  -manager.getJDBCTypeFactory(),
  -manager.getContainer().getEjbModule(),
  -q.getReadAhead()));
  -  
  -  // match the query
  -  a = ejbql.soleMatch(a);
  -  if(a == null) {
  - throw new DeploymentException("Unable to parse EJB-QL: " +
  -   metadata.getEjbQl());
  +  if(getLog().isDebugEnabled()) {
  + getLog().debug("EJB-QL: " + metadata.getEjbQl());
 }
 
  -  // get the final target
  -  SQLTarget target = (SQLTarget)a.getTarget();
  +  JDBCEJBQLCompiler compiler = new JDBCEJBQLCompiler(
  +(Catalog)manager.getApplicationData("CATALOG"));
  +
  +  try {
  + compiler.compileEJBQL(
  +   metadata.getEjbQl(),
  +   metadata.getMethod().getReturnType(),
  +   metadata.getMethod().getParameterTypes(),
  +   metadata.getReadAhead());
  +  } catch(Throwable t) {
  + throw new DeploymentException("Error compiling ejbql", t);
  +  }
 
 // set the sql
  -  setSQL(target.toSQL());
  +  if(getLog().isDebugEnabled()) {
  + getLog().debug("SQL:\r\n" + compiler.getSQL());
  +  }
  +  setSQL(compiler.getSQL());
 
  -  // select bridge object
  -  Object selectBridgeObject = target.getSelectObject();
  -  if(selectBridgeObject instanceof JDBCEntityBridge) {
  - setSelectEntity((JDBCEntityBridge)selectBridgeObject);
  -  } else if(selectBridgeObject instanceof JDBCCMPFieldBridge) {
  - setSelectField((JDBCCMPFieldBridge)selectBridgeObject);
  +  // set select object
  +  if(compiler.isSelectEntity()) {
  + setSelectEntity(compiler.getSelectEntity());
 } else {
  - throw new IllegalStateException("Select bridge object is instance " +
  -   "of unknown type: selectBridgeObject=" + selectBridgeObject);
  + setSelectField(compiler.getSelectField());
 }
  -  
  +
 // get the parameter order
  -  setParameterList(target.getInputParameters());
  +  setParameterList(compiler.getInputParameters());
  }
   }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCJBossQLQuery.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:48:58

  Added:   src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCJBossQLQuery.java
  Log:
  Initial revision of JBossQL query command.  JBossQL is a superset of EJB-QL
  that in this intial revison adds support for ORDER BY.
  
  Revision  ChangesPath
  1.1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCJBossQLQuery.java
  
  Index: JDBCJBossQLQuery.java
  ===
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package org.jboss.ejb.plugins.cmp.jdbc;
  
  import org.jboss.deployment.DeploymentException;
  import org.jboss.ejb.plugins.cmp.ejbql.Catalog;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCJBossQLQueryMetaData;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaData;
  
  /**
   * This class generates a query from JBoss-QL.
   *
   * @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
   * @version $Revision: 1.1 $
   */
  public class JDBCJBossQLQuery extends JDBCAbstractQueryCommand {
  
 public JDBCJBossQLQuery(
   JDBCStoreManager manager, 
   JDBCQueryMetaData q) throws DeploymentException {
  
super(manager, q);
  
JDBCJBossQLQueryMetaData metadata = (JDBCJBossQLQueryMetaData)q;
if(getLog().isDebugEnabled()) {
   getLog().debug("EJB-QL: " + metadata.getJBossQL());
}

JDBCEJBQLCompiler compiler = new JDBCEJBQLCompiler(
  (Catalog)manager.getApplicationData("CATALOG"));
  
try {
   compiler.compileJBossQL(
 metadata.getJBossQL(),
 metadata.getMethod().getReturnType(),
 metadata.getMethod().getParameterTypes(),
 metadata.getReadAhead());
} catch(Throwable t) {
   throw new DeploymentException("Error compiling ejbql", t);
}

// set the sql
if(getLog().isDebugEnabled()) {
   getLog().debug("SQL:\r\n" + compiler.getSQL());
}
setSQL(compiler.getSQL());

// set select object
if(compiler.isSelectEntity()) {
   setSelectEntity(compiler.getSelectEntity());
} else {
   setSelectField(compiler.getSelectField());
}
  
// get the parameter order
setParameterList(compiler.getInputParameters());
 }
  }
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCDynamicQLQuery.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:45:32

  Added:   src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCDynamicQLQuery.java
  Log:
  Initial revision of DynamicQl command which compiles and executes JBossQL
  at runtime.
  
  Revision  ChangesPath
  1.1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCDynamicQLQuery.java
  
  Index: JDBCDynamicQLQuery.java
  ===
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package org.jboss.ejb.plugins.cmp.jdbc;
  
  import java.lang.reflect.Method;
  import java.util.Collection;
  import javax.ejb.FinderException;
  import org.jboss.deployment.DeploymentException;
  import org.jboss.ejb.EntityEnterpriseContext;
  import org.jboss.ejb.plugins.cmp.ejbql.Catalog;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaData;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCDynamicQLQueryMetaData;
  import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData;
  
  /**
   * This class generates a query from JBoss-QL.
   *
   * @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
   * @version $Revision: 1.1 $
   */
  public class JDBCDynamicQLQuery extends JDBCAbstractQueryCommand {
 private final Catalog catalog;
 private JDBCDynamicQLQueryMetaData metadata;
  
 public JDBCDynamicQLQuery(
   JDBCStoreManager manager, 
   JDBCQueryMetaData q) throws DeploymentException {
  
super(manager, q);
catalog = (Catalog)manager.getApplicationData("CATALOG");
metadata = (JDBCDynamicQLQueryMetaData)q;
 }
  
 public Collection execute(
   Method finderMethod,
   Object[] args,
   EntityEnterpriseContext ctx) throws FinderException {
  
String dynamicQL = (String)args[0];
if(getLog().isDebugEnabled()) {
   getLog().debug("DYNAMIC-QL: " + dynamicQL);
}

JDBCEJBQLCompiler compiler = new JDBCEJBQLCompiler(catalog);
  
// get the parameters
Object[] parameters = (Object[])args[1];
if(parameters == null) {
   throw new FinderException("Parameters is null");
}
  
// get the parameter types
Class[] parameterTypes = new Class[parameters.length];
for(int i=0; ihttps://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc JDBCCommandFactory.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:31:43

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc
JDBCCommandFactory.java
  Log:
  Added new JBossQL and DynamicQL command factory methods.
  
  Revision  ChangesPath
  1.15  +11 -1 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCCommandFactory.java
  
  Index: JDBCCommandFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCCommandFactory.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JDBCCommandFactory.java   15 Jan 2002 21:48:45 -  1.14
  +++ JDBCCommandFactory.java   26 Feb 2002 23:31:43 -  1.15
  @@ -17,7 +17,7 @@
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
* @author mailto:[EMAIL PROTECTED]";>Justin Forder
* @author danch (Dan Christopherson
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
*/
   public class JDBCCommandFactory {
  private JDBCStoreManager manager;
  @@ -42,6 +42,16 @@
  public JDBCQueryCommand createEJBQLQuery(JDBCQueryMetaData q) 
throws DeploymentException {
 return new JDBCEJBQLQuery(manager, q);
  +   }
  +
  +   public JDBCQueryCommand createDynamicQLQuery(JDBCQueryMetaData q) 
  + throws DeploymentException {
  +  return new JDBCDynamicQLQuery(manager, q);
  +   }
  +
  +   public JDBCQueryCommand createJBossQLQuery(JDBCQueryMetaData q) 
  + throws DeploymentException {
  +  return new JDBCJBossQLQuery(manager, q);
  }
   
  public JDBCQueryCommand createFindByQuery(JDBCQueryMetaData q)
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge JDBCAbstractCMPFieldBridge.java JDBCCMPFieldBridge.java JDBCCMRFieldBridge.java JDBCEntityBridge.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:28:56

  Modified:src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
JDBCAbstractCMPFieldBridge.java
JDBCCMPFieldBridge.java JDBCCMRFieldBridge.java
JDBCEntityBridge.java
  Log:
  Added new methods and interfaces requires by the generic bridge package
  for the new EJB-QL parser.
  
  Moved extraneous log messages to trace level.
  
  Wrapped log messages with isEnabled checks.
  
  Revision  ChangesPath
  1.12  +5 -1  
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCAbstractCMPFieldBridge.java
  
  Index: JDBCAbstractCMPFieldBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCAbstractCMPFieldBridge.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JDBCAbstractCMPFieldBridge.java   12 Feb 2002 22:35:12 -  1.11
  +++ JDBCAbstractCMPFieldBridge.java   26 Feb 2002 23:28:55 -  1.12
  @@ -40,7 +40,7 @@
*  One for each entity bean cmp field.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
*/
   public abstract class JDBCAbstractCMPFieldBridge implements JDBCCMPFieldBridge {
  protected JDBCStoreManager manager;
  @@ -75,6 +75,10 @@
   
  public JDBCCMPFieldMetaData getMetaData() {
 return metadata;
  +   }
  +
  +   public JDBCStoreManager getManager() {
  +  return manager;
  }
   
  public String getFieldName() {
  
  
  
  1.10  +10 -5 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMPFieldBridge.java
  
  Index: JDBCCMPFieldBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMPFieldBridge.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JDBCCMPFieldBridge.java   15 Jan 2002 20:50:30 -  1.9
  +++ JDBCCMPFieldBridge.java   26 Feb 2002 23:28:55 -  1.10
  @@ -12,9 +12,10 @@
   import java.sql.ResultSet;
   
   import org.jboss.ejb.EntityEnterpriseContext;
  -import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCCMPFieldMetaData;
  +import org.jboss.ejb.plugins.cmp.bridge.CMPFieldBridge;
  +import org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager;
   import org.jboss.ejb.plugins.cmp.jdbc.JDBCType;
  -
  +import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCCMPFieldMetaData;
   
   /**
* JDBCCMPFieldBridge represents one CMP field. This implementations of 
  @@ -29,10 +30,9 @@
*  One for each entity bean cmp field.
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
*/
  -public interface JDBCCMPFieldBridge 
  -  extends JDBCFieldBridge {
  +public interface JDBCCMPFieldBridge extends JDBCFieldBridge, CMPFieldBridge {
   
  /**
   * Gets the java class type of the field.
  @@ -44,6 +44,11 @@
   * Get metadata for the field.
   */
  public JDBCCMPFieldMetaData getMetaData();
  +
  +   /**
  +* Gets the JDBCStoreManager for this field
  +*/
  +   public JDBCStoreManager getManager();
   
  /**
   * Gets the value of this field in the specified primaryKey object.
  
  
  
  1.25  +16 -7 
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java
  
  Index: JDBCCMRFieldBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JDBCCMRFieldBridge.java   22 Feb 2002 04:24:55 -  1.24
  +++ JDBCCMRFieldBridge.java   26 Feb 2002 23:28:55 -  1.25
  @@ -31,6 +31,8 @@
   import org.jboss.invocation.Invocation;
   import org.jboss.ejb.plugins.CMPPersistenceManager;
   import org.jboss.ejb.plugins.EntityInstanceCache;
  +import org.jboss.ejb.plugins.cmp.bridge.EntityBridge;
  +import org.jboss.ejb.plugins.cmp.bridge.CMRFieldBridge;
   import org.jboss.ejb.plugins.cmp.jdbc.JDBCContext;
   import org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager;
   import org.jboss.ejb.plugins.cmp.jdbc.JDBCType;
  @@ -53,9 +55,9 @@
*  One for each role that entity has.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.24 $
  + * @version $Revision: 1.25 $
*/
  -public class JDBCCMRFieldBridge implements JDBCFieldBridge {
  +public class JDBCCMRFieldBridge implements JDBCFieldBridge, CMRFieldBridge {
  // -- Invocation messages --
  
  /** tells the related continer to retrieve the id of the related entit

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/bridge CMPFieldBridge.java CMRFieldBridge.java EntityBridge.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:25:47

  Modified:src/main/org/jboss/ejb/plugins/cmp/bridge EntityBridge.java
  Added:   src/main/org/jboss/ejb/plugins/cmp/bridge
CMPFieldBridge.java CMRFieldBridge.java
  Log:
  Minor changes for generic EJB-QL parsing.
  
  Revision  ChangesPath
  1.6   +4 -1  
jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridge.java
  
  Index: EntityBridge.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridge.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EntityBridge.java 15 Jan 2002 20:40:15 -  1.5
  +++ EntityBridge.java 26 Feb 2002 23:25:47 -  1.6
  @@ -24,11 +24,14 @@
*  One per cmp entity bean type.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
*/
   public interface EntityBridge {
  public String getEntityName();
  +   public String getAbstractSchemaName();
  
  public List getFields();
  +   public FieldBridge getFieldByName(String fieldName);
  +
  public Collection getSelectors();
   }
  
  
  
  1.8   +1 -94 
jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/CMPFieldBridge.java
  
  
  
  
  1.7   +4 -48 
jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/CMRFieldBridge.java
  
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/bridge EntityBridgeInvocationHandler.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:24:53

  Modified:src/main/org/jboss/ejb/plugins/cmp/bridge
EntityBridgeInvocationHandler.java
  Log:
  Cleaned up exception handling.
  
  Revision  ChangesPath
  1.14  +52 -37
jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java
  
  Index: EntityBridgeInvocationHandler.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- EntityBridgeInvocationHandler.java12 Feb 2002 22:35:11 -  1.13
  +++ EntityBridgeInvocationHandler.java26 Feb 2002 23:24:53 -  1.14
  @@ -37,7 +37,7 @@
*  One per cmp entity bean instance, including beans in pool.   
*
* @author mailto:[EMAIL PROTECTED]";>Dain Sundstrom
  - * @version $Revision: 1.13 $
  + * @version $Revision: 1.14 $
*/
   public class EntityBridgeInvocationHandler implements InvocationHandler {
  private final EntityContainer container;
  @@ -57,7 +57,7 @@
  public EntityBridgeInvocationHandler(
EntityContainer container,
EntityBridge entityBridge,
  - Class beanClass) throws Exception {
  + Class beanClass) throws DeploymentException {
   
 this.container = container;
 this.entityBridge = entityBridge;
  @@ -74,47 +74,62 @@
 this.ctx = ctx;
  }
  
  -   public Object invoke(Object proxy, Method method, Object[] args)
  - throws Throwable {
  +   public Object invoke(Object proxy, Method method, Object[] args) 
  + throws FinderException {
   
 String methodName = method.getName();
  -
  -  SelectorBridge selector = (SelectorBridge) selectorMap.get(method);
  -  if(selector != null) {
  - Transaction tx;
  - if(ctx != null) {
  -// it is probably safer to get the tx from the context if we have
  -// one (ejbHome methods don't have a context)
  -tx = ctx.getTransaction();
  - } else {
  -tx = container.getTransactionManager().getTransaction();
  +   
  +  try {
  + SelectorBridge selector = (SelectorBridge) selectorMap.get(method);
  + if(selector != null) {
  +Transaction tx;
  +if(ctx != null) {
  +   // it is probably safer to get the tx from the context if we have
  +   // one (ejbHome methods don't have a context)
  +   tx = ctx.getTransaction();
  +} else {
  +   tx = container.getTransactionManager().getTransaction();
  +}
  +EntityContainer.synchronizeEntitiesWithinTransaction(tx);
  +return selector.execute(args);
}
  - EntityContainer.synchronizeEntitiesWithinTransaction(tx);
  - return selector.execute(args);
  +  } catch(RuntimeException e) {
  + throw e;
  +  } catch(FinderException e) {
  + throw e;
  +  } catch(Exception e) {
  + throw new EJBException("Internal error", e);
 }
  -
  -  // get the field object
  -  FieldBridge field = (FieldBridge) fieldMap.get(method);
  -
  -  if(field == null) { 
  - throw new EJBException("Method is not a known CMP field accessor, " +
  -   "CMR field accessor, or ejbSelect method: " +
  -   "methodName=" + methodName);
  -  }
  -
  -  // In the case of ejbHome methods there is no context, but ejb home
  -  // methods are only allowed to call selectors.
  -  if(ctx == null) {
  - throw new EJBException("EJB home methods are not allowed to access " +
  -   "CMP or CMR fields: methodName=" + methodName);
  +   
  +  try {
  + // get the field object
  + FieldBridge field = (FieldBridge) fieldMap.get(method);
  +   
  + if(field == null) { 
  +throw new EJBException("Method is not a known CMP field " +
  +  "accessor, CMR field accessor, or ejbSelect method: " +
  +  "methodName=" + methodName);
  + }
  +   
  + // In the case of ejbHome methods there is no context, but ejb home
  + // methods are only allowed to call selectors.
  + if(ctx == null) {
  +throw new EJBException("EJB home methods are not allowed to " +
  +  "access CMP or CMR fields: methodName=" + methodName);
  + }
  +   
  + if(methodName.startsWith("get")) {
  +return field.getValue(ctx);
  + } else if(methodName.startsWith("set")) {
  +field.setVal

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/ejbql AbstractSchema.java CMPField.java CMRField.java EJBQLParser.java EntityPathElement.java IdentifierManager.java PathElement.java SQLGenerator.java SQLTarget.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:15:19

  Removed: src/main/org/jboss/ejb/plugins/cmp/jdbc/ejbql
AbstractSchema.java CMPField.java CMRField.java
EJBQLParser.java EntityPathElement.java
IdentifierManager.java PathElement.java
SQLGenerator.java SQLTarget.java
  Log:
  Replaced with new JavaCC based EJB-QL compiler.

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/cmp/ejbql Alternation.java ApproximateNumericToken.java Assembler.java Assembly.java AssemblySet.java DeepCloneable.java Empty.java ExactNumericToken.java InputParameter.java InputParameterState.java InputParameterToken.java Literal.java NumberState.java NumericLiteral.java Optional.java Parser.java QuoteState.java Repetition.java Sequence.java StringLiteral.java StringToken.java Symbol.java SymbolState.java SymbolToken.java Terminal.java Token.java Tokenizer.java TokenizerState.java WhitespaceState.java Word.java WordState.java WordToken.java

2002-02-26 Thread Dain Sundstrom

  User: dsundstrom
  Date: 02/02/26 15:15:18

  Removed: src/main/org/jboss/ejb/plugins/cmp/ejbql Alternation.java
ApproximateNumericToken.java Assembler.java
Assembly.java AssemblySet.java DeepCloneable.java
Empty.java ExactNumericToken.java
InputParameter.java InputParameterState.java
InputParameterToken.java Literal.java
NumberState.java NumericLiteral.java Optional.java
Parser.java QuoteState.java Repetition.java
Sequence.java StringLiteral.java StringToken.java
Symbol.java SymbolState.java SymbolToken.java
Terminal.java Token.java Tokenizer.java
TokenizerState.java WhitespaceState.java Word.java
WordState.java WordToken.java
  Log:
  Replaced with new JavaCC based EJB-QL compiler.

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Auto-resolving dependencies/deployment

2002-02-26 Thread Dain Sundstrom

Cool idea to solve the class loading dependency, but I think we still 
need explicit dependency declarations.  The problem I still see is the 
need to have some services started (i.e. initialized) before others 
(e.g. db driver setup before a ejb can deploy).

Oh, I just thought of another problem.  In my code, I try to load the 
classes that are specified in the deployment descriptor.  What happens 
if the user makes a typo and I try to load something like 
java.lang.OObject.  Will deployment hang forever?

-dain

marc fleury wrote:

> |I don't think this is a problem. The client is most likely a thread started
> |by noticing a new package.  Anyway, I think we need anyway a list of
> |"waiting deployments" -- partly deployed stuff that is waiting.  Now we
> 
> Yes, I am afraid of the verbosity of it.
> 
> |have mbeans that can be waiting for mbeans, with marc's idea we'd have
> |classes waiting for classes also.  If we can look at the list and say "
> 
> not classes, deploymentInfo level (meaning anything entering the system).
> This is deployments waiting on deployments (through classes waiting on
> classes). Then mapping to the MBean is done as well.  We will collect the
> dependency at the class level.
> 
> |there's a problem, kill this guy" or "hmmm, I see I forgot to deploy
> |package X" I think it will be fine without any timeouts.
> 
> well the time out is OK, no big deal.  The only issue is do you want to drop
> a package and then another and they are picked in different cycles and it
> still works, but if you FORGET to drop the package, I would want to say
> "CLASS NOT FOUND" so you know you forgot, hence the timeout being useful
> (imho).  Small point.
> 
> marcf
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Tshirts at JavaOne FREE TRAINING

2002-02-25 Thread Dain Sundstrom

> JBoss:
> All your J2EE are belong to us


Maybe I'm an idiot, but what the hell does this mean?

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc JDBCInitCommand.java

2002-02-25 Thread Dain Sundstrom

How is it you managed to change every line of these files?  Is something 
wrong in your IDE, or was the file hosed to begin with (and you fixed it)?

-dain

Dan Christopherson wrote:

>   User: danch   
>   Date: 02/02/25 09:18:20
> 
>   Modified:src/main/org/jboss/ejb/plugins/jaws/jdbc Tag: Branch_2_4
> JDBCInitCommand.java
>   Log:
>   made 'table not created' message error rather than debug
>   
>   Revision  ChangesPath
>   No   revision
>   
>   
>   No   revision
>   
>   
>   1.12.6.6  +182 -172  
>jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCInitCommand.java
>   



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment DeploymentInfo.java

2002-02-24 Thread Dain Sundstrom

JSX looks like the small fish in the sea anyway.  I think we should use 
JaxB, as it will eventually dominate this field.  Assuming you can get 
it to work.

-dain

David Jencks wrote:

> On 2002.02.24 22:05:19 -0500 Adam Heath wrote:
> 
>>On Sun, 24 Feb 2002, David Jencks wrote:
>>
>>
>>>[snip]
>>>
>>JSX seems to work well for us here at work.  Might want to check it out.
>>
> 
> Looks interesting, however I can't see how we could possibly use it: gpl or
> $$ licensing.
> 
> david jencks
> 
>>
>>___
>>Jboss-development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
>>
>>
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Loading array class object by name

2002-02-24 Thread Dain Sundstrom

Thanks Scott.  I thought I tried that one...

Now do you know an easy way to convert java.lang.object[] or whatever to 
the signature style [Ljava.lang.Object; (other then string 
manipulation)?  Otherwise, I'll write a conversion function.

-dain

Scott M Stark wrote:

> The syntax for obtaining array classes using Class.forName is
> rather wacked, but it does work. For example, to get the
> class for an Object[], use
> 
> Class oaClass = Class.forName("[Ljava.lang.Object;");
> 
> Both the "[L" prefix and trailing ";" are required.
> The javadoc for the Class.getName method describe the syntax
> required.
> 
> 
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> 
> 
>>No new feature.  Class.forName docs say you can load arrays but it is
>>broken.  Here is the code I use now:
>>
>>private Class convertToJavaClass(String name) throws DeploymentException {
>>// Check primitive first
>>for (int i = 0; i < PRIMITIVES.length; i++) {
>>   if(name.equals(PRIMITIVES[i])) {
>>  return PRIMITIVE_CLASSES[i];
>>   }
>>}
>>
>>int arraySize = 0;
>>while(name.endsWith("[]")) {
>>   name = name.substring(0, name.length()-2);
>>   arraySize++;
>>}
>>
>>try {
>>   // get the base class
>>   Class c = entity.getClassLoader().loadClass(name);
>>
>>   // if we have an array get the array class
>>   if(arraySize > 0) {
>>  int[] dimensions = new int[arraySize];
>>  for(int i=0; i> dimensions[i]=1;
>>  }
>>  c = Array.newInstance(c, dimensions).getClass();
>>   }
>>
>>   return c;
>>} catch(ClassNotFoundException e) {
>>   throw new DeploymentException("Parameter class not found: " +
>> name);
>>}
>>}
>>
>>This is lame but works.
>>
>>-dain
>>
>>
> 
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Loading array class object by name

2002-02-24 Thread Dain Sundstrom

Doesn't work.  I tried [Ljava/lang/Object; and both without the semicolon.

-dain

Jason Dillon wrote:

> Try loading "[Ljava.lang.Object;" instead... which is the class name 
> returned from Object[].class.getName();
> 
> --jason
> 
> 
> Dain Sundstrom wrote:
> 
>>
>>
>> Jason Dillon wrote:
>>
>>> What is the value for name you are using?
>>
>>
>>
>>
>> In my test code "java.lang.Object[]"
>>
>>
>>> Why not just use Class.class?
>>
>>
>>
>>
>> Because I am trying to load a parameter type from an xml file that
>>
>> just has the string name of the type.
>>
>>
>>
>>> Or if you really want to use Class.forName to load Class, then you 
>>> should be able to use the system class loader.
>>
>>
>>
>>>
>>> Is this after yesterdays Server/ServerLoader change?
>>
>>
>>
>>
>> No new feature.  Class.forName docs say you can load arrays but it is 
>> broken.  Here is the code I use now:
>>
>> private Class convertToJavaClass(String name) throws 
>> DeploymentException {
>>// Check primitive first
>>for (int i = 0; i < PRIMITIVES.length; i++) {
>>   if(name.equals(PRIMITIVES[i])) {
>>  return PRIMITIVE_CLASSES[i];
>>   }
>>}
>>
>>int arraySize = 0;
>>while(name.endsWith("[]")) {
>>   name = name.substring(0, name.length()-2);
>>   arraySize++;
>>}
>>
>>try {
>>   // get the base class
>>   Class c = entity.getClassLoader().loadClass(name);
>>
>>   // if we have an array get the array class
>>   if(arraySize > 0) {
>>  int[] dimensions = new int[arraySize];
>>  for(int i=0; i> dimensions[i]=1;
>>  }
>>  c = Array.newInstance(c, dimensions).getClass();
>>   }
>>
>>   return c;
>>} catch(ClassNotFoundException e) {
>>   throw new DeploymentException("Parameter class not found: " +
>> name);
>>}
>> }
>>
>> This is lame but works.
>>
>> -dain
> 
> 
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Loading array class object by name

2002-02-24 Thread Dain Sundstrom



Jason Dillon wrote:

> What is the value for name you are using?


In my test code "java.lang.Object[]"

 
> Why not just use Class.class?


Because I am trying to load a parameter type from an xml file that

just has the string name of the type.



> Or if you really want to use Class.forName to load Class, then you 
> should be able to use the system class loader.

>
> Is this after yesterdays Server/ServerLoader change?


No new feature.  Class.forName docs say you can load arrays but it is 
broken.  Here is the code I use now:

private Class convertToJavaClass(String name) throws DeploymentException {
// Check primitive first
for (int i = 0; i < PRIMITIVES.length; i++) {
   if(name.equals(PRIMITIVES[i])) {
  return PRIMITIVE_CLASSES[i];
   }
}

int arraySize = 0;
while(name.endsWith("[]")) {
   name = name.substring(0, name.length()-2);
   arraySize++;
}

try {
   // get the base class
   Class c = entity.getClassLoader().loadClass(name);

   // if we have an array get the array class
   if(arraySize > 0) {
  int[] dimensions = new int[arraySize];
  for(int i=0; ihttps://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] Loading array class object by name

2002-02-24 Thread Dain Sundstrom

Hi all,

I need to load the java.lang.Class object for an array by name.  I have 
tried the following:

Class.forName(name, true, entity.getClassLoader());

Where name is "java.lang.Object[]", and I get a ClassNotFoundException.

Any ideas?

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Buildmagic verbosity

2002-02-24 Thread Dain Sundstrom

Jason,

Can you get merge these steps with the script task?  So instead of 
calling sub ant files, you dynamically load a script, which basically 
does the same thing, and run it.

-dain


marc fleury wrote:

> OK,
> 
> 90 of what buildmagic says on the console is useless.
> 
> Can we get rid of
> 
> _buildmagic:init:
> _buildmagic:init:child:
> _buildmagic:init:buildlog:
> 
> configure:
> _buildmagic:init:show-environment:
> 
> init:
> 
> etc etc
> 
> GET RID OF THE STUFF WE DON'T NEED.  I also suspect that these calls
> correspond to steps we never use since we never use the "n-th degree
> configurability" of buildmagic. Complex.
> 
> Build magic is good at compiling many targets, and that is ALL IT SHOULD DO.
> Kill the rest.
> 
> Jason are you listening? Are you listening to the frustration of every
> developer? me first when it comes to reading these files?  It seems they
> don't do ***anything useful***, so PLEASE PLEASE PLEASE remove all the stuff
> we don't need or don't use AT EVERY RUN.
> 
> Ok? It is time to get rid of the sillyness.
> 
> Buildmagic should build the stuff, all the modules and basta, fuck all the
> logging configurability .
> 
> marcf
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] JBoss javadoc & links to java.lang

2002-02-22 Thread Dain Sundstrom

Here is an example:




   http://java.sun.com/products/jdk/1.3/docs/api/"/>



Jason Dillon wrote:

> Does anyone know the correct way to make javadoc generate links to an 
> external javadoc site?  I have seen this before... but have been to lazy 
> to figure it out.  Can anyone explain this to me so I can remain lazy?
> 
> --jason
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Set on abstract to generate isModified

2002-02-22 Thread Dain Sundstrom

David Jencks wrote:

> Dain
> --just to be really clear--
> 
> The fix I did for "quadratic algorithm"  puts beans in a list to have
> ejbStore called if:
> 
> they have a method called on them after the last find, create, or store
> -and-
> ctxContainer.getPersistenceManager().isModified(ctx) returns true.
> 
> Is this accurate for cmp2 beans? As I understood your code it was, but I
> would like to double check.


Yes.  Changes to relationships are sent through the interceptor stack so 
they look like method calls, and the isModified method in the 
persistence manager for cmp2 always returns true.  In the end it all 
works fine.

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Set on abstract to generate isModified

2002-02-22 Thread Dain Sundstrom

James Manning wrote:

> [marc fleury]
> 
>>At the aussie training (god I am still so jet-lagged from this :( the guys
>>wanted to know if CMP 2.0 in JBoss did the automated generation of
>>isModified() on set operations.
>>
>>i assume yes but just wanted to make sure.
>>
> 
> Does it check to make sure the value has actually changed?  May not be
> useful enough in the common case, but if a setter "modifies" a value to
> the same value it already had, it'd be a nice touch if that didn't trip
> modified and cause JDBC actions *shrug*
> 

yes.

-dain


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Set on abstract to generate isModified

2002-02-22 Thread Dain Sundstrom

I completely disagree with you assessment that is is a big performance 
hit.

In the persistence engine I know exactly which cmp fields have been 
changed and if any relationships have been changed.  This inModified 
stuff is originally designed to eliminate unnecessary calls to ejbStore 
because it was so expensive (especially before tuned updates).  With the 
new engine, all you avoid is a single call through the interceptor stack 
(~0.06 ms), and you give up on having a reliable ejbStore life cycle 
event.

The simple isModified implementation in jaws breaks the relationships 
because a bean can be involved in a blind relationship where it does not 
have an relationship accessor.  Therefore the bean provider has no way 
of knowing if the relationship has been modified.  There is also the 
problem of relationship collection methods.

Is modified method is just bad news for relationships, and is an attempt 
to solve problems we don't have in EJB 2.0.

-dain

P.S. marc, is the clock on your computer off by two hours or is the time 
zone set wrong, because your messages always show up a time stamp two 
hours in the future.

marc fleury wrote:

> This strikes as a biggy for performance.
> 
> Would you mind explaining the "breaking" of dependency you observed... can
> we power our way through this? again I think this is a biggy in perf but I
> am largely ignorant of the way it is supposed to work.
> 
> marcf
> 
> |-Original Message-
> |From: Dain Sundstrom [mailto:[EMAIL PROTECTED]]
> |Sent: Friday, February 22, 2002 1:46 PM
> |To: marc fleury
> |Cc: Jboss-Development@Lists. Sourceforge. Net
> |Subject: Re: [JBoss-dev] Set on abstract to generate isModified
> |
> |
> |I don't really generate anything other then the simple DP.  I have has
> |automatic isModified from the beginning.  I have also removed all
> |support for isModified in the CMP 2.0 code as it breaks relationship code.
> |
> |The current implementation could be better, but this is a very low
> |priority.
> |
> |-dain
> |
> |marc fleury wrote:
> |
> |> At the aussie training (god I am still so jet-lagged from this
> |:( the guys
> |> wanted to know if CMP 2.0 in JBoss did the automated generation of
> |> isModified() on set operations.
> |>
> |> i assume yes but just wanted to make sure.
> |>
> |> marcf
> |>
> |>
> |> ___
> |> Jboss-development mailing list
> |> [EMAIL PROTECTED]
> |> https://lists.sourceforge.net/lists/listinfo/jboss-development
> |>
> |
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Set on abstract to generate isModified

2002-02-22 Thread Dain Sundstrom

I don't really generate anything other then the simple DP.  I have has 
automatic isModified from the beginning.  I have also removed all 
support for isModified in the CMP 2.0 code as it breaks relationship code.

The current implementation could be better, but this is a very low priority.

-dain

marc fleury wrote:

> At the aussie training (god I am still so jet-lagged from this :( the guys
> wanted to know if CMP 2.0 in JBoss did the automated generation of
> isModified() on set operations.
> 
> i assume yes but just wanted to make sure.
> 
> marcf
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Configuration layout changes...

2002-02-22 Thread Dain Sundstrom

> castor.jar - ???


Should be in castor.sar


> mail-plugin.jar - can be dropped or replaced by another javax.mail.Session


Should be mail.sar


> hsqldb-plugin.jar - replacable by another DB


Should be in hsqldb.sar (db plus driver)


-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Bug?: no rollback on tx timeout

2002-02-21 Thread Dain Sundstrom

> I'm no threading expert, but I can't find any way of communicating with 

> the hung thread to force it to return.


thread.interrupt() works in most cases.  It causes the thread to throw 
an InterruptedException.

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Custom / Generated Finders non-spec compliant

2002-02-21 Thread Dain Sundstrom

JBoss auto generated queries are outside of the spec.  JBoss uses the 
findBy start to signal the system that it should attempt to auto 
generate a simple single field finder.  I think that BMP custom finders 
in CMP is also non-spec, but jaws should support findX named queries. 
JBossCMP already supports custom finders starting with just find.

-dain

Christian Riege wrote:

> Hi,
> 
> combing through the JBoss SF Bug database I found the following in the
> patches section:
> 
> 
>http://sourceforge.net/tracker/index.php?func=detail&aid=437043&group_id=22866&atid=376687
> 
> Whoever submitted this is actually correct; the EJB Spec (1.1 and 2.0)
> state that Finder methods should be prefixed by "find" (i.e.
> find). The spec doesn't require "findBy" except for the
> findByPrimaryKey method of course.
> 
> The suggested "patch" would fix the problem but this is only half of the
> story (it will only deal with custom finders declared in the home
> interface): all of JBoss's auto-generated finder methods for CMP EB's
> are also prefixed by "findBy" which doesn't seem valid according to the
> specs; i.e. if you have a CMP field "String name;" the generated finder
> method should read
> 
>   Collection findName(String parameter);
> 
> but JBoss generates
> 
>   Collection findByName(String parameter);
> 
> I haven't seen anybody complaining about this (the "findBy" prefix is
> more intuitive anyways IMO) but this should be fixed. The fix seems easy
> enough and I would be willing to take it but this could break a lot of
> apps out there that rely on the method being prefixed with "findBy" ...
> 
> Any opinions on this? We could just generate the spec-compliant methods
> AND the findBy stuff but this seems a bit awkward ...
> 
> Best regards,
>   Christian
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] JBossOne T-Shirts...

2002-02-15 Thread Dain Sundstrom

I agree, I definitely put my full support behind this one.

Bill Burke wrote:

> I still vote for the Ghandi quote.
> 
> first they ignore you
>   then they laugh at you
>   then they fight you
> Then you win.
> 
> Or something like that.
> 
> 
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED]]On Behalf Of Dain
>>Sundstrom
>>Sent: Friday, February 15, 2002 2:18 PM
>>Cc: [EMAIL PROTECTED]
>>Subject: [JBoss-dev] JBossOne T-Shirts...
>>
>>
>>The slogan from me that Marc posted was supposed to be two different
>>sayings, as follows:
>>
>>JBoss
>>Because nothing is worth $10,000/cpu.
>>
>>JBoss
>>DIE BEA! DIE! DIE! DIE!
>>(props to alt.wesley.crusher.die.die.die)
>>
>>I don't necessarily like the latter anymore.  Makes us look like the
>>underdog and this poor rhetoric.  This makes us look weak; it is much
>>better to paint us as all powerful.  Along those lines my new sayings are:
>>
>>JBoss
>>You know who's boss.
>>(this one from my mom)
>>
>>JBoss
>>We have already won.
>>
>>
>>Peace-out,
>>
>>-dain
>>
>>
>>
>>___
>>Jboss-development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] JBossOne T-Shirts...

2002-02-15 Thread Dain Sundstrom

The slogan from me that Marc posted was supposed to be two different 
sayings, as follows:

JBoss
Because nothing is worth $10,000/cpu.

JBoss
DIE BEA! DIE! DIE! DIE!
(props to alt.wesley.crusher.die.die.die)

I don't necessarily like the latter anymore.  Makes us look like the 
underdog and this poor rhetoric.  This makes us look weak; it is much 
better to paint us as all powerful.  Along those lines my new sayings are:

JBoss
You know who's boss.
(this one from my mom)

JBoss
We have already won.


Peace-out,

-dain



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] message selectors

2002-02-13 Thread Dain Sundstrom

According to the JMS spec the reserved words are case insensitive. A 
part of the TOKEN spec I use in the new EJB-QL parser follows:

TOKEN [IGNORE_CASE] : /* RESERVED WORDS */
{
< FALSE: "FALSE" >
|  < NOT: "NOT" >
|  < NULL: "NULL" >
|  < TRUE: "TRUE" >
}

The boolean declaration won't work because you have the same regular 
expression in two sections.  Remember that token is part of the lexing 
step where the input stream is broken into logical token.  Then the 
syntax part happens.  If you need a production later in the grammar 
which can be true or false, you would add the following bnf_prduction:

void Boolean() :
{}
{
( | )
}

I'm by no means a JavaCC expert (I'm still learning it my self), but if 
you want, I'll look over your jj file when you finish.

-dain

Dave Smith wrote:

> OK. it looks like it does not like the BOOLEAN token as a combo fo the 
> TRUE and FALSE tokens. Inlining them works. Patch inclosed.
> 
> Now the selector will parse but still does not deliver it properly. 
> Going to bed , have a look in the morning...
> 
> 
> Dave Smith wrote:
> 
>> Ok. First problem solved. We have to call the SelectorParser 
>> constructor with at least a string reader. The problem is when you go 
>> to run ReInit with the actual selector it throws a NPE. So in 
>> SelectorParser.jj add the following to the no-args constructor
>> this(new StringReader(""));
>>
>> Boolean slector still does not work ... looking 
>>
>>
>>
>> Jason Dillon wrote:
>>
>>> Can you please verify that things are still broken with the latest CVS
>>> (with the changes I just commited).  Please submit a testcase, if you
>>> are in there and finding problems just throw something together and
>>> submit it.
>>>
>>> --jason
>>>
>>>
>>> On Wed, 2002-02-13 at 17:52, Dave Smith wrote:
>>>
 Actually it's worse than that. If you change the default parser to 
 SelectorParser, nothing works! So a simple slector like type='cadex' 
 bombs.


 Jason Dillon wrote:

> I did not think we were using the old parser anymore... Is there a
> reason this is still around after Scott reimplemented in JavaCC?
>
> --jason
>
>
> On Wed, 2002-02-13 at 16:53, Dave Smith wrote:
>
>
>> After having a bad day trying to get a message selector working 
>> for a topic listener I came across a few bugs.
>>
>> 1) If the message selector is invalid but the connection is not 
>> started but no error is thrown. So if you createTopicSession  then 
>> createSubscriber and then start the connection the connection 
>> looks good but there are no messages delivered. (I spent most of 
>> the day trying to sort this one out)
>>
>> 2) The message selectors do not seem to like boolean types. My 
>> query is
>> app_id='AK' and production=TRUE
>>
>> 3) What parser are we using for the message selectors. I thought 
>> we were using javacc and jms.jj. But in Selector the default is 
>> set to parser which is from jms.y. I don't even think this thing 
>> is getting re-processed. I did swicth the default to 
>> SelectorParser but that did not work as well.
>>
>>
>> ___
>> Jboss-development mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
>>
>


 ___
 Jboss-development mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/jboss-development

>>>
>>>
>>
>>
>>
>> ___
>> Jboss-development mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> 
> 
> --- SelectorParser.jj Wed Feb 13 23:59:07 2002
> +++ SelectorParser.jj.new Wed Feb 13 23:58:48 2002
> @@ -55,6 +55,7 @@
>  
> public SelectorParser()
> {
> +this(new StringReader(""));
> }
>  }
>  PARSER_END(SelectorParser)
> @@ -72,9 +73,7 @@
>  
>  TOKEN :
>  {
> -  < TRUE: "TRUE" | "true" >
> -  | < FALSE: "FALSE" | "false" >
> -  | < BOOLEAN:  |  >
> +  < BOOLEAN: "TRUE" | "true" | "FALSE" | "false"  >
>| < NULL: "NULL" | "null" >
>| < AND: "AND" | "and" >
>| < NOT: "NOT" >
> 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



<    1   2   3   4   5   6   7   8   9   10   >