Re: Bi-directional N-to-N support does it work in orion?
What you are doing by specifying one table is correcting a bug in Orion's automatic table creation code that results from its lack of bi-directional support (Orion wants to create a table for each side of the relationship.) However, this won't give you bi-directionality, which you can easily verify. Add/remove one bean from the other's Collection (or Set, etc) and you won't see it reflected in the other bean's Collection. The solution I've been limping along with is to manage all bi-directional relationships with a separate Session bean that explicitly updates both sides of the relationship. (If you model the relationship with one db table, you will have to manually catch the duplicate key exceptions as well.) - Original Message - From: "Alex Paransky" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Tuesday, July 03, 2001 12:38 AM Subject: Bi-directional N-to-N support does it work in orion? > I read some time ago that Orion does not support bi-directional N-to-N > relationships. Recently (1.5.2) I created such a relationship and initially > Orion created TWO relationship tables. Afterwards, I removed one of the > tables, and updated orion-ejb-jar.xml to use the same table for both sides > of the relationship. > > Question: Is this type of usage supported in Orion 1.5.2? Am I asking for > trouble? Is anyone aware of any problems with using orion-ejb-jar.xml to > "manipulate" the deployment descriptor in such a way? > > Thanks. > -AP_ > >
Re: Oracle deal
This is my fear as well, and why I am surprised by the generally favorable reactions to this deal. What will it mean for Orion, and specifically the licensing. Will everything still be free, or will Oracle turn Orion into another WebLogic? It feels a little like Microsoft just absorbed my favorite development environment. - Original Message - From: "Keith Kwiatek" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, June 07, 2001 11:15 AM Subject: Re: Oracle deal > I hope this orion + oracle deal is the same as the borland jbuilder + oracle > jdeveloper deal. Oracle licensed Jbuilder technology, but Borland was > still free to take Jbuilder in any direction they wanted, AND oracle was > free to take "Jdeveloper" in any direction they wanted. The end result is > that Jdeveloper is way behind the curve because Oracle always buys > technology for which they do not have the ability to maintain. MEANWHILE, > Jbuilder is doing great and getting better and better > > I guess the question is "Just what kinda deal did Ironflare work out with > Oracle? Did Ironflare get wrapped into a straight-jacket for a few short > term buck$ ?" > > Keith > > > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "Orion-Interest" <[EMAIL PROTECTED]> > Sent: Wednesday, June 06, 2001 5:29 PM > Subject: Re: Oracle deal > > > > > > What I am interested in is what are the future implications for Orion? > > We are about to purchase a license for Orion, but if development on Orion > > isn't going to be the main focus, where does that leave customers? > > > > > > Julian Doherty > > Information Systems Analyst > > Education Review Office > > > > > > > > > > Phillip Ross > > <[EMAIL PROTECTED]> To: > Orion-Interest <[EMAIL PROTECTED]> > > Sent by: cc: > > owner-orion-interest@orionSubject: Re: > Oracle deal > > server.com > > > > > > 06/07/01 08:07 AM > > Please respond to > > Orion-Interest > > > > > > > > > > > > > > I've been told Oracle's oc4j is orion 1.5.0. And I've also been told that > > it's > > confidental as to how/when/if ironflare will continue to push newer builds > > of > > orion to Oracle or what. > > > > - Phillip > > > > --- Bryan Young <[EMAIL PROTECTED]> wrote: > > > I just read about Orion being used as the base code for their 9i app > > server. > > > Does anyone know the specifics of the deal? Specifically I wanted to > > know > > > what version of Orion they are using, and if there would be any benefit > > to > > > future versions of Orion. > > > > > > > > > __ > > Do You Yahoo!? > > Get personalized email addresses from Yahoo! Mail - only $35 > > a year! http://personal.mail.yahoo.com/ > > > > > > > > > > > > > >
Re: How to execute a SUM function???
I use home interface methods to implement functionality like you describe. For example, I have an Auction been, that has AuctionLineItems, each of which has a reserve price (minimum acceptable bid.) To calculate the total reserve amount of all items currently available at auction: In AuctionHome, I have a method like public double reserveValueOfOpenAuctions() throws RemoteException, FinderException; In AuctionBean, I have a corresponding public double ejbHomeReserveValueOfOpenAuctions() throws RemoteException, FinderException { try { java.sql.Timestamp now = new java.sql.Timestamp(System.currentTimeMillis()); Method[] methods = getClass().getMethods(); Method getContext = null; for(int i = 0; i < methods.length; i++) { if(methods[i].getName().indexOf("getContext") != -1) { getContext = methods[i]; break; } } EntityContext theCtx = null; if(getContext != null) { theCtx = (EntityContext) getContext.invoke(this, null); if(DEBUG_AUCTION_VALUE)System.out.println("theCtx " + theCtx); } AuctionHome auctionHome = (AuctionHome) theCtx.getEJBHome(); ArrayList openAuctions = new ArrayList(); Collection auctions = auctionHome.findAll(); if(DEBUG_AUCTION_VALUE)System.out.println("auctions " + auctions.size()); double totalReserve = 0; Iterator iAuctions = auctions.iterator(); while(iAuctions.hasNext()) { Auction auction = (Auction) iAuctions.next(); AuctionState state = auction.getAuctionState(); if(DEBUG_AUCTION_VALUE)System.out.println("state " + state); if(state.startTime == null || state.endTime == null || ((now.before(state.endTime) && state.startTime.before(now) ) || state.isPending()) ) { Collection items = auction.getAuctionLineItemStates(); if(DEBUG_AUCTION_VALUE)System.out.println("items " + items.size()); Iterator iItems = items.iterator(); while(iItems.hasNext()) { AuctionLineItemState itemState = (AuctionLineItemState)iItems.next(); totalReserve += itemState.reservePrice; if(DEBUG_AUCTION_VALUE) System.out.println(itemState + ", reserve: " + itemState.reservePrice + "tr: " + totalReserve); } } } return totalReserve; } catch (Exception e) { e.printStackTrace(); return 0; } } Admitedly, the code that finds the EntityContext is ugly. The class that implements this method is, I believe, derived from com.evermind.server.ejb.ContainerManagedObject. For some reason, that class does not expose a getContext(), but does have a __getContext(). I have to use reflection because javac doesn't know anything about __getContext(). Ugly, but it does work. - Original Message - From: "Alex Paransky" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, May 31, 2001 5:53 PM Subject: How to execute a SUM function??? > I need to do something like this: > > select sum(price) from lineitem; > > I have an entity bean called LineItem, with a field called price > (getPrice()/setPrice(float)). How can I make this work with Orion? > > Thanks. > -AP_ > > >
Re: Deployment to multiple instances...?
This might not be the solution you're looking for, but you could use ant and specifiy your different deployments as different targets. This would at least give you a central place to build from, and because ant knows about .war packaging and supports FTP, theoretically (because I have not done this myself) you can do all you're looking for with build scripts. - Original Message - From: "Attila Bodis" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 10:57 AM Subject: Deployment to multiple instances...? > Hi, > > This is a newbie question, I guess... Here is the situation: > > I have a web application (a bunch of servlets, JSPs, and supporting classes) > I want to deploy to multiple Orion instances. Some of these instances are > for QA, some are inside the firewall, and some are outside the firewall. My > application has external dependencies on databases and files in the > filesystem that are not part of the application itself. Rather than > hard-code these values, I include them as s in > WEB-INF/web.xml. > > Ideally, I'd like to be able to build my web application on my development > machine, package it as a WAR file, and deploy it by just FTPing the WAR into > the appropriate directory on my various Orion instances. The problem is, my > configuration parameters are in WEB-INF/web.xml, which is inside the WAR > file. These configuration parameters have to be different for my different > instances (e.g. different directory structure, different database connection > parameters, etc.). But the web.xml file inside the WAR file always > overwrites the one already deployed, which means each time I distribute my > WAR file to my different instances, I have to 1) wait for Orion to > auto-unpack the archive, then 2) manually change the settings in > WEB-INF/web.xml on each instance. > > Of course if I avoid putting container-specific (i.e. deployment > environment-specific) parameters in WEB-INF/web.xml, then the same web.xml > will work on all of my various instances. But then where do I put config > parameters such as "log level," "log file directory," and "path to > my-secret-files", etc., which are used by the application but are specific > to the particular deployment environment? > > Does Orion provide a way to specify config parameters for an application on > a per-container basis? > > Thanks, > > Attila >
Re: Bi-directional relations (my kludge)
Hi Ray. The only vendors I know of who have EJB 2 implementations are Orion and WebLogic. I definitely prefer Orion's development environment, but there is no comparison in terms of support (and I mean free support; WebLogic staff developers routinely answer newsgroup questions and once, in response to a bug I submitted concerning compound primary keys, a WL developer not only identified himself as the one working on the problem, but asked me if I thought his proposed solution was acceptable. Wow.) Reid - Original Message - From: "Ray Harrison" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 6:47 PM Subject: Re: Bi-directional relations (my kludge) > Hi Reid - > What App Servers currently offer m-n relationships - I'm interested in exploring how some of them > operate. > > Cheers > Ray > --- Reid Hartenbower <[EMAIL PROTECTED]> wrote: > > I have found the lack of bi-directional support very frustrating, and think > > that it so impedes CMP functionality that it should be qualified as a bug, > > and not a pending feature. > > > > I also don't see what the big technical challenge in implementing it would > > be. > > If Orion is going to be this sluggish with support and new features, I would > > ask them to consider going open source. Let me fix it if you won't--do you > > hear me Orion guys? > > > > My workaround is to manage the relations with a 'RelationManager' session > > bean. For n-m relations, I create my join tables with composite primary > > keys, as in (for hsql): > > > > CREATE TABLE User_Order ( > > userId CHAR(37)NOT NULL, > > orderIdCHAR(37)NOT NULL, > > PRIMARY KEY (userId, orderId)); > > > > > > Then in the session bean, I explicitly create both sides of the relationship > > (eg. user.addOrder(order) and order.addUser(user) ) and catch the duplicate > > key exception, as in: > > > > user.addOrder(order); > > if(NON_DIRECTIONAL_BUG) { > > try { > > order.addUser(user); > > } > > catch(EJBException e) { > > // for Orion 1.4.7 bidirectional bug; > > } > > } > > > > When (if) Orion fixes this bug, the modifications to my code will be slight. > > > > - Original Message - > > From: "Ray Harrison" <[EMAIL PROTECTED]> > > To: "Orion-Interest" <[EMAIL PROTECTED]> > > Sent: Thursday, April 05, 2001 10:50 AM > > Subject: Re: Bi-directional relations > > > > > > > Nope. > > > --- Patrik Andersson <[EMAIL PROTECTED]> wrote: > > > > Does bi-directional relations work yet? I'm pretty sure it did not work > > the > > > > last time I tried, but that was a fix fix versions ago. > > > > > > > > Any news on this issue? > > > > > > > > regards, > > > > Patrik Andersson > > > > > > > > > > > > > __ > > > Do You Yahoo!? > > > Get email at your own domain with Yahoo! Mail. > > > http://personal.mail.yahoo.com/ > > > > > > > > > > > > > > > __ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > >
Re: Bi-directional relations (my kludge)
I have found the lack of bi-directional support very frustrating, and think that it so impedes CMP functionality that it should be qualified as a bug, and not a pending feature. I also don't see what the big technical challenge in implementing it would be. If Orion is going to be this sluggish with support and new features, I would ask them to consider going open source. Let me fix it if you won't--do you hear me Orion guys? My workaround is to manage the relations with a 'RelationManager' session bean. For n-m relations, I create my join tables with composite primary keys, as in (for hsql): CREATE TABLE User_Order ( userId CHAR(37)NOT NULL, orderIdCHAR(37)NOT NULL, PRIMARY KEY (userId, orderId)); Then in the session bean, I explicitly create both sides of the relationship (eg. user.addOrder(order) and order.addUser(user) ) and catch the duplicate key exception, as in: user.addOrder(order); if(NON_DIRECTIONAL_BUG) { try { order.addUser(user); } catch(EJBException e) { // for Orion 1.4.7 bidirectional bug; } } When (if) Orion fixes this bug, the modifications to my code will be slight. - Original Message - From: "Ray Harrison" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 10:50 AM Subject: Re: Bi-directional relations > Nope. > --- Patrik Andersson <[EMAIL PROTECTED]> wrote: > > Does bi-directional relations work yet? I'm pretty sure it did not work the > > last time I tried, but that was a fix fix versions ago. > > > > Any news on this issue? > > > > regards, > > Patrik Andersson > > > > > __ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > >
HttpSession question
Is there a way, from a client, to iterate through all the open sessions in a web server? I'm looking for something like Context.listBindings(), but for sessions. I have the feeling that this would be an unacceptable security hole and so is not possible, but figured someone in 'the constellation' might have the definitive answer. Thanks Reid
Re: Globally available environment vars
Gladly. In the .jsps I want to record hit counts, I have: <%@ page import = "javax.naming.*"%> <% Context ctx = new InitialContext(); long lhits = 0; try { Long LhitCount = (Long) ctx.lookup("<>/<>.jsp"); lhits = LhitCount.longValue() + 1; ctx.rebind("("<>/<>.jsp", new Long( lhits)); } catch(NameNotFoundException nnfe) { %> not found <% lhits = 1; ctx.bind("("<>/<>..jsp", new Long(lhits)); } %> By domain context, I mean the root context for the domain (or web application). While you may be right about Bindings being read only (and what I'm doing is actually removing an old binding and creating a new one), the result is, in effect, a writable environment variable that I can see from a client. Note that I do this 'inside' the domain (in the app servers JVM, not the client's.) I haven't tried it from the client. - Original Message - From: "Tim Endres" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Cc: "Reid Hartenbower" <[EMAIL PROTECTED]> Sent: Saturday, January 06, 2001 3:17 PM Subject: Re: Globally available environment vars > Could you please elaborate on this? What do you mean when you say "domain context"? > Also, I was under the impression that these values were read-only, not writable. > What am I missing? > tim. > > > Yes. I use domain contexts just like you describe to store page hit counts, > > so I can see traffic from a remote client. > > > > - Original Message - > > From: "Tim Endres" <[EMAIL PROTECTED]> > > To: "Orion-Interest" <[EMAIL PROTECTED]> > > Sent: Friday, January 05, 2001 3:23 PM > > Subject: RE: Globally available environment vars > > > > > Are you sure? Seems to me that all you have to do is use the constructor > > > InitialContext( Properties props ) to specify the environment that you wish > > > via the java.naming.provider.url property. In other words, can't a web module > > > just use "ormi://host:port/appname" to get a Context that can access the > > > environment of the ejb module "appname"? > > > > > > > well, the problem is that there seems not to be a context which is > > > > accessable from all the modules! It looks like this may be a J2EE deficiency > > > > .. I'm just gonna use a properties file .. > > > > > > > > jd > > > > > > > > > -Original Message- > > > > > From: [EMAIL PROTECTED] > > > > > [mailto:[EMAIL PROTECTED]]On Behalf Of Jason Smith > > > > > Sent: Friday, January 05, 2001 1:19 PM > > > > > To: Orion-Interest > > > > > Subject: RE: Globally available environment vars > > > > > > > > > > > > > > > How about having an initializer bind some property files into > > > > > JNDI that can > > > > > then be accessed by the web & ejb modules. > >
ejbVoyager 1.9
ejbVoyager, available at http://sourceforge.net/projects/ejbvoyager/, is an open-source, GNU Public License, java/swing client application,for generic unit testing of entity and session enterprise java beans,rapid, OO-style input of application test data, and general explorationof JNDI Contexts and their contents. It has been tested with WebLogic5.1and 6, and Orion 1.3, but should run with any EJB1.1 and 2.0 containerif you have the necessary client classes (eg the context factory class)in your classpath. All other classes are located and loaded via JNDI contexts(including any non-ejb support classes like state or view classes.) Last Update: 01/06/01 added ClassLoaderFrame for introspection of aribtrary Classes and instances.
Re: Globally available environment vars
Yes. I use domain contexts just like you describe to store page hit counts, so I can see traffic from a remote client. - Original Message - From: "Tim Endres" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Friday, January 05, 2001 3:23 PM Subject: RE: Globally available environment vars > Are you sure? Seems to me that all you have to do is use the constructor > InitialContext( Properties props ) to specify the environment that you wish > via the java.naming.provider.url property. In other words, can't a web module > just use "ormi://host:port/appname" to get a Context that can access the > environment of the ejb module "appname"? > > > well, the problem is that there seems not to be a context which is > > accessable from all the modules! It looks like this may be a J2EE deficiency > > .. I'm just gonna use a properties file .. > > > > jd > > > > > -Original Message- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED]]On Behalf Of Jason Smith > > > Sent: Friday, January 05, 2001 1:19 PM > > > To: Orion-Interest > > > Subject: RE: Globally available environment vars > > > > > > > > > How about having an initializer bind some property files into > > > JNDI that can > > > then be accessed by the web & ejb modules. > > > > > > > > >
Re: Traversing JNDI namespace
Hi, (And I preface this with 'as I understand it') First, it's the app server's context, not the bean's. What parts of it you get to see are determined by the principal/credential pair (and the roles they connect you to, as defined on the app server) that you pass to the context factory when you ask for the initial context. Why you don't see what you expect in the context is another matter. May I recommend an open-source tool I wrote (http://sourceforge.net/projects/ejbvoyager). It will allow you to browse your app server's context tree. What I suspect is happening is that you are calling Context.lookup() or .listBindings() with bad path values. Try passing both absolute and relative JNDI paths and see what happens. Correlate this with the .isRelative() values for the bindings you examine. - Original Message - From: "Nick Newman" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Monday, December 04, 2000 2:55 PM Subject: Traversing JNDI namespace > Hi, > > How can I find what's in an entity bean's java:comp/env namespace? > > If I ask the InitialContext for a list of what is in it (using > initialcontext.list("") ) I get a list of things (mainly home interfaces) > plus entries for "java:comp" and "ejb" which are both Contexts. > > If I ask for what's in "java:comp" I get a few strange entries, but NOT one > for "env", which is the one I would have expected. > > If I ask for what's in "java:comp/env" I get nothing back (empty context). > > However, lookups for entries named java:comp/env/foo succeed where they should. > > Any ideas? > > Thanks, > Nick > > >
ejbVoyager - an ejb 1.1 unit tester
Hi. ejbVoyager is a open-source, GNU General Public License, jdk1.3/swing client application for generic unit testing, via reflection, of enitity and session EJBs. It has been tested with WebLogic5.1 and 6 beta, and Orion 1.3.8 but should run with any EJB1.1 container if you have the necessary client classes (eg the context factory class) in your classpath. ejbVoyager v1.5.1 is available, temporarily, at http://4.3.14.35/ejbVoyager.html Anyone willing to mirror may go ahead and do so; just let me know where, please. I can offer no support right now, though I am interested in bug reports and developers wishing to work on it. I've created a SourceForge project but I have had difficulties using CVS and the version of ejbVoyager that's there now is very stale ( help with this, anyone?) Please include "ejbVoyager" in the subject of emails concerning ejbVoyager to help me route.