You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Mahler Thomas <th...@itellium.com> on 2003/05/23 15:35:52 UTC

RE: OJB_HL_SEQ behavior (rollback like...)

Hi Jim,

I'm not providing support on a personal basis, I forwared your request to
the User mailinglist.

cheers,
Thomas

> -----Original Message-----
> From: jim martin [mailto:jmartin_sw@yahoo.com]
> Sent: Friday, May 23, 2003 1:18 PM
> To: thma@apache.org
> Subject: OJB_HL_SEQ behavior (rollback like...)
> 
> 
> Thomas,
> 
> 
> I've been using OJB_HL_SEQ in ojb 0.9 and I'm seeing
> three different but related problems with the
> sequencer.
> 
> 1)
> I'm seeing rollback-like behavior.
> In fact, I see in the Oracle DB logs that when the
> webapp
> is killed (restarted), Oracle does a bunch of system
> rollbacks
> because the updates hadn't been committed.
> (This is not just limited to updates to OJB_HL_SEQ).
> 
> 2)
> I'm seeing from the Oracle DB logs the
> "start transaction" event and then the "update" event,
> but no "commit" event on occasion.
> 
> 3)
> Lastly, I'm seeing, or rather not seeing on occasion
> any recorded
> activity in the DB logs for updates to sequences,
> and yet the sequencer gladly hands out new sequences.
> Since the DB never sees the updates for the OJB_HL_SEQ
> entries, the next time the server restarts, the
> sequencer
> starts at some old high value.
> 
> 
> Does this all sound consistent with a connection that
> had it's auto-commit behavior turned off that gets
> reused by updates for the sequences and the app?
> Was there any problem with abortTransaction()?
> 
> 
> 
> Commentary:
> It seems to me that there are several problems with
> the HL sequencer
> and perhaps a more general OJB problem.
> 
> First, the sequencer only examines the maximum if
> it never encountered that table before.
> It would be safer to check and compare the maximum
> with the saved table entry every time the application
> is restarted.
> This seems a small price to pay since it is only done
> once per restart
> and it avoids overwriting previously saved data using
> old indices.
> 
> Second, the sequencer should never give out a new
> sequence number
> if the update of the corresponding OJB_HL_SEQ is not
> committed.
> 
> 
> I believe I'm seeing these problems more than usual 
> because the database
> connections in my case get into some state where the
> DB connection
> is not lost, but the connection doesn't function. 
> This only
> occurs for some of the connections in the connection
> pool
> as there are multiple paths between the server and db
> machine
> intercede with multiple firewalls that occasionally
> die.
> 
> 
> Some general questions about OJB or perhaps my usage
> of OJB:
> 
> 1)
> Are all updates to be bracketed with:
> 	broker.beginTransaction
> 	.
> 	.
> 	broker.store(entry)
> 	broker.commitTransaction
> 
> 2)
> Can I guarantee that any update to a table is
> committed
> to the DB by just using:
> 
> 	broker.store(entry)
> 	broker.removeFromCache(entry);
> 
> 3)
> Besides the package names differences, what are the
> kinds
> of problems I might face if I tried to upgrade from
> 0.9 to 1.0rc3?
> 
> 4)
> It seems like there's been significant change in the
> OJB_HL_SEQ
> code in the rc releases.  Is there more change coming?
> 
> 
> Environment:
> j2ee running iPlanet Web Server 6.0
> jdbc:Oracle:oci8
> Using PB api
> singlevm
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 


Re: No Class Def Found Error!!!!

Posted by Leon <le...@hotmail.com>.
Hi Armin,
Thank you for your reply.
It is a little confusion on setting up classpath with Eclipse and Lomboz
plugging. I put all jar file I needed on the application classpath but
Lomboz cannot seen them. I have to put all of them in the Lomboz config then
weblogic saw them. In this case, I can see duplicate files on the app
classpath and I should ask for Lomboz community about that.
By fixing this problem, another occurred.Weblogic cannot find repository.xml
file when does
PersistenceBrokerFactoryFactory.instance().

 I packaged it together with OjbPbStartup class and put them on the weblogic
classpath.
Caused by: java.io.FileNotFoundException:
D:\bea\user_projects\mydomain\repository.xml (The system cannot find the
file specified)

