Entity ejb
HI, This is what I get when I use entity bean with Integer as primary key. The line ``DwpTestBean was created by orion'' which is printed by the bean constractor appear only once. Orion/1.4.7 initialized DwpTestBean was created by orion DwpTestBean: setEntityContext() DwpTestBean: ejbFindByPrimaryKey 1 DwpTestBean: ejbActivate() DwpTestBean: ejbLoad()pk is 1 time to get bean by primary key: 686 ms DwpTestBean was created by orion DwpTestBean: setEntityContext() DwpTestBean: ejbFindByPrimaryKey 1 time to get bean by primary key: 4 ms DwpTestBean: ejbFindByPrimaryKey 1 time to get bean by primary key: 2 ms DwpTestBean: ejbFindByPrimaryKey 1 time to get bean by primary key: 1 ms DwpTestBean: ejbFindByPrimaryKey 1 time to get bean by primary key: 1 ms DwpTestBean: ejbFindByPrimaryKey 1 time to get bean by primary key: 1 ms DwpTestBean: ejbFindByPrimaryKey 1 time to get bean by primary key: 1 ms But when I use my class as a primary key for an entity bean, Orion just create a new bean for each request ... I have tried to overload the primary key class equals and hashCode but it didn't help. DwpTitlesBean was created by orion DwpTitlesBean: setEntityContext() DwpTitlesBean: ejbFindByPrimaryKey(13,1) DwpTitlesBean: ejbActivate() DwpTitlesBean: ejbLoad()pk is 13,1 time to get bean by primary key: 176 ms DwpTitlesBean was created by orion DwpTitlesBean: setEntityContext() DwpTitlesBean: ejbFindByPrimaryKey(13,1) DwpTitlesBean: ejbActivate() DwpTitlesBean: ejbLoad()pk is 13,1 time to get bean by primary key: 38 ms DwpTitlesBean was created by orion DwpTitlesBean: setEntityContext() DwpTitlesBean: ejbFindByPrimaryKey(13,1) DwpTitlesBean: ejbActivate() DwpTitlesBean: ejbLoad()pk is 13,1 time to get bean by primary key: 27 ms DwpTitlesBean was created by orion DwpTitlesBean: setEntityContext() DwpTitlesBean: ejbFindByPrimaryKey(13,1) DwpTitlesBean: ejbActivate() DwpTitlesBean: ejbLoad()pk is 13,1 time to get bean by primary key: 23 ms Any suggestion ?
Re: productive comment.
Um... a few clarifications. 1) Orionsupport.com as a domain is not owned by me. 2) the domain's content is currently hosted by my development machine. 3) Since I'm such a nice guy,and very reticent in my views, I get attacked on a semi-regular basis by kidz, and the box isn't exactly noncrufty to begin with, so sometimes availability is an issue. 4) No-one pays for it, except me (and a few others,who spend time keeping it up.) 5) I'm working on continuing development; I want to add a forum set, as well as organize a mechanism by which I can be remunerated for my effort and time spent on it. That includes a more stable machine, and no - I'm not trying to position myself as the sole support for orion. By "remuneration," I mean a setup by which everyone who offers support can be rewarded. (And what's more, I want peace on earth, swords beaten into radioactive ploughshares, etc.) BTW, orionsupport is back up; it had a, um, small problem with kernel threads. On Fri, Apr 13, 2001 at 07:24:20PM -0500, Michael J. Cannon wrote: Fine, but OrionSupport.com is _already_ owned by Joe Co. and they are not responding (I sent them a letter and am sending another off-line). Michael J. Cannon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Stan Ng Sent: Friday, April 13, 2001 5:37 PM To: Orion-Interest Subject: Re: productive comment. I'm all for this idea. Orionsupport is a community support effort run on a volunteer basis and I believe that it is hosted on Joseph's development machine using Orion. :) : ) :) I'd be willing to help shoulder some of the costs in moving everything over to an ISP host. There's no need for a new domain, imho... orionsupport has been very open and supportive (no pun intended). I say that we just give those good folks a nice place to put everything without tying up their resources. Community support for Orion has been excellent. The thing I'm worried about is how the Orion developers are doing... is there anything we can do to help out the guys at orionserver/ironflare? - Original Message - From: "Michael J. Cannon" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Thursday, April 12, 2001 10:47 PM Subject: RE: productive comment. RE: How do we take the next step? A sig is, classically a _S_pecial _I_nterest _G_roup, in the computer culture. orionsig.net, orionsig.org and orionsig.com are available. Pick 'em. Don't need a license from anyone to be a 'general purpose special interest group,' as long as you don't purport to be in any 'special' circumstance or make unfounded claims or use words that have obvious legal meaning. I've got a fixed IP, but it's on a slow and restricted connection. I know an ISP that is easy to work with, charges $39/mo, knows how to run services for Java, and is relatively small and responsive, and accesses through a multiple T3 (second-tier backbone access, they're actually a small CLEC). They also are an accredited registrar for all the above TLD's (turn-around is typically about 24 hours to propagate through BIND/DNS and the internic). I'd be willing to donate the first six months worth of host costs, and, after 30 days, pay for the Orion license myself (gotta run the site on Orion, don't we?) with these guys or anyone better. Let's just DO IT. Anyone else want to help? Michael Cannon mailto: [EMAIL PROTECTED] -- --- Joseph B. Ottinger [EMAIL PROTECTED] http://epesh.com/ IT Consultant
Security model message.
Ran auto update last night, and now when users access web apps that use basic authentication I get the following message from Orion 1.4.7 Netscape security model is no longer supported. Please migrate to the Java 2 security model instead. Can anybody shed some light on this?
extending DataSourceUserMangaer
hello, What is the quickest way of extending DataSourceUserMangaer to store encrypted passwords instead of plain text ones into database? with best regards, Taavi
RE: Usage of the Service console...
I use the console for remote monitoring, and shutdown. I also use the console to remote monitoring of sessions. DB support is now available (I'm using Orion 1.4.7) so I touch records if needed. Editing user profiles is built in, also, but relatively buggy. It's helpful, if you don't get your hopes too high. JP -Original Message- From: Jeff Schnitzer [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 14, 2001 1:32 AM To: Orion-Interest Subject: RE: Usage of the Service console... My advice is to ignore all the GUI tools that come with Orion and stick to Ant as a build-and-deploy tool. It is my strong suspicion that nobody is using, testing, or actively developing the GUI tools. It is my personal opinion (probably shared by many on this list) that this is a good thing. I would rather see the Orion team's limited resources focused on the server core. Not that I think pretty GUI tools don't have a place, but there really is no limit to the amount of time one can sink into getting a GUI app working properly. Ant works just fine. Jeff -Original Message- From: Chaya Ramanujam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 12:10 PM To: Orion-Interest Subject: Usage of the Service console... I've been playing with the Service console. It took me way longer to create, install and deploy a J2ee app using the console than it did when I did everything myself on the command line (creating the directory structures, creating very simple deployment descriptors, creating the jar and war files and finally editing the server.xml and default-web-site.xml files). I know the console is said to be "alpha" quality - but was just curious - is any one out there using the console on a regular basis? Do you find it really useful? In what scenarios do you find this more useful - while creating and deploying apps or for monitoring or for redeploying apps? There seems to be a great deal of functionality in the console, however the lack of documentation/help is a big drawback. --Chaya. _ Get your FREE download of MSN Explorer at http://explorer.msn.com
datasource configuration
Howdy All. I'm running Orion 1.3.8 on Linux with an Informix database. I'm getting strange database errors such as: com.evermind.server.rmi.OrionRemoteException: Database error: Column size too large. Informix limits column names to 18 characters and I'm below that limit. I've also been getting an error saying that a database file is locked. No-one else is in my database, so I believe that I'm trying to access the same table in sequential finder method calls that are too close together, time-wise. So, I suspect that my problems lie with database connections. How do I determine if my data-source is capable of pooling connections? My data-sources.xml looks like this: data-source name="K2 data source" class="com.evermind.sql.ConnectionDataSource" location="jdbc/DefaultDS" pooled-location="jdbc/DefaultPooledDS" xa-location="jdbc/xa/DefaultXADS" ejb-location="jdbc/DefaultEJBDS" schema="/usr/local/orion-1.3.8/config/database-schemas/informix.xml" url="jdbc:informix-sqli://xxx:xxx/xxx:informixserver=xxx" connection-driver="com.informix.jdbc.IfxDriver" username = xxx password = xxx / Are there better driver managers to use instead of ConnectionDataSource? I did some jndi lookups and got the following info: When I do: Object pooledDs = namingContext("jdbc/DefaultPooledDS"); System.out.println(pooledDs); I get: jdbc/DefaultPooledDS When I do: Object xaDs = namingContext("jdbc/xa/DefaultXADS"); System.out.println(xaDs); I get: XA Orion Pooled jdbc:informix-sqli://xxx:xxx/xxx:informixserver=xxx When I do: Object ejbDs = namingContext("jdbc/DefaultEJBDS"); System.out.println(ejbDs); I get: jdbc/DefaultEJBDS When I do: Object defaultDs = namingContext("jdbc/DefaultDS"); System.out.println(defaultDs); I get: jdbc:informix-sqli://xxx:xxx/xxx:informixserver=xxx Are these 4 names all bound to the same driver? (Ifxjdbc.jar) Thanks. Josh Lisle [EMAIL PROTECTED]
RE: W3C Log Format
hani, does orion support W3C Extended Format (like IIS)? thanx hitesh -Original Message- From: Markus Holmberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 14, 2001 8:30 AM To: Orion-Interest Cc: Orion-Interest Subject: Re: W3C Log Format On Fri, Apr 13, 2001 at 04:31:42PM -0400, Hani Suleiman wrote: does orion support W3C Extended Format (like IIS)? http://www.w3.org/TR/WD-logfile.html if not, what can I do to change it? Submit a RFE (Request For Enhancement) to http://www.orionserver.com/bugzilla/. Err, why, if Orion already supports it? The question was what he could do if Orion did not support it. Markus -- Markus Holmberg | Give me Unix or give me a typewriter. [EMAIL PROTECTED] | http://www.freebsd.org/
RE: How to enable UserManager support for arbitrary user...
Alex, I have a few questions and comments, 1. Which HTTPSession are you using? Orion's or your own? I recommend Orion's, tough one on the developments here uses a home-brewn session management. This forces us to include a few lines of code (with a taglib) in almost every page. Also, this renders Orion's J2EE security useless (Orion's HTTPSession has a User field where it stores either null (not authenticated) or a User reference to know the session Identity. 2. How are you authenticating a user? I presume you aren't right now. I would go with this: a. A Custom UserManager(for DB persistence, kinda like DataSourceUserManager, but yours) b. No custom SessionManager. (Orion has this declared as a public interface, but has no means to know which is the desired implementation; pity, session management,URL rewriting, and session + auth integration is not complaint to standards but purely propietary) c. a custom login action jsp/servlet. It takes username and password paramters and returns a session ID; this might be a cookie or URL rewriting (you can disable cookies in orion-web.xml) d. every new call has either a cookie field set on the HTTP header or a URL rewrite in the form of: http://somehost/somepath/somepage.jsp?a_Whole_Lotta_Params;jsessionid=SOMESE SSIONID That's it. 3. Are the client and the server in a LAN? Why not using JIntegra, J2EE CAS or SOAP4j + SOAP Toolkit to integrate them? I think basically your problem is that your HTTP Session is propietary and not seamlessly integrated with Orion. All we all would need to implement a SessionManager of our own without recompiling Orion is a SessionManager tag much like the UserManager tag in orion-application.xml. Then whenever a custom SessionManager is needed(in our case, to share sessions between Orion and IIS) would benefit of many neat things orion does, such as automatic URL rewriting, transparent session management(the session object available in JSP) and declarative security, to name a few. My 2c, JP -Original Message- From: Alex Paransky [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 15, 2001 1:03 AM To: Orion-Interest Subject: RE: How to enable UserManager support for arbitrary user... Here is the problem that I am not sure how to really fix. Our EJB application is wrapped with a number of "command" URL's which return XML results. For example: http://localhost/getAccountInformation.jsp?account=2234 would return an XML representation of an account. An http://localhost/addUserToAccount?account=2234userName=test.. . would add a user to a particular account. A Visual Basic client, then uses these "command" URLs and resulting XML to present a user interface. Given the above scenario, what would be your recommendation for authenticating the user starting right after I accept the user/password from the VB form (I don't much care for VB specifics, just the part which deals with EJB/JSP/J2EE security). After accepting user authentication information from a VB dialog, what should I do next. How do I get this information "registered" with Orion or any j2ee application server so that the deployment descriptor information works correctly. Is this the way J2EE security was meant to be used. A non super-user account, cannot execute a setSuperuser(boolean) function on the User bean. Is this how I should be controlling this? Is this the proper method? I was reading the J2EE EJB spec which states that coding security should be the last resort. I am not clear on how to execute the above scenario. Thanks to all the people who have already posted in regards to this issue. -AP_ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Schnitzer Sent: Friday, April 13, 2001 10:09 PM To: Orion-Interest Subject: RE: How to enable UserManager support for arbitrary user... I suggest using an MVC (aka "Model 2") approach, separating your view from your controller. One of the controller's responsibilities can be to check for authentication and provide to the user either the requested page or the login page. If you use a dispatcher-servlet-action framework for your controller, you typically will only need to put the authentication checking code in a base action class from which all protected action classes derive. If you use JSPs as controllers you'll need some sort of code in every one (you can use @include for this). You will be much happer if you use an MVC appraoch, trust me. The J2EE automatic form-based authentication is very crude and fails to accomodate simple use cases like automatically logging in new users. You might want to look at WebWork: http://www.sourceforge.net/projects/webwork. BTW, if you use the Orion UserManager (and RoleManager), you should not do your own database lookup. Calling RoleManager.login() causes methods to be called on
Re: extending DataSourceUserMangaer
At a guess, you would need to install a subclass of DataSourceUserManager and override the getUser()/createUser() methods to return your own impl of com.evermind.security.User (so you can specify your own custom behaviour for the authenticate method). Hani On Mon, 16 Apr 2001, Taavi Tiirik wrote: hello, What is the quickest way of extending DataSourceUserMangaer to store encrypted passwords instead of plain text ones into database? with best regards, Taavi
Stream Corrupted Exception
We are developing a 5-tier application here - the client is applet, and Orion serves the servlets and EJB's - The application, after loading, stays pretty stable for 30-40 mins after which we keep getting Stream Corrupted exceptions and HTTP Read timed out on the backend, while at the front-end there is usually no message, and if there is, it's a null-pointer exception. We deployed the same app on Apache (keeping the EJB's in Orion) and the problem went away. Is this a known issue? In that case does anyone have a solution? Thanks DG java.io.StreamCorruptedException: Caught EOFException while reading the stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:845) at java.io.ObjectInputStream.init(ObjectInputStream.java:168) at com.myrio.tm.subscribers.servlet.CSubscribersServlet.service(CSubscribersSer vlet.java:396) at javax.servlet.http.HttpServlet.service(HttpServlet.java:329) at com.evermind.server.http.d3.sw(JAX) at com.evermind.server.http.d3.su(JAX) at com.evermind.server.http.ef.s1(JAX) at com.evermind.server.http.ef.do(JAX) at com.evermind.util.f.run(JAX) ejbFindByPrimaryKey(97) ViewerId =1 count...1 new Preference 1 ejbStore() Inside StoreSubscriberContacts Exiting StoreSubscriberContacts in storeSubscriberViewer exiting StoreSubscriberViewers java.io.StreamCorruptedException: Caught EOFException while reading the stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:845) at java.io.ObjectInputStream.init(ObjectInputStream.java:168) at com.myrio.tm.subscribers.servlet.CSubscribersServlet.service(CSubscribersSer vlet.java:336) at javax.servlet.http.HttpServlet.service(HttpServlet.java:329) at com.evermind.server.http.d3.sw(JAX) at com.evermind.server.http.d3.su(JAX) at com.evermind.server.http.ef.s1(JAX) at com.evermind.server.http.ef.do(JAX) at com.evermind.util.f.run(JAX)
RE: datasource configuration
this is what I use and works with no problem. k. data-source class="com.evermind.sql.DriverManagerDataSource" name="Informix" location="jdbc/InformixCoreDS" xa-location="jdbc/xa/InformixXADS" ejb-location="jdbc/InformixDS" connection-driver="com.informix.jdbc.IfxDriver" username="myid" password="mypassword" url="jdbc:informix-sqli://x::informixserver=;Database=x" schema="database-schemas/informix.xml" inactivity-timeout="30" also this is my informix.xml: ?xml version="1.0"? !DOCTYPE database-schema PUBLIC "-//Evermind//- Database schema" "http://www.orionserver.com/dtds/database-schemas.dtd" database-schema name="informix-sqli" not-null="not null" null="" primary-key="primary key" type-mapping type="java.lang.String" name="varchar (50)" / type-mapping type="int" name="int" / type-mapping type="long" name="int" / type-mapping type="float" name="float" / type-mapping type="double" name="double" / type-mapping type="byte" name="byte" / type-mapping type="char" name="char" / type-mapping type="short" name="short" / type-mapping type="boolean" name="boolean" / type-mapping type="java.util.Date" name="datetime year to fraction(5)" / disallowed-field name="username" / disallowed-field name="order" / /database-schema -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Josh Lisle Sent: Monday, April 16, 2001 1:33 PM To: Orion-Interest Subject: datasource configuration Howdy All. I'm running Orion 1.3.8 on Linux with an Informix database. I'm getting strange database errors such as: com.evermind.server.rmi.OrionRemoteException: Database error: Column size too large. Informix limits column names to 18 characters and I'm below that limit. I've also been getting an error saying that a database file is locked. No-one else is in my database, so I believe that I'm trying to access the same table in sequential finder method calls that are too close together, time-wise. So, I suspect that my problems lie with database connections. How do I determine if my data-source is capable of pooling connections? My data-sources.xml looks like this: data-source name="K2 data source" class="com.evermind.sql.ConnectionDataSource" location="jdbc/DefaultDS" pooled-location="jdbc/DefaultPooledDS" xa-location="jdbc/xa/DefaultXADS" ejb-location="jdbc/DefaultEJBDS" schema="/usr/local/orion-1.3.8/config/database-schemas/informix.xml" url="jdbc:informix-sqli://xxx:xxx/xxx:informixserver=xxx" connection-driver="com.informix.jdbc.IfxDriver" username = xxx password = xxx / Are there better driver managers to use instead of ConnectionDataSource? I did some jndi lookups and got the following info: When I do: Object pooledDs = namingContext("jdbc/DefaultPooledDS"); System.out.println(pooledDs); I get: jdbc/DefaultPooledDS When I do: Object xaDs = namingContext("jdbc/xa/DefaultXADS"); System.out.println(xaDs); I get: XA Orion Pooled jdbc:informix-sqli://xxx:xxx/xxx:informixserver=xxx When I do: Object ejbDs = namingContext("jdbc/DefaultEJBDS"); System.out.println(ejbDs); I get: jdbc/DefaultEJBDS When I do: Object defaultDs = namingContext("jdbc/DefaultDS"); System.out.println(defaultDs); I get: jdbc:informix-sqli://xxx:xxx/xxx:informixserver=xxx Are these 4 names all bound to the same driver? (Ifxjdbc.jar) Thanks. Josh Lisle [EMAIL PROTECTED]
RE: Security model message.
Please disregard and know that I have slapped myself around thoroughly and am now humbly apologize for sending such a stupid post. The problem has nothing at all to do with Orion. For the sake of the innocent here is what happened. I upgraded the jdk to 1.3.02 I use JBuilder, and I added the new JDK to my project. JBuilder added all of the jar files in the jdk/lib directory to the classpath it uses to execute things. Unfortunately one the jar files in the lib directory is a now defunct set of APIs in jaws.jar. The jdk seeing that jaws.jar was in the classpath was simply letting me know not to use the defunct APIs. Lesson learned. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Russ White Sent: Monday, April 16, 2001 11:15 AM To: Orion-Interest Subject: Security model message. Ran auto update last night, and now when users access web apps that use basic authentication I get the following message from Orion 1.4.7 Netscape security model is no longer supported. Please migrate to the Java 2 security model instead. Can anybody shed some light on this?
findBy referencing another entity reference
Hi all, How about this scenario: There are three entities: manufacturer, model, car (as an example) model knows directly which manufacturer it is, car knows which model it is, but car has to do a model.getManufacturer to find out its manufacturer... OK, so what I wanna know is can I write a findByManufacturer for car? I'd like to be able to do something like this: query="$model.manufacturer = $1" Now, I know that I could specify a sub-query with the actual persistence name of the other entity's thang, something like: query="$model in (select $model from model where manufacturer_id = $1)" but it strikes me that Orion won't know what I'm going on about, and best case, will have to talk to the database each time. Either way, I had to put the persistence name into the orion-ejb-jar.xml file, which is not goodness. Is it possible maybe to say something like: query="model in ($1)" where $1 is a Collection of models taken from ModelHome.findByManufacturer? Any thoughts on the best way to approach this? Thanks, Rian -- Rian Schmidt [EMAIL PROTECTED]
RE: findBy referencing another entity reference
Rian, This is much too sql centric. You should resolve your entity beans around business methods. So I would start off by reading more about entity beans. Theserverside.com, for example has a download on an excellent book for entity beans. As for the sql, you are talking a one to one relationship for the car/model and a one to many relationship for the manufacturer/model. There should be some examples of this on the sun's j2ee site. I know that they specifically discuss this issue. Regards, the elephantwalker -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Rian Schmidt Sent: Monday, April 16, 2001 2:23 PM To: Orion-Interest Subject: findBy referencing another entity reference Hi all, How about this scenario: There are three entities: manufacturer, model, car (as an example) model knows directly which manufacturer it is, car knows which model it is, but car has to do a model.getManufacturer to find out its manufacturer... OK, so what I wanna know is can I a findByManufacturer for car? I'd like to be able to do something like this: query="$model.manufacturer = $1" Now, I know that I could specify a sub-query with the actual persistence name of the other entity's thang, something like: query="$model in (select $model from model where manufacturer_id = $1)" but it strikes me that Orion won't know what I'm going on about, and best case, will have to talk to the database each time. Either way, I had to put the persistence name into the orion-ejb-jar.xml file, which is not goodness. Is it possible maybe to say something like: query="model in ($1)" where $1 is a Collection of models taken from ModelHome.findByManufacturer? Any thoughts on the best way to approach this? Thanks, Rian -- Rian Schmidt [EMAIL PROTECTED]
DataSourceUserManager article at www.orionsupport.com has an error for oracle users
There is an article about setting up DataSourceUserManager at http://www.orionsupport.com/articles/datasourceusermanager.html If you use oracle and happen to copy/paste something from this page then please do not do the same mistake I did. This example uses column name 'group' which is not something that should be used. You can easily create table containing a column with this name and you can even add data into this but even simplest sql queries do not work. If you are using oracle dba studio for example then you won't even notice it. with best wishes, Taavi
Re: findBy referencing another entity reference
Oh boy... OK, maybe that was a bad example. "Read more about entity beans" is not very useful advice in any case. I just didn't want to explain our business model to ask the question. Try the situation where the top level is Vehicle - Manufacturer - Model or something many-to-many on each layer. My point is that I want to be able to "skip a layer" in the finder. Is that possible? If you don't know, or the answer is no, please just say that or ignore my question and move on. If you have an actual answer or alternative approach that might work, I'd be very appreciative to hear it. For what it's worth, I want to do it this way, as opposed to using some kind of bean-based (logical model) test or pseudo-BMP thing because, due to the volume of "3rd level (in my example)" entities running a findAll on them is performance-limiting and I'd rather not stick SQL directly in my beans. Thanks, Rian -- Rian Schmidt [EMAIL PROTECTED] - Original Message - From: "elephantwalker" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Monday, April 16, 2001 2:54 PM Subject: RE: findBy referencing another entity reference Rian, This is much too sql centric. You should resolve your entity beans around business methods. So I would start off by reading more about entity beans. Theserverside.com, for example has a download on an excellent book for entity beans. As for the sql, you are talking a one to one relationship for the car/model and a one to many relationship for the manufacturer/model. There should be some examples of this on the sun's j2ee site. I know that they specifically discuss this issue. Regards, the elephantwalker -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Rian Schmidt Sent: Monday, April 16, 2001 2:23 PM To: Orion-Interest Subject: findBy referencing another entity reference Hi all, How about this scenario: There are three entities: manufacturer, model, car (as an example) model knows directly which manufacturer it is, car knows which model it is, but car has to do a model.getManufacturer to find out its manufacturer... OK, so what I wanna know is can I a findByManufacturer for car? I'd like to be able to do something like this: query="$model.manufacturer = $1" Now, I know that I could specify a sub-query with the actual persistence name of the other entity's thang, something like: query="$model in (select $model from model where manufacturer_id = $1)" but it strikes me that Orion won't know what I'm going on about, and best case, will have to talk to the database each time. Either way, I had to put the persistence name into the orion-ejb-jar.xml file, which is not goodness. Is it possible maybe to say something like: query="model in ($1)" where $1 is a Collection of models taken from ModelHome.findByManufacturer? Any thoughts on the best way to approach this? Thanks, Rian -- Rian Schmidt [EMAIL PROTECTED]
Is this the Orion Team?
Some digging though the.serverside.com, at the link http://www2.theserverside.com/reviews/thread.jsp?thread_id=165, uncovered this. Posted By: Per Norrman on November 3, 2000 in response to this message. A couple of weeks ago, the Orion team was featured in Dagens Nyheter, the largest swedish newspaper. Learn swedish, then read this article: http://www.dn.se/DNet/dyn/Crosslink.dyn?d=408a=135807f=huvudtext.htmlt=2v=0 In short, the Orion team consists of two guys, 22 and 24 years old, working from an apartment in Eskilstuna, Sweden. The article mentiones that they spent about two years and approx 14 000 programming hours before their first order. However, that implies constantly working more than 19 hours a day for two years Also, they have refused venture capital and and other offers, on the grounds that it would limit their freedom of doing things their own way. __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Re: Migratingfrom GSP
What the heck, as long as I'm here already... I'd say that you want to look at setting up filters to handle the pre-request action. You can basically catch every request for your site in a filter, make sure that it is appropriate, that sessions and application are set-up right, and even do funky model 2 (request.setAttribute) stuff in there before the actual JSP gets it. Look at: servlet-mapping and filter-mapping in web.xml http://www.orionserver.com/docs/web.xml.html That should cover both pre-JSP action and catchall servlet mapping. The load balancing business is usually pretty implementation specific, so I don't have much to offer there. Rian -- Rian Schmidt [EMAIL PROTECTED] - Original Message - From: "Topher LaFata" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Monday, April 16, 2001 3:12 PM Subject: Migratingfrom GSP Hi all. I am new to the orion/JSP/EJB sort of paradigm. Anyways, I am attempting to migrate a substantially sized GSP(Gnu Server Pages)/JServ application to the Orion platform for evaluation. I have a lot of functionality in place which relies on hooks present in GSP which do not seem to be obviously present in JSP/Orion. Namely when using the JSP facilites of Orion I need hooks into the following: *when the servlet is loaded -it seems that I have to overide the init method of the Orion JSPServlet. HOwever, how do i indicate that my application should use this new subclassed servlet to handle JSP requests? *when the session is created per user -in GSP there is a sessionStart() hook. *when the request is recieved before it is handed to the JSP for further processing. -in GSP there is a requestStart() hook I also have a fair amount of custom code doing session persistence among multiple servers. Is there a particular interface thgat I could wrap my code with so Orion would use this stuff to do its session handling. These are probably stupid questions but I just started looking at JSP/Tomcat/Orion a couple of days ago and I am finding the amount of configuration a bit daunting. Thanks. toph
RE: findBy referencing another entity reference
This is the right idea; you want to do a join in the finder. Relational databases were designed to do exactly this sort of thing. Putting extra information in the EJBs would just lead to consistency problems, IMHO. The EJB 2.0 specification defines EJB QL, which is a database-independent query language reminiscent of SQL and the preferred solution to your problem. Unfortunately Orion does not yet support EJB QL, so you need to manually specify the join in SQL in the orion-ejb-jar.xml finder definition. You will need to use a partial="false" finder to do a join, which means you need to be very careful about how you specify the select. Select table.* should work if you allowed Orion to create the table in the first place. Otherwise you'll need to make sure that the columns are specified in the same order as the fields in ejb-jar.xml. You will probably want to put this new finder definition in an orion-ejb-jar.xml fragment included in your ejb jar file so that deploying your j2ee app on a new server will automatically include the changes. There is much discussion in the archives about how to do this. Good luck! Jeff -Original Message- From: Adam Cassar [mailto:[EMAIL PROTECTED]] Sent: Monday, April 16, 2001 6:41 PM To: Orion-Interest Subject: Re: findBy referencing another entity reference I found this reply to an earlier posting quite usefull. http://www.mail-archive.com/orion-interest@orionserver.com/msg1 2085.html
RE: How to enable UserManager support for arbitrary user...
Given that he has a smart/fat client, I don't think the web form is the way to go. It's a square peg for a round hole. Alex, when you execute a successful RoleManager.login(), whatever user information Orion keeps is automaticaly taken care of. All you need to do is make sure you maintain the session id in either a cookie or a rewritten url (;jsessionid=ASDFGHIJKL) in your requests. You don't need to explicitly create a session in the JSP, either. If you subsequently want to get the user name or programmatically check security, use the getCallerPrincipal() or isCallerInRole() methods on the servlet context or ejb context objects. You'll need to watch out for session timeouts in your client. You should seriously consider using SOAP. That is designed for exactly what you're trying to do. There is a free Apache implementation that you could probably get running under Orion, and VB will do all the client work for you. Jeff -Original Message- From: Hani Suleiman [mailto:[EMAIL PROTECTED]] Sent: Monday, April 16, 2001 2:07 PM To: Orion-Interest Subject: RE: How to enable UserManager support for arbitrary user... Thanks for your help, I think I am getting closer, here is what I plan to do: 1. Create a specific login .JSP page which will: a. validate the user b. create a session c. configure the "user" attribute to the user object d. return session id to the client 2. Client passes the session id on every call as a part of the url Why go through any of 1? J2EE does all this for you. All you need to do is use form auth. Have your login page return whatever xml is required to show the VB login box. So whenever you request a protected resource, the login box will pop up. Disable cookies in the webapp, and then read in the JSESSIONID from the url and just make sure it's in every future request, so the servlet container knows where to find your authenticated session. Again, the only part of the above which I am not sure about is 1c... Thanks. -AP_ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Juan Lorandi (Chile) Sent: Monday, April 16, 2001 11:26 AM To: Orion-Interest Subject: RE: How to enable UserManager support for arbitrary user... Alex, I have a few questions and comments, 1. Which HTTPSession are you using? Orion's or your own? I recommend Orion's, tough one on the developments here uses a home-brewn session management. This forces us to include a few lines of code (with a taglib) in almost every page. Also, this renders Orion's J2EE security useless (Orion's HTTPSession has a User field where it stores either null (not authenticated) or a User reference to know the session Identity. 2. How are you authenticating a user? I presume you aren't right now. I would go with this: a. A Custom UserManager(for DB persistence, kinda like DataSourceUserManager, but yours) b. No custom SessionManager. (Orion has this declared as a public interface, but has no means to know which is the desired implementation; pity, session management,URL rewriting, and session + auth integration is not complaint to standards but purely propietary) c. a custom login action jsp/servlet. It takes username and password paramters and returns a session ID; this might be a cookie or URL rewriting (you can disable cookies in orion-web.xml) d. every new call has either a cookie field set on the HTTP header or a URL rewrite in the form of: http://somehost/somepath/somepage.jsp?a_Whole_Lotta_Params;jses sionid=SOMESE SSIONID That's it. 3. Are the client and the server in a LAN? Why not using JIntegra, J2EE CAS or SOAP4j + SOAP Toolkit to integrate them? I think basically your problem is that your HTTP Session is propietary and not seamlessly integrated with Orion. All we all would need to implement a SessionManager of our own without recompiling Orion is a SessionManager tag much like the UserManager tag in orion-application.xml. Then whenever a custom SessionManager is needed(in our case, to share sessions between Orion and IIS) would benefit of many neat things orion does, such as automatic URL rewriting, transparent session management(the session object available in JSP) and declarative security, to name a few. My 2c, JP -Original Message- From: Alex Paransky [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 15, 2001 1:03 AM To: Orion-Interest Subject: RE: How to enable UserManager support for arbitrary user... Here is the problem that I am not sure how to really fix. Our EJB application is wrapped with a number of "command" URL's which return XML results. For example: http://localhost/getAccountInformation.jsp?account=2234 would return an XML representation of an account. An http://localhost/addUserToAccount?account=2234userName=test.. . would add a user to a particular account. A Visual