Stuff I am about to try with EJBs
I am about to try out some things with EJBs in an 8.1.7 EE instance and thought I might ask around if anyone has already tested the following:
1. The EJB developers guide talks about a new database session being created whenever a client does a lookup on the InitialContext. If I use the same sid/user/password every time I look up an EJB, will I always be directed to the same DB session? Most importantly, if I have multiple web clients all referencing the same set of EJBs (e.g., CustomerEJB's), and I configure my app so that all EJB lookups use the same user/password, will the CustomerEJB instances be shared among all the client sessions?
2. What happens in an instantiated Entity EJB if the underlying table is updated via another mechanism (e.g., via SQLPlus)? Should I try to force a ejbLoad and ejbStore every time the EJB methods are used or does the Oracle RDBMS handle updating the EJB instances in memory?
Thanks,
John H.
I am making a sketchpad and when the user presses the arrow keys, it draws a line and stuff in the specified
direction. Is there a class that acts like a pen?Google for 'java etch-a-sketch' and you'll get lots of examples.
Similar Messages
-
Mavericks:
Is Apple never going to do something about Mavericks many problems? I've about had it with Mac and when today's Mavericks update appeared, I declined.
I updated to Mavericks 6 months ago on my new Macbook Pro and have had nothing but trouble ever since -- despite numerous trips to the Genius Bar. They all act as though It's only my machine yet I'm reading literally hundreds of similar complaints on the Internet. To start:
1) My machine now "runs" very slow (as in 1980).
2) Search and Spotlight yield jumbled information.
3) MAIL and CCONTACTS are near useless with a spinning beachball the norm.
My Apple store had my machine for 5 days with no loaner! They did a manual rebuild and shrugged their sholders when it still didn't work after all that.
I have the distinct impression that Time Machine is at the bottom of some of my problems. I've used it to migrate data from my last three machines and I'm seeing some odd stuff from my other machines. In particular, I used an exact Macbook Pro loaned by a client after my last Mac crashed (I was backed up) and I'm seeing their grayed out login ID autoentered when I try to update Imovie and so I cannot log into my apple account.
I've used Mac since 1995 when the first SE came out and I'm very tech oriented. I can only wonder how frustrated the lay used might be. Any thoughts out there?Supply information about your Mac (guessing is no use)
Download and run Etrecheck, post the output here -
Hi,
I am a student. I am working on a project : trying to distribute heavy matrix calculus on many machines to reduce the execution time(Parallelism on many "slave" machines). I thought Java RMI would help me do this.(master/slaves application), but it seems that a JAVA RMI client cannot contact, simultaneously, many servers that are on different physical machines at the same time (each server on a different physical machine, that means each server has its own ip address)
So, i am thinking to use EJB.
That's why i want to be sure that EJB will enable a client to contact many servers that have differents ip addresses simultaneously.
is this possible with EJB?
thanks in advance.997072 wrote:
I am a student. I am working on a project : trying to distribute heavy matrix calculus on many machines to reduce the execution time(Parallelism on many "slave" machines). I thought Java RMI would help me do this.(master/slaves application), but it seems that a JAVA RMI client cannot contact, simultaneously, many servers that are on different physical machines at the same time (each server on a different physical machine, that means each server has its own ip address)you are wrong about this. there is no such restriction in rmi.
So, i am thinking to use EJB.
That's why i want to be sure that EJB will enable a client to contact many servers that have differents ip addresses simultaneously.
is this possible with EJB?if this is your reason for ejb, then you're probably headed in the wrong direction. i'd go back to your original idea, and try to figure out where you went wrong. -
i hope someone gets this who can help me. i don't find anything helpful in the help section of icloud. i'm using my 4th generation itouch for about 3 weeks with the ical. but today when i tried to edit an event or add an event a window would pop up and say "event can't be saved" or "no calendar chosen" or something like "this event doesn't belong with this calendar" and stuff like that.
can you please help me fix this?You could repartition your drive to have a different OS X with the older iTunes there, and the newer iTunes on the existing partition. Back up everything beforehand. See Kappy's advice in this thread. Partitioning my Hard Drive
-
Bean-managed transaction with EJB 3.0
Hi,
I try to get a bean-managed transaction example running with EJB 3.0 under GlassFish v2ur2.
In order to demarcate the scenario I have to get me the UserTransaction which I get from the SessionContext. I would like to use it then like: UserTransaction ut = context.getUserTransaction();
I tried to get the SessionContext with the help of the EJB method setSessionContext which should be called by the container after instance creation.
However, setting a log output into that method does not show any call of this method.
So, how can I get this method called or is there another way to get the SessionContext for the UserTransaction to work ?
Are there any good and fully implemented examples for bean-managed transactions ?
Thanks for your help.
RegardsI found the solution for that my SessionContext was NULL and I could not use the UserTransaction.
The reason for it is that I injected the EJB with @EJB into my servlet and did a MyBean mybean = new MyBean();
That leads to a SessionContext which is NULL within my EJB.
If I use it without instantiating it it works fine.
Again, thanks for your help. At least it pointed me into the right direction.
Regards -
How to master good design with EJB and JSP?
I use JSP to calling EJB. But the .jsp file is complex and it's difficult to maintain...I just want to work higher efficent with EJB,JSP and JavaBean. I want to know is there a good design with EJB and JSP? and is there any good material about MVC for EJB,JSP and JavaBean?
You should read the J2EE blueprint available on this website. Better download the PDF, and print it for yourself so you can read it anytime.
-
Creating library file with ejb
Can anyone suggest me the process by which we can create a library file with ejb? I am new to the ejb environment and i need some guidance regarding this.
Could you be more specific about what you mean by library file? Are you asking about how to package classes used by ejb components outside of the ejb-jar itself?
--ken -
Do i have to use JNDI with EJBS?
Hi
I want to use JNDI to lookup a system which i will send messages to using JMS. I would like to have some java classes on Tomcat to do the job. But...whenever i hear about JNDI it is always in relation to EJBs. Can i only use JNDI with EJBS?
If i can use JNDI is there anything important i need to know about.
Thanks in advance!
San H.You can definitely use JNDI outside of EJB's - in particular, it's a great interface for dealing with LDAP servers, even securely, and can also be used for DNS interfacing, COS, RMI registries, etc.
While JNDI was chosen as the method by which J2EE components can locate other components in a distributed environment, it's by no means limited to that task :) It's a wonderful API, and in terms of things you need to know, most everything is covered fairly well at the JNDI tutorial in the various trails that are mapped out there.
http://java.sun.com/products/jndi/tutorial/
Good luck!
James
James Manning | Principal Engineer
Porivo Technologies, Inc.
919.806.0566 | [email protected]
http://www.porivo.com/
Measuring end-to-end Web performance.
Register for a FREE Performance appraisal:
http://www.porivo.com/peerReview/eval.html -
Do i have to use JMS with EJBS?
Hi
I want to use JMS as a messaging system (a queue) between my system and someone elses. I would like to have some java classes on Tomcat to do the job. But...whenever i hear about JMS i always hear it in relation to EJBs. Can i only use JMS with EJBS?
If i can use JMS is there anything important i need to know about.
Thanks in advance!
San H.As far as I understand you are use JNDI and JMS is not bound with EJB's. These are java API's which are independent. Like JDBC you can use with Servlets, Applets, standalone applications, EJB, JMS etc etc.......
In the same way you can use JNDI and JMS with diferent API. And the important feature of Java is that all java API interact with each other when these are independent. I would appricate comments of everyone......................Thanks -
Which of the following are true about abstract methods in EJB 2.0
Hi guys I'm beginner to EJB and i got some unanswered questions.
Can any one of you please.. give answers?
Thanks if you do...
Which of the following are true about abstract methods in EJB 2.0
CMP?
Choose all correct answers:
1. Abstract accessor methods should not be exposed in the EJB
component's interface
2.Abstract accessor/mutator methods are used to access and modify
persistent state and relationship information for entity objects
3.Abstract Accessor/Mutator methods do not throw exceptions
4.The EJB developer must implement the Accessor/Mutator methods
5.Abstract accessor methods may or may not be exposed in the EJB
component's interface
2.Which ONE of the following is true?
Choose the best answer:
1.Local interfaces cannot have a relationship with other Entity
components
2.Local interfaces cannot be used for Stateless Session EJB
3.Local interfaces can be a part of Object's persistent state
4.Local interfaces have the same functionality as that of a
stateless Session EJB
3.Which of the following describe the <cmr-field> in a EJB 2.0
descriptor?
Choose all correct answers:
1.A Local interface/Entity can be a value of a <cmr-field>
2.There is no <cmr-field> in EJB 2.0 descriptor
3.It is used to represent one meaningful association between any
pair of Entity EJBs, based on the business logic of the Application
4.It provides a particular mapping from an object model to a
relational database schema
5.It allows the Local Entity interfaces to participate in
relationships
4.Which of the following are the advantages of using Local interfaces
instead of dependent value classes?
Choose all correct answers:
1.Local Entity Interfaces can participate in Relationships
2.The life cycle of Local Entity Interfaces is managed by EJB
container, intelligently
3.Local Entity Interfaces can be used in EJB QL Queries
4.Local Entity Interfaces can be a part of the <cmp-field> but not
<cmr-field>
5.Which of the following are true about Local interfaces
1.A local interface must be located in the same JVM to which the EJB
component is deployed
2.Local calls involve pass-by-reference.
3.The objects that are passed as parameters in local interface
method calls must be serializable.
4.In general, the references that are passed across the local
interface cannot be used outside of the immediate call chain and must
never be stored as part of the state of another enterprise bean.
6.Which of the following specifies the correct way for a client
to access a Message driven Bean?
Choose the best answer:
1. via a Remote interface
2. via Home interface
3. Message driven bean can be accessed directly by the client
4. both 1 & 2
5. none of the above
------------------------------------------------------------------------7.Which of the following statements are true about message-driven
bean Clients?
------------------------------------------------------------------------Choose all correct answers:
They can create Queue and QueueConnectionFactory objects
They can create Topic and TopicConnectionFactory objects
They can lookup the JNDI server and obtain the references for
Queue and Topic and their connection Factories
Only 1 and 2 aboveHi guys I'm beginner to EJB and i got some unanswered
questions.
Can any one of you please.. give answers?
Thanks if you do...
Which of the following are true about abstract methods
in EJB 2.0
CMP?
Choose all correct answers:
1. Abstract accessor methods should not be exposed
d in the EJB
component's interfacefalse
2.Abstract accessor/mutator methods are used to
access and modify
persistent state and relationship information for
entity objectstrue
>
3.Abstract Accessor/Mutator methods do not throw
exceptionstrue
>
4.The EJB developer must implement the
Accessor/Mutator methodsfalse
5.Abstract accessor methods may or may not be exposed
in the EJB
component's interfacetrue
2.Which ONE of the following is true?
Choose the best answer:
1.Local interfaces cannot have a relationship with
other Entity
componentsfalse
2.Local interfaces cannot be used for Stateless
Session EJBfalse
3.Local interfaces can be a part of Object's
persistent statefalse
4.Local interfaces have the same functionality as
that of a
stateless Session EJBtrue
3.Which of the following describe the <cmr-field> in a
EJB 2.0
descriptor?
Choose all correct answers:
1.A Local interface/Entity can be a value of a
<cmr-field>true
2.There is no <cmr-field> in EJB 2.0 descriptorfalse
3.It is used to represent one meaningful association
between any
pair of Entity EJBs, based on the business logic of
the Applicationtrue
4.It provides a particular mapping from an object
model to a
relational database schematrue
5.It allows the Local Entity interfaces to
participate in
relationshipstrue
4.Which of the following are the advantages of using
Local interfaces
instead of dependent value classes?
Choose all correct answers:
1.Local Entity Interfaces can participate in
Relationshipsis
2.The life cycle of Local Entity Interfaces is
managed by EJB
container, intelligentlyis
3.Local Entity Interfaces can be used in EJB QL
Queriesnot
4.Local Entity Interfaces can be a part of the
<cmp-field> but not
<cmr-field>not
>
>
5.Which of the following are true about Local
interfaces
1.A local interface must be located in the same JVM
M to which the EJB
component is deployedtrue
2.Local calls involve pass-by-reference.true
3.The objects that are passed as parameters in local
l interface
method calls must be serializable.false
4.In general, the references that are passed across
s the local
interface cannot be used outside of the immediate
e call chain and must
never be stored as part of the state of another
r enterprise bean.true
>
6.Which of the following specifies the correct way for
a client
to access a Message driven Bean?
Choose the best answer:
1. via a Remote interfacefalse
2. via Home interfacefalse
3. Message driven bean can be accessed directly by
the clientfalse
4. both 1 & 2false
5. none of the abovetrue.
>
----------------7.Which of the following statements
are true about message-driven
bean Clients?
----------------Choose all correct answers:
They can create Queue and QueueConnectionFactory
objectsthe container can, dunno bout clients
>
They can create Topic and TopicConnectionFactory
objectsthe container can, dunno bout clients
>
They can lookup the JNDI server and obtain the
references for
Queue and Topic and their connection Factories
true
Only 1 and 2 abovefalse
somebody correct me if i'm wrong -
Pleease Help (UIX with EJB)
it seems that uix cannot be used with ejb and session beans like ADF views. for exampe the master detail between pages doesn't work. i am getting crazy.
please give me anykeys about how to use UIX with EJBs and Session beansare you using CMP or BMP?
-
Implicitly Passing a Custom Context with EJB Invocations
Dimitri, this is most likely one for you.
We have a need to implicitly pass contextual information with EJB
invocations. I'd also like to be able to intercept/filter invocations.
The current approach autogenerates subclasses for the bean
implementations. In these subclasses, the methods take an additional
context parameter. From the client perspective, the business delegates
implicitly provide this parameter.
I'd like to solve this without code generation.
The current approach I'm considering is to have a generic command EJB.
This stateless session bean will take a method signature, method
parameters, and a context object. The command EJB will delegate these
invocations to the actual EJBs.
I will get the client to go through this command EJB by intercepting the
home lookups. I will wrap the initial context. Using dynamic proxies,
the new initial context will return a wrapped stub that will actually go
through the command bean, implicitly passing the thread local context.
So far as the command bean's configuration goes, I will set to the pool
size very high (the sum of all of the other stateless session bean pool
sizes perhaps). I will set the transaction type to Supports and pass on
any exceptions.
Can anyone think of a better way to go about this?
Thanks,
BobWhy do you need the custom context? I have worked with an application that held the SessionContext and wrapped all the methods of the EJB context. This was a maintenance problem because changes to the EJB spec caused the methods to change and therefore the calling code.
Are you trying to insulate your POJO code from EJB specific classes? -
Arch freezes after about 10 minutes with new kernel [SOLVED]
As the title says: Arch freezes after about 10 minutes with new kernel (2.6.27). I can only move a mouse, but everything else is frozen. Even restarting X doesn't do a trick. It doesn't work at all. Frozen.
I don't get any kind of error message (oh really?), so what's the problem..?
Last edited by Exitium (2008-10-22 15:29:27)juan_sck wrote:
Exitium wrote:
test1000 wrote:I had an issue with only being able to move the mouse after logging in from gdm and nothing happening but i don't know if thats the same error Sooo, are you using the right nvidia drivers? their driverpolicy just changed, and we now have 4 different official nvidia drivers in repo :S
Yeah... I'm using nvidia... So the problem is nvidia drivers, not the Linux kernel?
Edit: My card is nVidia GeForce 8800 Ultra. I can't get driver information now, because I'm using WinXP right now. I'll check it later.
Did you make a new install or just updated?
You can try to reinstall old kernel with:
pacman -U /var/cache/pacman/pkg/kernel(version you want).pkg.tar.gz
if you made a new install you may have to install the xorg keyboard driver and so.
By the way, there are a few diferent packages for nvidia drivers. Check wich is yours.
Also check /var/log/ folder for errors.
Updated kernel.
And as I said, I'll check the driver later. -
Deploy JSP/Servlet along with EJB
how could deploy EJB with JSP/Servlet?.
First i have
package project.account
1.HomeInterface class
2.RemoteInterface class
3.Bean class
4.Client class
I deployed the above bean in J2EE using Deploytool GUI.
run the client like this
java -classpath %CLASSPATH%;personDepClientClient.jar project.account.Client
it displays result at prompt
what i am asking is
now i wrote JSP file which is kept also this project.account package
i used the JSP file as client for the that bean.
it is Show.jsp file(client file)
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.rmi.PortableRemoteObject" %>
<%
double balance;
try
Context initi = new InitialContext();
Object ref = initi.lookup("AccountHome");
AccountHome home = (AccountHome)javax.rmi.PortableRemoteObject.narrow(ref,AccountHome.class);
AccountRemote vijay = home.create("200","vijay",0.00);
vijay.credit(2000.0);
vijay.debit(600);
balance = vijay.getBalance();
%>
<tr>
<td width="38%" height="31">
</td>
<td width="62%" height="31">
<div align="center"><%= balance %></div>
</td>
</tr>
<%
AccountRemote kumar = home.create("199", "kumar", 0.00);
kumar.credit(14000);
AccountRemote xyz = home.findByPrimaryKey("199");
xyz.debit(200.00);
balance = xyz.getBalance();
%>
<tr>
<td width="38%" height="31">
</td>
<td width="62%" height="31">
<div align="center"><%= balance %></div>
</td>
</tr>
<%}
catch(Exception ex)
System.err.println("Caught an exception." );
ex.printStackTrace();
%>
after deployed this JSP file and executed as
http://localhost:8000/project/person/Show.jsp
it displays error as follows
unable to find AccountRemote,AccountHome,findByPrimaryKey
How could deploy JSP along with EJB?.
pls any one tells steps to be followed while Deploying EJB/JSP.
with thanks
vijayHmmmm...
ssniazi does nothing but ask for contact information or recommend Oracle products.
Based on this I consider it likely that this person is some sort of sales representative either directly or indirectly associated with Oracle.
I personally wouldn't provide any contact information to this person. Nor would I accept any advice until this person starts to actually provide some solutions or at least correctly reveals any financial interests that they might have. -
Newbie: How does the security manager work with EJB?
Hi,
I am new to J2EE and do not seem to grasp how the security manager (or J2EESecurityManager) works with EJB.
My bean does security-senisitive stuff (like getting the Policy object) and must not do so unless I give it permission in the policy file. So far so good. But the permission will only work if I grant it to ALL code, like:
grant {
permission java.security.SecurityPermission "getPolicy";
Beans do not seem to have a protection domain or code source/certificates attached to it. so I cannot say
grant "/file/sw/ejb/myejb.jar" {
permission java.security.SecurityPermission "getPolicy";
Why is that (probably because beans run remote)? But more importantly, how DO I set permissions based on which bean it is?If I add that directory as the codebase to
a grant statement any class loaded from there will
have the specified permission.I thought so, too, and that is why I went digging for the code source of my bean (i.e. where is it deployed, from where is it loaded) but that source is NULL:
Some program output:
==Has security manager: com.sun.enterprise.J2EESecurityManager
==Code source is ProtectionDomain (null <no certificates>)
The code seems to have no code source (null) and no signatures (in fact, I also signed my code with the keytool but that certificate did not show here either).
I am running this against the j2ee server 1.3 -- just experimenting, but it does not go so well. :-)
Maybe you are looking for
-
I can put music on it just fine. I don't understand.
-
Values not read from database table.
Hi experts, I have an issue reading values from the database table. In my custom table I have a KUNAG field. The Sold-to partyis a 10 character field. I have saved a record with KUNAG = '0000694012'. But when i read the values in a program using KUNA
-
The safari button is gone....how to set it up again
all of a sudden the safari icon is gone on my ipad......how to get it back, I can#t access the web.....still other things like fb or calendar work...
-
Palm Pre USB overrides my keyboard
I've recently had a problem with using the USB cable on my Palm Pre with my desktops. When I plug the USB cable into my PC, it t seems to override my keyboard, as in suddenly my keyboard stops working. At first I thought it was because I have an ol
-
Export table fr different server
hi all, my company have 2 servers. how i can export table fr server 1 to server 2. tks in advance.