A simple solution is put it in the dir shown above. But, it is not good for
maintenance and management of the project. Could I set up some path so that
weblogic can read this file from the startup package that is on the weblogic
classpath or from my app classpath? All the config files of OJB are
available on my app class path either.
Thanks again.

Leon


----- Original Message -----
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Saturday, May 24, 2003 3:26 AM
Subject: Re: No Class Def Found Error!!!!


> Hi Leon,
>
> > java.lang.NoClassDefFoundError:
> > org/apache/commons/lang/exception/NestableException
> >  at java.lang.ClassLoader.defineClass0(Native Method)
> >  at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>
> commons-lang.jar is in your classpath?
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "Leon" <le...@hotmail.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Saturday, May 24, 2003 6:24 AM
> Subject: No Class Def Found Error!!!!
>
>
> > Hi,
> >
> > I am using OJB0.9.9, Weblogic 7.0, Struts1.1 with Eclipse2.1 in
> developing a
> > project. I created a start up class followed steps posted on the OJB
> web
> > site. When my DAO try to get PB Factory from
> > PersistenceBrokerFactoryFactory.instance(), NoClassDefFoundError
> occured:
> >
> > ####<May 23, 2003 11:52:29 PM EDT> <Error> <HTTP> <developer>
> <myserver>
> > <ExecuteThread: '11' for queue: 'default'> <kernel identity> <>
> <101017>
> > <[ServletContext(id=5631398,name=WebContent,context-path=/WebContent)]
> Root
> > cause of ServletException>
> > java.lang.NoClassDefFoundError:
> > org/apache/commons/lang/exception/NestableException
> >  at java.lang.ClassLoader.defineClass0(Native Method)
> >  at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
> >  at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
> >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
> >  at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
> >  at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
> >  at java.security.AccessController.doPrivileged(Native Method)
> >  at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
> >  at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
> >  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
> >  at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
> >  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
> >  at java.lang.ClassLoader.defineClass0(Native Method)
> >  at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
> >  at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
> >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
> >  at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
> >  at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
> >  at java.security.AccessController.doPrivileged(Native Method)
> >  at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
> >  at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
> >  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
> >  at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
> >  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
> >  at java.lang.Class.forName0(Native Method)
> >  at java.lang.Class.forName(Class.java:140)
> >  at
> >
> org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.class$(Un
> know
> > n Source)
> >  at
> >
> org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.load(Unkn
> own
> > Source)
> >  at
> >
> org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.
> <ini
> > t>(Unknown Source)
> >  at
> >
> org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.<init>(Un
> know
> > n Source)
> >  at
> >
> org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<init>(Unk
> nown
> > Source)
> >  at
> >
> org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<clinit>(U
> nkno
> > wn Source)
> >  at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
> > Source)
> >  at
> >
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unkn
> own
> > Source)
> >  at
> org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:44)
> >  at
> com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:49)
> >  at
> >
> com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryMan
> ager
> > BD.java:29)
> >  at
> >
> com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.
> java
> > :46)
> >  at
> >
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
> oces
> > sor.java:480)
> >  at
> >
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> 274)
> >  at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
> >  at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >  at
> >
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
> rvle
> > tStubImpl.java:1058)
> >  at
> >
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
> java
> > :401)
> >  at
> >
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
> java
> > :306)
> >  at
> >
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
> un(W
> > ebAppServletContext.java:5445)
> >  at
> >
> weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceMa
> nage
> > r.java:780)
> >  at
> >
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
> etCo
> > ntext.java:3105)
> >  at
> >
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
> java
> > :2588)
> >  at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> >  at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> >
> > This is a pice of code in my DAO class
> > InitialContext ctx = new InitialContext();
> >
> > OjbPbStartup pbs = (OjbPbStartup)ctx.lookup("PBFactory");
> >
> > PersistenceBrokerFactoryIF pbfif = pbs.getInstance();
> >
> > in OjbPbStartup class I have
> >
> > public PersistenceBrokerFactoryIF getInstance() {
> >
> > return PersistenceBrokerFactoryFactory.instance();
> >
> > }
> >
> > Could anybody help out?
> >
> > Leon
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

Re: No Class Def Found Error!!!!

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Leon,

> java.lang.NoClassDefFoundError:
> org/apache/commons/lang/exception/NestableException
>  at java.lang.ClassLoader.defineClass0(Native Method)
>  at java.lang.ClassLoader.defineClass(ClassLoader.java:502)

