[JBoss-dev] create(...)
Hi, I wanted to use the EJB 2 create(...) feature. It did not work, so I browsed the source code (Branch_2_4 and cvs HEAD), and came to the conclusion it is not yet implemented. Since it did not look too complicated, I wrote a quick patch. So my question are: - did I miss something obvious? [in that case, I should have asked before coding] - otherwise, should I polish up my patch and submit it to SF? TIA. -Stephane Bidoul ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] EJB QL
> > I'm beginning to realize that EJB 2.0 specification has a > serious limitation. > It's the EJB QL. > > Take for example a simple problem: How to create a finder or > select method > that would return a set of entities that a user specifies by > for example 4 > different attributes where each of them could be missing > (null) and would > therefore not account into the query result? Create 16 > different finders for > every combination of 4 attributes and a switch statement? > What if there were > 10 different attributes? Create 1024 different finders? > > Another example: the "LIKE pattern_value" construct where > "pattern_value" can > only be a literal value and not a parameter. I understand that this > limitation arises from the similar limitation in the SQL from > which EJB QL > was derived so that mapping from EJB QL to SQL is easy... Yep, it is very limited. > What is missing from the EJB 2.0 spec and would greatly improve the > "fullness" of the specification is execution of EJB QL > queries that are > composed programatically at runtime. > > So what am I doing on this list? Read on... > > As I understand it, the EJB 2.0 spec has provided app server > vendors with a > possibility to create proprietary extensions to finder/select method > processing with the following (taken from the ejb-jar_2_0.dtd): > > "Queries that are expressible in EJB QL must use the ejb-ql element to > specify the query. If a query is not expressible in EJB QL, the > description element should be used to describe the semantics of the > query and the ejb-ql element should be empty." > > ...and the interpretation of the description element is up to > the container > provider... I didn't know this. > I'm proposing (and I believe that it would not be hard to > implement in JBoss) > something like the following: > > 1. bosscmp-jdbc.xml: add optional > element as a child > of elements: > > > ... > > the.composer.Class > ... > > > the.composer.Class would implement the following interface: > > public interface EjbQlComposer { > // return the EJB QL query string > public String composeEjbQlQuery(String > description, Object[] parameters) > throws FinderException; > } > > Before executing any finder/select method with an empty > element in > the particular entity an instance of the specified > > would be created, the composeEjbQlQuery method called with > the > element content from the being executed and the > parameters to the > finder/select method passed in Object[] array. The method > would compose and > return a string consisting of EJB QL query which the > container would compile > and execute. > > What do you think? Would that be feasible? I'm interested in > implementing > this and contributing to JBoss... > > Peter So basically you want dynamic EJB-QL. This id possible, but would be slow. The current EJB-QL engine was not designed to be fast, as all parsing is done at startup. Eventually, I plan on rewriting. To solve this type of problem, I plan on supporting dynamic-sql. Which would allow you to do this type of thing, but would require you to know the database mapping. -dain ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] EJB QL
I'm beginning to realize that EJB 2.0 specification has a serious limitation. It's the EJB QL. Take for example a simple problem: How to create a finder or select method that would return a set of entities that a user specifies by for example 4 different attributes where each of them could be missing (null) and would therefore not account into the query result? Create 16 different finders for every combination of 4 attributes and a switch statement? What if there were 10 different attributes? Create 1024 different finders? Another example: the "LIKE pattern_value" construct where "pattern_value" can only be a literal value and not a parameter. I understand that this limitation arises from the similar limitation in the SQL from which EJB QL was derived so that mapping from EJB QL to SQL is easy... What is missing from the EJB 2.0 spec and would greatly improve the "fullness" of the specification is execution of EJB QL queries that are composed programatically at runtime. So what am I doing on this list? Read on... As I understand it, the EJB 2.0 spec has provided app server vendors with a possibility to create proprietary extensions to finder/select method processing with the following (taken from the ejb-jar_2_0.dtd): "Queries that are expressible in EJB QL must use the ejb-ql element to specify the query. If a query is not expressible in EJB QL, the description element should be used to describe the semantics of the query and the ejb-ql element should be empty." ...and the interpretation of the description element is up to the container provider... I'm proposing (and I believe that it would not be hard to implement in JBoss) something like the following: 1. bosscmp-jdbc.xml: add optional element as a child of elements: ... the.composer.Class ... the.composer.Class would implement the following interface: public interface EjbQlComposer { // return the EJB QL query string public String composeEjbQlQuery(String description, Object[] parameters) throws FinderException; } Before executing any finder/select method with an empty element in the particular entity an instance of the specified would be created, the composeEjbQlQuery method called with the element content from the being executed and the parameters to the finder/select method passed in Object[] array. The method would compose and return a string consisting of EJB QL query which the container would compile and execute. What do you think? Would that be feasible? I'm interested in implementing this and contributing to JBoss... Peter ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmx/src/main/org/jboss/ha/jndi HANamingService.java
User: slaboure Date: 01/11/23 06:38:25 Modified:src/main/org/jboss/ha/jndi HANamingService.java Log: Calls new HARMIServerImpl constructor with RMI specific parameters Revision ChangesPath 1.15 +2 -2 jbossmx/src/main/org/jboss/ha/jndi/HANamingService.java Index: HANamingService.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/jndi/HANamingService.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- HANamingService.java 2001/11/19 23:16:57 1.14 +++ HANamingService.java 2001/11/23 14:38:25 1.15 @@ -61,7 +61,7 @@ * Management Bean for HA-JNDI service. * * @author [EMAIL PROTECTED] - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ * * Revisions: * 2001/11/19 bill burke: @@ -212,7 +212,7 @@ { log.info("Starting HAJNDI server"); log.info("Create HARMIServer proxy"); - this.rmiserver = new HARMIServerImpl(partition, "HAJNDI", Naming.class, theServer); + this.rmiserver = new HARMIServerImpl(partition, "HAJNDI", Naming.class, theServer, rmiPort, this.clientSocketFactory, this.serverSocketFactory); this.stub = (Naming)rmiserver.createHAStub(new RoundRobin()); log.info("Start listener"); ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmx/src/main/org/jboss/ha/framework/server HARMIServerImpl.java
User: slaboure Date: 01/11/23 06:36:22 Modified:src/main/org/jboss/ha/framework/server HARMIServerImpl.java Log: New constructor with RMI specific parameters Revision ChangesPath 1.7 +11 -3 jbossmx/src/main/org/jboss/ha/framework/server/HARMIServerImpl.java Index: HARMIServerImpl.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/HARMIServerImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- HARMIServerImpl.java 2001/11/12 05:32:00 1.6 +++ HARMIServerImpl.java 2001/11/23 14:36:22 1.7 @@ -17,6 +17,8 @@ import java.rmi.server.RemoteStub; import java.rmi.server.RemoteServer; import java.rmi.server.UnicastRemoteObject; +import java.rmi.server.RMIClientSocketFactory; +import java.rmi.server.RMIServerSocketFactory; import java.io.Serializable; import java.io.Externalizable; import java.io.ObjectInput; @@ -44,7 +46,7 @@ * * @author [EMAIL PROTECTED] * @author [EMAIL PROTECTED] - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * * Revisions: * 2001/11/09: Sacha Labourey @@ -69,7 +71,8 @@ protected Class intf; protected long clusterViewId = -1; - public HARMIServerImpl (HAPartition partition, String replicantName, Class intf, Object handler) throws Exception + public HARMIServerImpl (HAPartition partition, String replicantName, Class intf, Object handler, + int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws Exception { this.replicantName = replicantName; this.handler = handler; @@ -80,12 +83,17 @@ for (int i = 0; i < methods.length; i++) invokerMap.put (new Long (RemoteMethodInvocation.calculateHash (methods[i])), methods[i]); - this.rmistub = UnicastRemoteObject.exportObject (this); + this.rmistub = (RemoteStub)UnicastRemoteObject.exportObject (this, port, csf, ssf);// casting is necessary because interface has changed in JDK>=1.2 updateHAPartition (partition); HARMIServer.rmiServers.put (key, this); + } + + public HARMIServerImpl (HAPartition partition, String replicantName, Class intf, Object handler) throws Exception + { + this (partition, replicantName, intf, handler, 0, null, null); } public void updateHAPartition (HAPartition partition) throws Exception ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmx/src/main/org/jboss/ha/framework/interfaces HAPartition.java
User: slaboure Date: 01/11/23 06:37:38 Modified:src/main/org/jboss/ha/framework/interfaces HAPartition.java Log: Added asynchronous calls and removed unnecessary throws declaration Revision ChangesPath 1.5 +3 -3 jbossmx/src/main/org/jboss/ha/framework/interfaces/HAPartition.java Index: HAPartition.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/interfaces/HAPartition.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HAPartition.java 2001/11/09 22:42:02 1.4 +++ HAPartition.java 2001/11/23 14:37:38 1.5 @@ -15,7 +15,7 @@ * * @author [EMAIL PROTECTED] * @author [EMAIL PROTECTED] - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * * Revisions: */ @@ -41,9 +41,9 @@ public void unregisterRPCHandler(String objectName, Object subscriber); // Called only on all members of this partition on all nodes - // (not subpartitions or other partitions) // public ArrayList callMethodOnCluster(String objectName, String methodName, Object[] args, boolean excludeSelf) throws Exception; + public void callAsynchMethodOnCluster (String objName, String methodName, Object[] args, boolean excludeSelf) throws Exception; // * // * @@ -58,7 +58,7 @@ public void setCurrentState(Serializable newState); } - public void subscribeToStateTransferEvents (String objectName, HAPartition.HAPartitionStateTransfer subscriber) throws Exception; + public void subscribeToStateTransferEvents (String objectName, HAPartition.HAPartitionStateTransfer subscriber); public void unsubscribeFromStateTransferEvents (String objectName, HAPartition.HAPartitionStateTransfer subscriber); // * ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmx/src/main/org/jboss/ha/framework/server HAPartitionImpl.java
User: slaboure Date: 01/11/23 06:37:38 Modified:src/main/org/jboss/ha/framework/server HAPartitionImpl.java Log: Added asynchronous calls and removed unnecessary throws declaration Revision ChangesPath 1.8 +16 -1 jbossmx/src/main/org/jboss/ha/framework/server/HAPartitionImpl.java Index: HAPartitionImpl.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/HAPartitionImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- HAPartitionImpl.java 2001/11/09 22:43:28 1.7 +++ HAPartitionImpl.java 2001/11/23 14:37:38 1.8 @@ -56,7 +56,7 @@ * * @author [EMAIL PROTECTED] * @author [EMAIL PROTECTED] - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * * Revisions: */ @@ -274,6 +274,21 @@ return rtn; } + /** +* This function is an abstraction of RpcDispatcher for asynchronous messages +*/ + public void callAsynchMethodOnCluster (String objName, String methodName, Object[] args, boolean excludeSelf) throws Exception + { + MethodCall m = new MethodCall (objName + "." + methodName, args); + this.CallRemoteMethods (null, m, GroupRequest.GET_NONE, timeout); + + if (!excludeSelf) + { + m.SetName (methodName); + Object handler = rpcHandlers.get (objName); + m.Invoke (handler, method_lookup_clos); + } + } // * // * // State transfer management ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] jbosscmp-jdbc.xml
If you want to specify column names, you should have both sides. -dain > -Original Message- > From: Dave Smith [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 22, 2001 8:32 AM > To: [EMAIL PROTECTED] > Subject: [JBoss-dev] jbosscmp-jdbc.xml > > > I see we have > > (ejb-relationship-role, > ejb-relationship-role)?> > > Should this not be > > (ejb-relationship-role, > ejb-relationship-role?)> > > > I think for a uni-directional relationship there would be only 1 role. > > > > > ___ > 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] [ jboss-Bugs-484776 ] Dead connection in Pool
Bugs item #484776, was opened at 2001-11-23 00:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=484776&group_id=22866 Category: JBossCMP Group: v2.4 (stable) Status: Open Resolution: None Priority: 5 Submitted By: Bani Greyling (banigreyling) Assigned to: Nobody/Anonymous (nobody) Summary: Dead connection in Pool Initial Comment: Windows NT4 SP5 JDK 1.3 JBoss2.4.1a-Tomcat3.2.3 If a connection die in the pool and is later given out to participate in a transaction, it (obviously) give an exception. I think this is incorrect behaviour for the pool to assume the connection to be still valid after the transaction the connection was used in did not succeed. I configured my datasource with InvalidateOnError=true, but it does not seem to work. The dead connection stay in the pool. If my connections tend to die over time, I will end up with a pool of dead connections with no automated way of getting rid of them. IdleTimeout will not work, because the connection will not be idle as it is given out all the time (and cause exceptions). -- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=484776&group_id=22866 ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [ jboss-Bugs-484771 ] Incorrect ObjectNotFoundException
Bugs item #484771, was opened at 2001-11-23 00:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=484771&group_id=22866 Category: JBossCMP Group: v2.4 (stable) Status: Open Resolution: None Priority: 5 Submitted By: Bani Greyling (banigreyling) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect ObjectNotFoundException Initial Comment: Windows NT4 JDK1.3 JBoss2.4.1a-Tomcat3.2.3 When you do a findByPrimaryKey and the connectionpool return a dead connection, The exception thrown is ObjectNotFoundException, with the message "Object with primary key `pk.toString()` not found in storage". In my opinion the exception should be a FinderException, because the find failed in general. The FinderException message should be the same JDBC message that is printed to the console. I now sit in the unfortunate position that I cannot distinguise whether a user is not registered for my site, or if my DB connection is invalid. -- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=484771&group_id=22866 ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: newsite/src/docs main.css
User: user57 Date: 01/11/23 00:25:06 Modified:src/docs main.css Log: o removed small-caps from headings Revision ChangesPath 1.13 +1 -6 newsite/src/docs/main.css Index: main.css === RCS file: /cvsroot/jboss/newsite/src/docs/main.css,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- main.css 2001/11/23 07:58:34 1.12 +++ main.css 2001/11/23 08:25:06 1.13 @@ -2,7 +2,7 @@ * CSS Style Sheet for the JBoss website. */ -/* $Id: main.css,v 1.12 2001/11/23 07:58:34 user57 Exp $ */ +/* $Id: main.css,v 1.13 2001/11/23 08:25:06 user57 Exp $ */ BODY { font-family: Arial,serif; @@ -32,8 +32,6 @@ color: #336633; clear: both; font-weight: bold; - font-variant: small-caps; - letter-spacing: 0.1em; } H1 { @@ -56,15 +54,12 @@ padding-top: 5px; font-size: 13px; font-weight: normal; - letter-spacing: normal; } H6 { padding-top: 5px; font-size: 13px; - font-variant: normal; font-weight: normal; - letter-spacing: normal; } .linkhead { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development