Database access through Beans
My question is about high level design. I've written some JSP pages and some very simple JavaBeans that work on Tomcat.
Now I'm trying to design a Database access layer
I want to have a connection pool class and some other business logic classes communicating with each other.
How can I start a bean and keep it running and how do I access its methods from other beans?
Is this even feasible?
if I declare the scope of the bean as the application would I have to put it in all the pages of the web site or not?
Also, should I just forget about JavaBeans and do Servlets? Maybe EJB is better for this?
Please provide some examples in your answer if possible.
Thanks,
David A
My question is about high level design. I've written
some JSP pages and some very simple JavaBeans that
work on Tomcat.
Now I'm trying to design a Database access layerThe design and implementation of a persistence layer has nothing at to do with how the data is eventually displayed. Persistence is the same whether you use a Web or a Swing interface, so the question about Tomcat is moot.
I'd look at Martin Fowler's "Patterns of Enterprise Application Architecture" for its chapter on persistence or the Hibernate object/relational mapping tool.
I want to have a connection pool class and some other
business logic classes communicating with each other.Personally, I prefer to let Tomcat handle the database connection pool. I use the Commons DBCP class and configure my connections that way. Then I have my Java code do a JNDI lookup to access them, do the required database operation, and then close the connection to return it to the pool.
How can I start a bean and keep it running and how do I access its methods from other beans?
Is this even feasible? I'm not sure I know what you mean by "start a bean and keep it running". HTTP is a request/response, stateless protocol. You should think about operations as being initiated by a request and then going out of scope once the response is generated, much like the protocol itself. You don't keep a bean running in that case.
if I declare the scope of the bean as the application would I have to put it in all the pages of the web
site or not?You have to <jsp:useBean> in every page that needs it. Whether or not application scope is really appropriate or necessary is another matter.
Also, should I just forget about JavaBeans and do Servlets? You can and should use JSP for View, a servlet as your front controller, and JavaBeans to do the work in the back. It's not an either/or question. You really should be using all three.
Maybe EJB is better for this?You use EJBs if you have a highly transactional, distributed, clustered application. If none of those things apply to you, there's no reason why you must use EJBs.
Have a look at the Struts and Spring frameworks.
Similar Messages
-
Hi im trying to access my ORACLE database through a jsp program. The page loads up in the browser, no errors or anything like that, but i get no output.
I am running things on localhost with TomCat 3.2.3
Here is the code, any help gratefully appreciated.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Testing Database Access</TITLE>
</HEAD>
<BODY BGCOLOR="#FDF5E6" TEXT="#000000" LINK="#0000EE"
VLINK="#551A8B" ALINK="#FF0000">
<CENTER>
<TABLE BORDER=5 BGCOLOR="#EF8429">
<TR><TH CLASS="TITLE">
Testing Database Access</TABLE>
</CENTER>
<P>
<P>
Here Is what Might be in the Database
<P>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="oracle.jdbc.driver.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%
try
%>
<%
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String username = "Donnchadh", password = "zcbu5mya";
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@kiwi.isg.computing.dcu.ie:1521:kiwi",username,password);
java.sql.Statement stmt = conn.createStatement();
String query = "SELECT * FROM PERSONALS";
ResultSet rs = stmt.executeQuery(query);
while(rs.next())
int ccount = rs.getMetaData().getColumnCount();
for( int i = 1; i <= ccount; i++ )
System.out.print(rs.getString(i)+"\t");
System.out.println();
%>
<%
rs.close();
stmt.close();
if(conn != null)
try
conn.close();
catch(Exception e)
return;
catch(Exception e)
return;
%>
<P>
</BODY>
</HTML>
I have also tried to access columns directly with this code in the while loop
while(rs.next())
String Title = rs.getString("title");
String FName = rs.getString("fname");
String LName = rs.getString("lname");
String Phone = rs.getString("phone1");
String Phone2 = rs.getString("phone2");
String Addr = rs.getString("addr");
String County = rs.getString("county");
String Country = rs.getString("country");
out.println("<tr><td>" + Title + "</td><td>" + FName + "</td><td>" + LName
+ "</td><td>" + Phone + "</td><td>" + Phone2 + "</td></tr>" + "</td></tr>" + Addr
+ "</td></tr>" + County + "</td></tr>" + Country + "</td></tr>" );i give a servlet access to oracle ,that have test ok!
import java.sql.*;
import javax.servlet.*;
import javax.sql.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class TestServlet1 extends HttpServlet {
private static final String CONTENT_TYPE = "image/jpeg; charset=GBK";
//Initialize global variables
String strRno =null;
ResultSet rs=null;
byte [] buf=null;
InputStream in;
int IntNo;
public void init() throws ServletException {
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
// PrintWriter out = response.getWriter();
// System.out.println("TEst database prepaired ok��");
strRno = request.getParameter( "PictNo" );
IntNo = 0;
if( strRno != null ) {
try { IntNo = Integer.parseInt( strRno ); }
catch( NumberFormatException e ) {
strRno = null;
System.out.println("��������������������"); }
else
System.out.println("��������������������");
if( strRno == null ) {
// response.sendError( HttpServletResponse.SC_NOT_FOUND );
return;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
catch (ClassNotFoundException ex2) {
// out.println("TEst2��");
// System.out.println("TEst2�� ex2��");
String url="jdbc:oracle:thin:@erdos00:1521:erdos";
Connection con = null;
try {
con = DriverManager.getConnection(url, "system", "manager");
catch (SQLException ex1) {
//out.println("TEst�� ex1");
System.out.println("TEst�� ex1��");
// PreparedStatement sql=con.PrepareStatement("select photo from blob_test WHERE rno = IntNo" );
PreparedStatement sql = null;
try {
sql = con.prepareStatement("select photo from blob_test WHERE rno = 14 ");
// sql = con.prepareStatement("select photo from blob_test WHERE rno = " +"+ IntNo +" );
catch (SQLException ex) {
//out.println("TEst�� ex");
System.out.println("TEst�� ex��");
//method prepareStatement(sting) not found in interface java.sql.connection
// sql.setInt( 1, rno );
try {
rs = sql.executeQuery();
catch (SQLException ex3) {
//out.println("TEst�� ex3");
System.out.println("TEst�� ex3");
System.out.println("TEst database operate ok��");
// out.println("TEst database operate ok��");
//��������������������
try {
if (rs.next()) {
buf = rs.getBytes(1);
in = rs.getBinaryStream("photo");
else {
buf = new byte[0];
}catch (Exception e){
//throw e;
response.reset();
//������image/jpeg������������������������
response.setContentType("image/bmp");
// ��bmp��jpeg
byte[] b = new byte[1024*1024];
int len;
while((len=in.read(b)) >0)
response.getOutputStream().write(b,0,len);
OutputStream out1 = response.getOutputStream();
out1.flush();
out1.write(buf);
in.close();
try {
rs.close();
catch (SQLException ex4) {
// out.println("<html>");
// out.println("<img src='http://192.168.0.1/examples/servlet/TestServlet1?PictNo="+IntNo+"'>");
// out.println("</html>");
out.println("<html>");
out.println("<head><title>TestServlet</title></head>");
out.println("<body bgcolor=\"#ffffff\">");
out.println("<p>The servlet has received a GET111111111. This is the reply.</p>");
out.println("</body></html>");
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>TestServlet</title></head>");
out.println("<body bgcolor=\"#ffffff\">");
out.println("<p>The servlet has received a POST. This is the reply.</p>");
out.println("</body></html>");
//Process the HTTP Put request
public void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//Process the HTTP Delete request
public void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//Clean up resources
public void destroy() {
hope u can get some thing from that -
Frequent Database Access through Java Mapping ?
I have to implement a Java Mapping Program which will require frequent database Access to compare and read table data from some other data base .
What is the most optimum procedure to implement it ?
Should i make a jdbc call every time from the code or should i use EJB(Session beans + Entity beans)...
or any other process besides these 2 to acheive maximum performance
Please Suggest
regards
Nilesh Taunk.Hi Nilesh,
I would suggest you to use XI DB Lookup API's for accessing Database. Eventhough it will not give you maximum performance, it will be very easy to change the configuration parameters in JDBC Adapter (No need for hardcoding user id/password/Driver details etc.) and you can refer the same in your Lookup API's.
Please refer the link: <a href="/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler Weblog</a>
Regards,
Ananth -
PJC and database access through JDBC
Hello,
I'm trying to access to the database through a PJC via JDBC.
conn = DriverManager.getConnection ("jdbc:oracle:thin:@machine:1521:XE", "user", "pwd");It works fine on a XE database, but fails on another XE one:
Oracle JInitiator: Version 1.3.1.22
java.lang.NullPointerException
at oracle.jdbc.ttc7.O3log.marshal(O3log.java:606)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:255)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:377)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:515)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:345)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at oracle.forms.fd.AsyncJob.connect(AsyncJob.java:68)
at oracle.forms.fd.AsyncJob.run(AsyncJob.java:121)
at java.lang.Thread.run(Unknown Source)It also fails on a remote Unix database:
java.security.AccessControlException: access denied (java.net.SocketPermission monadev resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
...so I edit the java.policy file of the Jinitiator directory:
permission java.net.SocketPermission "machine:port-", "accept,connect,listen,resolve"; and then get the same execption:
java.lang.NullPointerException
at oracle.jdbc.ttc7.O3log.marshal(O3log.java:606)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:255)
...Finally, it work on only one machine and only a local database.
I'm probably missing something somewhere.
Is anyone could give me some light on this ?
Thanks in advance,
FrancoisI'm just learning to work with PJC's, so I'm unsure whether I can help, but here goes. I found the following archived on Google Groups (http://groups.google.com):
Hi. The basic applet security model is that it can only make connections
back to the machine from which it was downloaded. If you want to do
JDBC from an applet to a DBMS not on the applet-server machine,
you need a type-3 JDBC driver. A type-3 JDBC driver has an all-Java
client driver piece which an applet can download and use. This driver
piece connects to a proxy piece which is running on the webserver
machine. This proxy piece then connects to any DBMS anywhere on the
net, and is the middleman between the JDBC client and DBMS.
For security, management and performance reasons it's usually better to
constrain JDBC to a middle tier such as in a servlet, and use HTML to and
from the client, rather than the space and time involved in downloading a
full general query engine (a JDBC driver) to a client which typically uses
.1% of the capability or classes of the JDBC driver.
Joe Weinstein at BEA HTH,
Eric Adamson
Lansing, Michigan -
Database access by Bean, error in JSP(view)
Hello,
I have a web application. All my database connection logic, execution of query is done in my bean. I have verified that the code in my bean is fine and so I have not posted that code.
My jsp code is as follows:
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<html>
<head><title>Trial JSP Page</title>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-STORE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PRIVATE">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</head>
<jsp:useBean id="data" class="com.bean.samples.ConnectionBean"/>
<jsp:setProperty name="data" property="drivername" value="oracle.jdbc.driver.OracleDriver"/>
<jsp:setProperty name="data" property="url" value="jdbc:oracle:thin:@someurl"/>
<jsp:setProperty name="data" property="username" value="name"/>
<jsp:setProperty name="data" property="password" value="passwd"/>
<jsp:setProperty name="data" property="query" value="SELECT * FROM tablename"/>
<%
data.processQuery();
ResultSet rs = data.getRs();
ResultSetMetaData rsmd = data.getRsmd();
%>
<body text="black">
The table has <jsp:getProperty name="data" property="count"/> columns and <jsp:getProperty name="data" property="rowcnt"/>
rows in it.
The first column name is <%= rsmd.getColumnLabel(1) %>.
The current row is <%= rs.getRow() %>.
</pre>
</body>
</html>
Output of browser:
The table has 2 columns and 6 rows in it. The first column name is ITEMNO. The current row is
Error: 500
Location: /schedule/jsp/Trial.jsp
Internal Servlet Error:
java.lang.IllegalStateException: Response has already been committed
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.IllegalStateException(java.lang.String)
void org.apache.tomcat.core.HttpServletResponseFacade.sendError(int, java.lang.String)
void org.apache.jasper.runtime.JspServlet.unknownException(javax.servlet.http.HttpServletResponse, java.lang.Throwable)
void org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection, java.lang.Object [])
void org.apache.tomcat.service.TcpConnectionThread.run()
void java.lang.Thread.run()
Error is being thorwn on the statemnt:
The current row is <%= rs.getRow() %>.
Can anyone help with this?
Thanks in advance.Hi beattris,
No I dont close the rs and conn objects.
The relevant method of my bean is :
public void processQuery() throws Exception{
try{
Class.forName(getDrivername());
conn = DriverManager.getConnection(getUrl(),getUsername(),getPassword());
st = conn.createStatement();
rs = st.executeQuery(getQuery());
rsmd = rs.getMetaData();
int columncount = rsmd.getColumnCount();
int rowcount = 0;
setCount(columncount);
while(rs.next()){
rowcount++;
setRowcnt(rowcount);
}catch(Exception e){
throw e;
I did some searching on the internet for this error and found that it is tricky one and so far I havent found a way to correct it.
The link i went to were:
http://developer.java.sun.com/developer/Books/ProJSP/Chap19.pdf
and
http://archives2.real-time.com/rte-tomcat/2000/Jun/msg02490.html
Well, I hope I get some answers soon.
Thanks. -
Regarding database access through jndi
Hi All,
Plz tell me the steps.
I want to access data from MS Access, and i want to do it using JNDI .
what should be added in struts-config.xml, web.xml .
if any one have example code that will be better to understand.Nothing necessary added to struts-config.xml
What server are you using? The JNDI configuration for each server is slightly different.
The page for Tomcat is here: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
I would follow that apart from instead of editing server.xml, put the JNDI configuration in a "mycontext.xml" file as defined here:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Automatic%20Application%20Deployment
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
Cheers,
evnafets -
Database access from session bean
Hello,
I have a stateless session bean which performs some complex
calculations, and also does some database access.
For the database access the bean class has a datasource as
follows:
public class TestBean implements SessionBean {
private DataSource ds_;
public void ejbCreate() {
getDataSources();
private void getDataSources() {
try {
Context ictx = new InitialContext();
ds_ = (DataSource)ictx.lookup("java:comp/env/jdbc/TestDB");
} catch (Exception e) {
e.printStackTrace();
throw new EJBException(e);
Now this class has a method (which is also in the remote interface)
calculateSomething(). This method constructs a number of other
objects that do the actual calculation, and one of these objects
does the actual database access. How would another object be able to
use the datasource that was constructed in the bean class?
I could pass the datasource reference to that object, but that would
break my encapsulation. This is because that object does not get
created directly by the bean object, but rather the way the objects
interact is something like A -> B -> C, where A is the TestBean, and
C is the object that does the DB access. If I passed the datasource,
I would need to make B aware of the datasource, which doesn't
seem good design, because B doesn't do any database access.
Alternatively I could do the lookup in class C, but that would
degrade the performance, as an object C gets created and destroyed
every time the calculateSomething() method is called.
A third option I have thought of, is to add a public method to the
bean that returns a connection. Whenever another object gets
created, a reference to the bean object will be passed along. Then,
if another object needs to do database access, it will call back
the bean to get a connection. This seems just as bad (if not worse)
than the first option.
Does anyone have an elegant solution for this situation? What is
the best practice of handling datasources when a bean class doesn't
do the database access itself? In all the examples I've seen so far,
all the functionality was in the session bean class, but again that
doesn't seem good OO design, and would result in a single huge class.
regards,
KostasThanks again to both for the replies. Here are my responses:
Yi Lin: Yes, I know that an entity bean would solve this problem, however it has been decided not to use entity beans so this is not my call (I think the reason entity beans are not allowed in this project is that they are considered risky: there are other applications that access the same database, so if the container caches entity bean data as you describe, then the users might get inconsistent results).
Gerard: Actually object B is the one that has the business logic and C is a peer object that only does database access and no calculaitons. For example B can be Customer, and C CustomerDB. This is why object B does not have any knowledge of datasources or connections. So my design does not appear to be that bad!
As far as the factory you propose is concerned, I cannot understand how this would solve my problem. In order to solve this situation the factory would need to be persistent, i.e. get created by the ejbCreate() method, and destroyed whenever the container decides to destroy the bean. There would be no point in object C creating the factory, as I would have the overhead of doing the JNDI lookup every time I create a C.
So the question remains the same: how would I pass a reference to the factory from A to C without making B aware of it? -
Accessing add() methods through bean properties ?!
I hope this question is trivial...
Is there a defined way of using add(*) methods through bean properties ?
Seems a little odd that Swing components can't be added to a container in a simple "bean-like" way....is there a set*(*) method I've missed ? I'm aware of the getComponents() method on Container...but there's no setComponents(Component []) method.
Thanks,
Michael.Thank you for the repsonse....but..
Wouldn't that mean that I'd have to sub-class all the Components I wanted to use....just to add the set*(*) method....isn't there a tidier way ?
I really find this strange...(I can think of many examples where accessing the add*(*) methods through introspection (possibly by providing set*(*) methods) would be extremely useful....but, staying in a Swing context....)
If you wanted to create an application that can load, edit and save GUI forms (as many already have). Having all Swing components stick to the javaBeans spec. is very useful. The application can use introspection to grab all the properties of a component, without having any hard-coded logic on dealing with specific classes. Users can then provide their own extensions to the components palette, and by sticking to the javaBeans convention, have the GUI editor expose those properties.
But....to compose components together (a fundamental concept) the editor must be provided with "hard-coded" logic that knows how to deal specifically with Components (in that they have an add(*) method).
This must also be a problem with the XMLDecoder class ?!
When encoding a Swing component, the XMLEncoder can use all the get*() methods (including getComponents()) to persist the Container, its properties, and any sub-components....fine.
But, when decoding this information, all the properties can be set through the usual bean mechanism (using the corresponding setPropertyName(*) method) except the sub-components....there is no setComponents(*) method.
How does the XMLDecoder get around this problem ?
Does it "know" that when it gets to the "components" property of a Swing component, it must call the add(*) method instead...?
Thanks,
Michael -
NON-transactional session bean access entity bean
We are currently profiling our product using Borland OptmizeIt tool, and we
found some interesting issues. Due to our design, we have many session beans which
are non transactional, and these session beans will access entity beans to do
the reading operations, such as getWeight, getRate, since it's read only, there
is no need to do transaction commit stuff which really takes time, this could
be seen through the profile. I know weblogic support readonly entity bean, but
it seems that it only has benefit on ejbLoad call, my test program shows that
weblogic still creates local transaction even I specified it as transaction not
supported, and Transaction.commit() will always be called in postInvoke(), from
the profile, we got that for a single method call, such as getRate(), 80% time
spent on postInvoke(), any suggestion on this? BTW, most of our entity beans are
using Exclusive lock, that's the reason that we use non-transactional session
bean to avoid dead lock problem.
ThanksSlava,
Thanks for the link, actually I read it before, and following is what I extracted
it from the doc:
<weblogic-doc>
Do not set db-is-shared to "false" if you set the entity bean's concurrency
strategy to the "Database" option. If you do, WebLogic Server will ignore the
db-is-shared setting.
</weblogic-doc>
Thanks
"Slava Imeshev" <[email protected]> wrote:
Hi Jinsong,
You may want to read this to get more detailed explanation
on db-is-shared (cache-between-transactions for 7.0):
http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1127563
Let me know if you have any questions.
Regards,
Slava Imeshev
"Jinsong HU" <[email protected]> wrote in message
news:[email protected]...
Thanks.
But it's still not clear to me in db-is-shared setting, if I specifiedentity
lock as database lock, I assumed db-is-shared is useless, because foreach
new
transaction, entity bean will reload data anyway. Correct me if I amwrong.
Jinsong
"Slava Imeshev" <[email protected]> wrote:
Jinsong,
See my answers inline.
"Jinsong Hu" <[email protected]> wrote in message
news:[email protected]...
Hi Slava,
Thanks for your reply, actually, I agree with you, we need to
review
our db
schema and seperate business logic to avoid db lock. I can not say,guys,
we need
to change this and that, since it's a big application and developedsince
EJB1.0
spec, I think they are afraid to do such a big change.Total rewrite is the worst thing that can happen to an app. The
better aproach would be identifying the most critical piece and
make a surgery on it.
Following are questions in my mind:
(1) I think there should be many companies using weblogic serverto
develop
large enterprise applications, I am just wondering what's the maintransaction/lock
mechanism that is used? Transional session / database lock,
db-is-shared
entity
I can't say for the whole community, as for my experience the standard
usage patthern is session fasades calling Entity EJBs while having
Required TX attribute plus plain transacted JDBC calls for bulk
reads or inserts.
is the dominant one? It seems that if you speficy database lock,
the
db-is-shared
should be true, right?Basically it's not true. One will need db-is-shared only if thereare
changes
to the database done from outside of the app server.
(2) For RO bean, if I specify read-idle-timeout to 0, it shouldonly
load
once at the first use time, right?I assume read-timeout-seconds was meant. That's right, but if
an application constantly reads new RO data, RO beans will be
constantly dropped from cache and new ones will be loaded.
You may want to looks at server console to see if there's a lot
of passivation for RO beans.
(3) For clustering part, have anyone use it in real enterpriseapplication?
My concern, since database lock is the only way to choose, how aboutthe
affect
of ejbLoad to performance, since most transactions are short live,if high
volume
transactions are in processing, I am just scared to death about
the
ejbLoad overhead.
ejbLoad is a part of bean's lifecycle, how would you be scared ofit?
If ejbLoads take too much time, it could be a good idea to profile
used SQLs. Right index optimization can make huge difference.
Also you may want cosider using CMP beans to let weblogic
take care about load optimization.
(4) If using Optimization lock, all the ejbStore need to do
version
check
or timestamp check, right? How about this overhead?As for optimistic concurrency, it performs quite well as you can
use lighter isolation levels.
HTH,
Slava Imeshev
"Jinsong Hu" <[email protected]> wrote in message
news:[email protected]...
We are using Exclusive Lock for entity bean, because of we do
not
want
to
load
data in each new transaction. If we use Database lock, that means
we
dedicate
data access calls to database, if database deadlock happens,
it's
hard
to
detect,
while using Exclusive lock, we could detect this dead lock in
container
level.
The problem is, using Exclusive concurrency mode you serialize
access to data represented by the bean. This aproach has negative
effect on ablity of application to process concurrent requests.As
a
result the app may have performance problems under load.
Actually, at the beginnning, we did use database lock and usingtransactional
The fact that you had database deadlocking issues tells that
application logic / database schema may need some review.
Normally to avoid deadlocking it's good to group database
operations mixing in updattes and inserts into one place so
that db locking sequence is not spreaded in time. Moving to
forced serialized data access just hides design/implementation
problems.
session bean, but the database dead lock and frequent ejbLoad
really
kill
us,
so we decided to move to use Exclusive lock and to avoid dead
lock,
we
change
some session bean to non-transactional.Making session beans non-transactions makes container
creating short-living transactions for each call to entity bean
methods. It's a costly process and it puts additional load to
both container and database.
We could use ReadOnly lock for some entity beans, but since weblogicserver will
always create local transaction for entity bean, and we found
transaction
commit
is expensive, I am arguing why do we need create container leveltransaction for
read only bean.First, read-only beans still need to load data. Also, you may seeRO
beans
contanly loading data if db-is-shared set to true. Other reason
can
be
that
RO semantics is not applicable the data presented by RO bean (forinstance,
you have a reporting engine that constantly produces "RO" data,
while
application-consumer of that data retrieves only new data and neverasks
for "old" data). RO beans are good when there is a relatively stable
data
accessed repeatedly for read only access.
You may want to tell us more about your app, we may be of help.
Regards,
Slava Imeshev
I will post the performance data, let's see how costful
transaction.commit
is.
"Cameron Purdy" <[email protected]> wrote:
We are currently profiling our product using Borland
OptmizeIt
tool,
and we
found some interesting issues. Due to our design, we have
many
session
beans which
are non transactional, and these session beans will access
entity
beans
to
do
the reading operations, such as getWeight, getRate, since
it's
read
only,
there
is no need to do transaction commit stuff which really takes
time,
this
could
be seen through the profile. I know weblogic support readonly
entity
bean,
but
it seems that it only has benefit on ejbLoad call, my test
program
shows
that
weblogic still creates local transaction even I specified
it
as
transaction not
supported, and Transaction.commit() will always be called
in
postInvoke(),
from
the profile, we got that for a single method call, such as
getRate(),
80%
time
spent on postInvoke(), any suggestion on this? BTW, most of
our
entity
beans are
using Exclusive lock, that's the reason that we use
non-transactional
session
bean to avoid dead lock problem.I am worried that you have made some decisions based on an improper
understand of what WebLogic is doing.
First, you say "non transactional", but from your description
you
should
have those marked as tx REQUIRED to avoid multiple transactions
(since
non-transactional just means that the database operation becomesits
own
little transaction).
Second, you say you are using exclusive lock, which you shouldonly
use
if
you are absolutely sure that you need it, (and note that it
does
not
work in
a cluster).
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com/coherence.jsp
Tangosol Coherence: Clustered Replicated Cache for Weblogic
"Jinsong Hu" <[email protected]> wrote in message
news:[email protected]...
> -
Jsp database access using odbc - please help
Hi friends,
I�m trying a very simple database access program in jsp data base access using odbc. Odbc has to be used because thin driver or other drivers may not be available in every system of our college and as you know it's not that easy to make changes to those systems. My problem is so simple. I always get an exception in my program.
My jsp content is as simple as:
<%@ page import="java.lang.*,java.sql.*,java.io.*,registerbean" %>
<jsp:useBean id="db" class="registerbean" scope="session"/>
<%
String str="insert into reg values('" + db.getName() + "','" + db.getUname() + "','" + db.getPass() + "'," + db.getAge() + ",'" + db.getSex() + "','" + db.getAdd() + "','" + db.getUgcourse() + "','" + db.getUgqual() + "'," + db.getPer() + ",'" + db.getIadd() + "')";
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:yogaesh","scott","tiger");
Statement stmt=con.createStatement();
stmt.executeUpdate(str);
}catch(Exception e1){out.println(str);};
%>
the table reg has the structure:
Name Null? Type
CNAME VARCHAR2(20)
UNAME VARCHAR2(20)
CPSWD VARCHAR2(20)
CONFPASS VARCHAR2(20)
CAGE NUMBER
CSEX VARCHAR2(5)
CADD VARCHAR2(100)
COURSE NUMBER
CQUAL VARCHAR2(10)
CPER NUMBER
IADD VARCHAR2(100)
The registerbean.java file is as below: (This seems to work fine because I tried printing the values using <%= %> tag and it worked out fine and moreover the query string is intact.)
import java.io.*;
import java.util.*;
import java.lang.*;
public class registerbean
private String name,uname,pass,cpass,age,sex,add,ugcourse,ugqual,per,iadd,otherugqual,ccode;
public void setName(String a)
name=a;
public void setUname(String a)
uname=a;
public void setPass(String a)
pass=a;
public void setCpass(String a)
cpass=a;
public void setAge(String a)
age=a;
public void setSex(String a)
sex=a;
public void setAdd(String a)
add=a;
public void setOtherugqual(String a)
otherugqual=a;
public void setCcode(String a)
ccode=a;
public void setUgcourse(String a)
ugcourse=a;
public void setUgqual(String a)
ugqual=a;
public void setPer(String a)
per=a;
public void setIadd(String a)
iadd=a;
public String getName()
return(name);
public String getUname()
return(uname);
public String getPass()
return(pass);
public String getCpass()
return(cpass);
public String getAge()
return(age);
public String getCcode()
return(ccode);
public String getSex()
return(sex);
public String getAdd()
return(add);
public String getUgcourse()
return(ugcourse);
public String getUgqual()
return(ugqual);
public String getPer()
return(per);
public String getIadd()
return(iadd);
public String getOtherugqual()
return(otherugqual);
I initially thought the problem was with str but then str seems to be perfect and I get a string of the form �insert into reg values('c','c','c',98,'Male','c','B.Tech, Applied Artificial Neural Networks','HSC',9898,'h')� which I verified through a javascript debugger. The session scope used is to get values through the db bean from another jsp file. The problem is in the executeUpdate() line of this code. I even tried changing the updation table, but in vain. What could be done to rectify this? Please help me out and please do remember that I have no option but to use odbc.
Thanks in advance.
R. Yogaesh.I didn't verify the type of exception and i'm now going to do that, but then when the string is as perfect as needed, what is the need for a prepared statement? What is the basic difference between the two? And basically what is the problem with this piece of code which creates an exception? Please reply as soon as possible.
Thankyou very much.
R. Yogaesh. -
Multiple users accessing entity bean with same PK
Hi,
Some body please clarify the below issue.
(EJB 1.1, WAS3.5)
I have two app servers and two clones each clone is running in each app server.
Stateful session bean access Entity beans to update/read record in the database.
According to my requirement multiple users can access the same entity data (same primary key). Suppose user A created a Stateful session bean SB1 and the SB1 created Entity1 with PK1, this is happening at clone1.
User B accessed the site and the request went to Clone2 and a new SB2 created, but the SB2 need to access the database with Same PK1.
For the above situation, I guess container can not create a new Entity bean with PK1 because EB with PK1 is already there and it tries to allocate same EB1 with SB2, so if two requests are concurrent do the SB2 wait to get the handle of the EB1?
Is there any way to create two Entity beans with same Primary Key at the same time but in different clone?
Thanks,
SagarHi,
The concurrency level has to be set at the level of database and the database will take care of consistency & integrity of the data. So specity the concurrency level on the database connection in each appserver. -
Regarding Provisioning a user to Database Access Tables
Hi,
I've just completed with the installation of OIM 9101 and upgradation of 9101 to 9102. I'm facing a bit wierd. When I try to create a GTC for the Database Access Tables, I'm not able to see Database Access Tables option, in the drop down list for the Transport Provider.
I'm a bit confused if I've wrongly upgraded the system or if at all i've missed out some step. Though OIM seems to be ok and working fine.
Any suggestions as to how to solve this ?
Regards
NikhilThanks Prakash,
The issue has been resolved.
I'd like a bit more of your help. I'm facing an error as follows :
2011-04-14 12:21:52,074 ERROR [XELLERATE.GC.PROVIDER.TRANSFORMATION] Could not transform the data
java.lang.NullPointerException
at com.thortech.xl.gc.util.TransformationEngine.doTransformation(Unknown Source)
at com.thortech.xl.gc.util.TransformationEngine.transform(Unknown Source)
at com.thortech.xl.gc.runtime.GCAdapterLibrary.executeFunctionality(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpDBAT_PROVISIONING1_GTC.GENERICADAPTER(adpDBAT_PROVISIONING1_GTC.java:125)
at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpDBAT_PROVISIONING1_GTC.implementation(adpDBAT_PROVISIONING1_GTC.java:70)
at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
at com.thortech.xl.dataobj.tcORC.insertNonConditionalMilestones(Unknown Source)
at com.thortech.xl.dataobj.tcORC.completeSystemValidationMilestone(Unknown Source)
at com.thortech.xl.dataobj.tcOrderItemInfo.completeCarrierBaseMilestone(Unknown Source)
at com.thortech.xl.dataobj.tcOrderItemInfo.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcUDProcess.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(Unknown Source)
at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(Unknown Source)
at com.thortech.xl.ejb.beans.tcFormInstanceOperationsSession.setProcessFormData(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy769.setProcessFormData(Unknown Source)
at Thor.API.Operations.tcFormInstanceOperationsClient.setProcessFormData(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
at Thor.API.Security.LoginHandler.jbossLoginSession.runAs(Unknown Source)
at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
at $Proxy813.setProcessFormData(Unknown Source)
at com.thortech.xl.webclient.actions.DirectProvisionUserAction.handleVerifyProcessData(Unknown Source)
at com.thortech.xl.webclient.actions.DirectProvisionUserAction.goNext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
2011-04-14 12:21:52,074 ERROR [XELLERATE.GC.PROVIDER.TRANSFORMATION] Could not transform the data
com.thortech.xl.gc.exception.ProviderException: GCPROV.ADAPTER_INPUTSTR_MISSING
at com.thortech.xl.gc.util.TransformationEngine.doTransformation(Unknown Source)
at com.thortech.xl.gc.util.TransformationEngine.transform(Unknown Source)
at com.thortech.xl.gc.runtime.GCAdapterLibrary.executeFunctionality(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpDBAT_PROVISIONING1_GTC.GENERICADAPTER(adpDBAT_PROVISIONING1_GTC.java:125)
at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpDBAT_PROVISIONING1_GTC.implementation(adpDBAT_PROVISIONING1_GTC.java:70)
at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
at com.thortech.xl.dataobj.tcORC.insertNonConditionalMilestones(Unknown Source)
at com.thortech.xl.dataobj.tcORC.completeSystemValidationMilestone(Unknown Source)
at com.thortech.xl.dataobj.tcOrderItemInfo.completeCarrierBaseMilestone(Unknown Source)
at com.thortech.xl.dataobj.tcOrderItemInfo.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcUDProcess.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(Unknown Source)
at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(Unknown Source)
at com.thortech.xl.ejb.beans.tcFormInstanceOperationsSession.setProcessFormData(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy769.setProcessFormData(Unknown Source)
at Thor.API.Operations.tcFormInstanceOperationsClient.setProcessFormData(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
at Thor.API.Security.LoginHandler.jbossLoginSession.runAs(Unknown Source)
at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
at $Proxy813.setProcessFormData(Unknown Source)
at com.thortech.xl.webclient.actions.DirectProvisionUserAction.handleVerifyProcessData(Unknown Source)
at com.thortech.xl.webclient.actions.DirectProvisionUserAction.goNext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
This Error seems to occur because I was trying to attach certain pre-prop adapters within the default process form that is created while installing the connector. Roaming around the threads here, I came to know that this might be the problem as pre-props don't work fine when applied to the GTC's default form.
To overcome this problem, I've thought of a solution wherein I should create a new Custom Process Form and then apply my pre-props. But for this approach, I'm stuck into the middle. How can I apply a new Custom Form to an existing Provisioning Process ? Is this fesiable ? If yes, where should the changes be made ?
I tried changing the Table Name inside the GTC's provisioning process so that GTC can pick up the my new process form instead of its default process form, but that again gives an error saying :
com.thortech.xl.orb.dataaccess.tcDataAccessException: DB_READ_FAILEDDetail: SQL: select err_key, err_code, err_desc, err_rowver, err_remedy, err_count, err_last_occurance, err_action, err_help_url, err_severity from err where err_code='DOBJ.UPDATE_FAILED'Description: Got a null connectionSQL State: Vendor Code: 0Additional Debug Info:com.thortech.xl.orb.dataaccess.tcDataAccessException
I hope the scenario is clear to you and i'm able to explain upto the mark .. :(
Kindly help me out..
Regards
Nikhil -
simple idea, impossble method.
I am training to allow acces to a local database either through Flash, Captivate or other application. The only issues are i need to do it without internet access or the executable being installed on user machine.
So unless im an missing something, that rules out AS3, Javascript ( as i cannot rely on all user having a virtual server to run php) or use of Abode Air.
If there is a way or something that i am completey over looking please tell me.apg wrote:
Where does the lag occur? In the original post you say it's after
When I initiate pacman -Syu, during the "Synchronizing package database..." dialogue it lags for way too long.
but then later you say
Typically that dialogue lasts for like half a second before going straight to the mirror. This lags for about 15-20 seconds or so.
I'm referring to the same "Synchronizing package database..." dialogue. I'm watching the internet monitor to see if during that time its pinging the mirrors, but there is no internet activity for a good while. Which suggests it could be related to a lag in accessing the local database on my desktop.
rgedit: I should be more specific. Typically the Synchronizing package database dialogue would take maybe .5 of a second but since about three days ago it is taking much longer. Even after changing the mirrorlist (even switching the top mirror in the mirrorlist file) and issuing the "pacman-optimize && sync" command I still get the same results.
Last edited by rg_arc (2014-11-07 21:42:39) -
JNDI Naming Problem accessing Session Bean from Message Driven Bean
Hi,
I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocator (I have implemented ServiceLocator pattern to obtain JNDI reference for all EJBs). When I am calling the session fa�ade EJB from the Struts Action class everything is working fine.
But when I am trying to call the same EJB from my Message Driven Bean, I am getting a JNDI exception (NameNotFoundException - No Object bound to name �java:comp/env/ejb/EJBJNDIName�). I am trying to get the remote reference from the same ServiceLocator which is successfully providing me a reference while calling from the struts action class. But the same ServiceLocator is not able to provide me a reference while calling from the Message Driven Bean. If I use the JNDI name directly like �EJBJNDIName� in the lookup it is working fine. The lookup for the name is working fine and I am able to call the Session Fa�ade bean with that reference.
I am really not sure what exactly the problem is. If I have any problem in the ServiceLocator, it should have given me the same error while calling from Struts Action class. But it is working fine with the full name �java:comp/env/ejb/EJBJNDIName� calling from the struts action class. I am not sure whether Message Driven Bean has something to do with it. Why I am not able to get a reference of the EJB with the full name? Please Help.
Thanks
AmitHi Bhagya,
Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
Thanks
Amit -
Attachment access through smartforms
Hi,
I have a requirement in smartforms, like I need to open attachments of a word documents from smartform output which is a PDF.
I would like to provide hyperlinks in smartform output, if which is clicked then saved word documents should be called and opened from DMS.
No worry of word documents which are saved in DMS, just it need to be triggered and opened when the hyper link is clicked which is in smartform output(pdf).
If any idea is there to solve this....please reply/suggest.
Thanks in advance.user3636719 wrote:
Hello Guru’s,
I am working for a client where if you have access to server with few commands it will give you password for system.
My question is how you can track who did what if too many people have access through system.
select * from v$versionBANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for HPUX: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
Change their OS passwords so they can no longer log onto DB Server system.
Only DBA needs to log directly onto DB Server system; not even System Admins.
Maybe you are looking for
-
Several problems after updating to 10.4.9
Hi all, my powerbook G4 1.33 was running prefrectly well for the last years using 10.3.9. I bought v 10.4.9 and installed it on a brand new internal disk. then imported prefs, apllications, files and folders from the original disk they were installed
-
Create own views in the Fact Sheet
Hi Forum, I am trying to create my own views in the fact sheet. for instance open opportunities,closed oppportunities,open leads,closed leads... w.r.t a particular BP. plz guide how this can be achieved. Kind Regards! Lucas
-
With Warnings turned on, I get an 'Event Data Node: cluster has unnamed or duplicate named elements' warning for every event case with the detail of 'The cluster being bundled or unbundled by name has elements with no name, or elements with the same
-
ATI Catalyst 9.2 and "Incompatible display adapter has been disabled."
Hi, I have this issue... on 3 GPUs. Only one is working. 2 x 3870x2 in crossfire / Vista x64 SP1 I tried everything possible : uninstall all ATI software before, clean registry, delete files, temporary files, many uninstall and reboots, trying diffe
-
Reg : Interchange in decimal notation.
Hi Experts, We have 1 client 110 for development 210 for testing and its a cross client for 110. We have one more client 300 for Testing and then client 400 production System. I am facing problem in Client 300. As in client 110 we have developed a pr