commons-lang.jar is in your classpath?

regards,
Armin

----- Original Message -----
From: "Leon" <le...@hotmail.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Saturday, May 24, 2003 6:24 AM
Subject: No Class Def Found Error!!!!


> Hi,
>
> I am using OJB0.9.9, Weblogic 7.0, Struts1.1 with Eclipse2.1 in
developing a
> project. I created a start up class followed steps posted on the OJB
web
> site. When my DAO try to get PB Factory from
> PersistenceBrokerFactoryFactory.instance(), NoClassDefFoundError
occured:
>
> ####<May 23, 2003 11:52:29 PM EDT> <Error> <HTTP> <developer>
<myserver>
> <ExecuteThread: '11' for queue: 'default'> <kernel identity> <>
<101017>
> <[ServletContext(id=5631398,name=WebContent,context-path=/WebContent)]
Root
> cause of ServletException>
> java.lang.NoClassDefFoundError:
> org/apache/commons/lang/exception/NestableException
>  at java.lang.ClassLoader.defineClass0(Native Method)
>  at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>  at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>  at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
>  at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>  at java.lang.ClassLoader.defineClass0(Native Method)
>  at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>  at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>  at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
>  at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>  at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:140)
>  at
>
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.class$(Un
know
> n Source)
>  at
>
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.load(Unkn
own
> Source)
>  at
>
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.
<ini
> t>(Unknown Source)
>  at
>
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.<init>(Un
know
> n Source)
>  at
>
org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<init>(Unk
nown
> Source)
>  at
>
org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<clinit>(U
nkno
> wn Source)
>  at
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
> Source)
>  at
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unkn
own
> Source)
>  at
org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:44)
>  at
com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:49)
>  at
>
com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryMan
ager
> BD.java:29)
>  at
>
com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.
java
> :46)
>  at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
oces
> sor.java:480)
>  at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
>  at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
>  at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
>
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
rvle
> tStubImpl.java:1058)
>  at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java
> :401)
>  at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java
> :306)
>  at
>
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
un(W
> ebAppServletContext.java:5445)
>  at
>
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceMa
nage
> r.java:780)
>  at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etCo
> ntext.java:3105)
>  at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java
> :2588)
>  at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
>  at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>
> This is a pice of code in my DAO class
> InitialContext ctx = new InitialContext();
>
> OjbPbStartup pbs = (OjbPbStartup)ctx.lookup("PBFactory");
>
> PersistenceBrokerFactoryIF pbfif = pbs.getInstance();
>
> in OjbPbStartup class I have
>
> public PersistenceBrokerFactoryIF getInstance() {
>
> return PersistenceBrokerFactoryFactory.instance();
>
> }
>
> Could anybody help out?
>
> Leon
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



No Class Def Found Error!!!!

Posted by Leon <le...@hotmail.com>.
Hi,

I am using OJB0.9.9, Weblogic 7.0, Struts1.1 with Eclipse2.1 in developing a
project. I created a start up class followed steps posted on the OJB web
site. When my DAO try to get PB Factory from
PersistenceBrokerFactoryFactory.instance(), NoClassDefFoundError occured:

####<May 23, 2003 11:52:29 PM EDT> <Error> <HTTP> <developer> <myserver>
<ExecuteThread: '11' for queue: 'default'> <kernel identity> <> <101017>
<[ServletContext(id=5631398,name=WebContent,context-path=/WebContent)] Root
cause of ServletException>
java.lang.NoClassDefFoundError:
org/apache/commons/lang/exception/NestableException
 at java.lang.ClassLoader.defineClass0(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
 at java.lang.ClassLoader.defineClass0(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:140)
 at
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.class$(Unknow
n Source)
 at
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.load(Unknown
Source)
 at
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.<ini
t>(Unknown Source)
 at
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.<init>(Unknow
n Source)
 at
org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<init>(Unknown
Source)
 at
org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<clinit>(Unkno
wn Source)
 at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
Source)
 at
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown
Source)
 at org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:44)
 at com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:49)
 at
com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryManager
BD.java:29)
 at
com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.java
:46)
 at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:480)
 at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1058)
 at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:401)
 at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:306)
 at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5445)
 at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:780)
 at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3105)
 at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2588)
 at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

This is a pice of code in my DAO class
InitialContext ctx = new InitialContext();

OjbPbStartup pbs = (OjbPbStartup)ctx.lookup("PBFactory");

PersistenceBrokerFactoryIF pbfif = pbs.getInstance();

in OjbPbStartup class I have

public PersistenceBrokerFactoryIF getInstance() {

return PersistenceBrokerFactoryFactory.instance();

}

Could anybody help out?

Leon



Re: OJB_HL_SEQ behavior (rollback like...)

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
Are you remembering of close your broker at the end of updates?
I've seen a lot of "strange" problems because I've followed docs samples
(that don't close broker anywhere).

My current work with OJB is something like (same for insert/update):

public void deleteObject( Object o ) {
  PersistenceBroker broker = getBroker(); // it's a private method that
returns a defaultBroker...

  try {
    broker.beginTransaction();
    broker.delete( o );
    broker.commitTransaction();
  } catch( PersistenceBrokerException e ) {
    broker.abortTransaction();
  } finally {
    broker.close();
  }
}

----- Original Message ----- 
From: "Mahler Thomas" <th...@itellium.com>
To: "'jim martin'" <jm...@yahoo.com>
Cc: "OJB Users List (E-Mail)" <oj...@db.apache.org>
Sent: Friday, May 23, 2003 10:35 AM
Subject: RE: OJB_HL_SEQ behavior (rollback like...)


Hi Jim,

I'm not providing support on a personal basis, I forwared your request to
the User mailinglist.

cheers,
Thomas

> -----Original Message-----
> From: jim martin [mailto:jmartin_sw@yahoo.com]
> Sent: Friday, May 23, 2003 1:18 PM
> To: thma@apache.org
> Subject: OJB_HL_SEQ behavior (rollback like...)
>
>
> Thomas,
>
>
> I've been using OJB_HL_SEQ in ojb 0.9 and I'm seeing
> three different but related problems with the
> sequencer.
>
> 1)
> I'm seeing rollback-like behavior.
> In fact, I see in the Oracle DB logs that when the
> webapp
> is killed (restarted), Oracle does a bunch of system
> rollbacks
> because the updates hadn't been committed.
> (This is not just limited to updates to OJB_HL_SEQ).
>
> 2)
> I'm seeing from the Oracle DB logs the
> "start transaction" event and then the "update" event,
> but no "commit" event on occasion.
>
> 3)
> Lastly, I'm seeing, or rather not seeing on occasion
> any recorded
> activity in the DB logs for updates to sequences,
> and yet the sequencer gladly hands out new sequences.
> Since the DB never sees the updates for the OJB_HL_SEQ
> entries, the next time the server restarts, the
> sequencer
> starts at some old high value.
>
>
> Does this all sound consistent with a connection that
> had it's auto-commit behavior turned off that gets
> reused by updates for the sequences and the app?
> Was there any problem with abortTransaction()?
>
>
>
> Commentary:
> It seems to me that there are several problems with
> the HL sequencer
> and perhaps a more general OJB problem.
>
> First, the sequencer only examines the maximum if
> it never encountered that table before.
> It would be safer to check and compare the maximum
> with the saved table entry every time the application
> is restarted.
> This seems a small price to pay since it is only done
> once per restart
> and it avoids overwriting previously saved data using
> old indices.
>
> Second, the sequencer should never give out a new
> sequence number
> if the update of the corresponding OJB_HL_SEQ is not
> committed.
>
>
> I believe I'm seeing these problems more than usual
> because the database
> connections in my case get into some state where the
> DB connection
> is not lost, but the connection doesn't function.
> This only
> occurs for some of the connections in the connection
> pool
> as there are multiple paths between the server and db
> machine
> intercede with multiple firewalls that occasionally
> die.
>
>
> Some general questions about OJB or perhaps my usage
> of OJB:
>
> 1)
> Are all updates to be bracketed with:
> broker.beginTransaction
> .
> .
> broker.store(entry)
> broker.commitTransaction
>
> 2)
> Can I guarantee that any update to a table is
> committed
> to the DB by just using:
>
> broker.store(entry)
> broker.removeFromCache(entry);
>
> 3)
> Besides the package names differences, what are the
> kinds
> of problems I might face if I tried to upgrade from
> 0.9 to 1.0rc3?
>
> 4)
> It seems like there's been significant change in the
> OJB_HL_SEQ
> code in the rc releases.  Is there more change coming?
>
>
> Environment:
> j2ee running iPlanet Web Server 6.0
> jdbc:Oracle:oci8
> Using PB api
> singlevm
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 19/5/2003


Re: OJB_HL_SEQ behavior (rollback like...)

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Jim,

> > It seems to me that there are several problems with
> > the HL sequencer
> > and perhaps a more general OJB problem.

the sequence package classes rc3 differ much
from 0.9, so I guess if  OJB had these problems
in 0.9 they solved in rc3, because no one else
reported such behaviour.

> > Besides the package names differences, what are the
> > kinds
> > of problems I might face if I tried to upgrade from
> > 0.9 to 1.0rc3?

- OJB use only one repository (split in sub-files) file for
all metadata information.
- to lookup PB instances we now use the
'jcdAlias' name defined in repository, instead the
path to the repository file (ditto when using the ODMG api)
- the docs are much more completely then in 0.9
- have a look in repository.dtd you will find
new elements/attributes

> > 
> > 4)
> > It seems like there's been significant change in the
> > OJB_HL_SEQ
> > code in the rc releases.  Is there more change coming?
> >
 
only if you find some bugs ;-)


regards,
Armin


> > I've been using OJB_HL_SEQ in ojb 0.9 and I'm seeing
> > three different but related problems with the
> > sequencer.
> > 
> > 1)
> > I'm seeing rollback-like behavior.
> > In fact, I see in the Oracle DB logs that when the
> > webapp
> > is killed (restarted), Oracle does a bunch of system
> > rollbacks
> > because the updates hadn't been committed.
> > (This is not just limited to updates to OJB_HL_SEQ).
> > 
> > 2)
> > I'm seeing from the Oracle DB logs the
> > "start transaction" event and then the "update" event,
> > but no "commit" event on occasion.
> > 
> > 3)
> > Lastly, I'm seeing, or rather not seeing on occasion
> > any recorded
> > activity in the DB logs for updates to sequences,
> > and yet the sequencer gladly hands out new sequences.
> > Since the DB never sees the updates for the OJB_HL_SEQ
> > entries, the next time the server restarts, the
> > sequencer
> > starts at some old high value.
> > 
> > 
> > Does this all sound consistent with a connection that
> > had it's auto-commit behavior turned off that gets
> > reused by updates for the sequences and the app?
> > Was there any problem with abortTransaction()?
> > 
> > 
> > 
> > Commentary:
> > It seems to me that there are several problems with
> > the HL sequencer
> > and perhaps a more general OJB problem.
> > 
> > First, the sequencer only examines the maximum if
> > it never encountered that table before.
> > It would be safer to check and compare the maximum
> > with the saved table entry every time the application
> > is restarted.
> > This seems a small price to pay since it is only done
> > once per restart
> > and it avoids overwriting previously saved data using
> > old indices.
> > 
> > Second, the sequencer should never give out a new
> > sequence number
> > if the update of the corresponding OJB_HL_SEQ is not
> > committed.
> > 
> > 
> > I believe I'm seeing these problems more than usual 
> > because the database
> > connections in my case get into some state where the
> > DB connection
> > is not lost, but the connection doesn't function. 
> > This only
> > occurs for some of the connections in the connection
> > pool
> > as there are multiple paths between the server and db
> > machine
> > intercede with multiple firewalls that occasionally
> > die.
> > 
> > 
> > Some general questions about OJB or perhaps my usage
> > of OJB:
> > 
> > 1)
> > Are all updates to be bracketed with:
> > broker.beginTransaction
> > .
> > .
> > broker.store(entry)
> > broker.commitTransaction
> > 
> > 2)
> > Can I guarantee that any update to a table is
> > committed
> > to the DB by just using:
> > 
> > broker.store(entry)
> > broker.removeFromCache(entry);
> > 
> > 3)
> > Besides the package names differences, what are the
> > kinds
> > of problems I might face if I tried to upgrade from
> > 0.9 to 1.0rc3?
> > 
> > 4)
> > It seems like there's been significant change in the
> > OJB_HL_SEQ
> > code in the rc releases.  Is there more change coming?
> > 
> > 
> > Environment:
> > j2ee running iPlanet Web Server 6.0
> > jdbc:Oracle:oci8
> > Using PB api
> > singlevm
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
>