Re: [Resolved] org.apache.ojb.broker.PersistenceBrokerSQLException

2004-08-13 Thread Noureddine BEKRAR
Thank you very much Armin.

the third solution is the right one, the two others dont change any thing.


- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 10:58 AM
Subject: Re: org.apache.ojb.broker.PersistenceBrokerSQLException


> Hi,
>
> never used mysql (so take this with a pinch of salt ;-)), but it seems
> that by default reconnected connections set to 'read-only' mode. Did you
> try to set failOverReadOnly=false
>
> http://dev.mysql.com/doc/connector/j/en/index.html#id2423002
>
> In jdbc-connection-descriptor you should set useAutoCommit="1", this
> guarantee that all connections returned to pool set with autoCommit
> 'true'. Only in this case autoReconnect seems to work in mysql.
>
> http://db.apache.org/ojb/docu/guides/repository.html#useAutoCommit
>
> If you don't have succeed in doing so, you can specify a
> 'validatioQuery' to check connection before delivered by the
connection-pool
>
>
http://db.apache.org/ojb/docu/guides/repository.html#connection-pool-N10230
>
>
> regards,
> Armin
>
>
> Noureddine BEKRAR wrote:
> > I reproduced the exeption by stopping and restarting the sql server.
> >
> > the probleme is that OJB dont auto-Reconnect in spite of putting in my
> > repository.xml in the connection declaration
> > dbalias="//localhost/MyDB?autoReconnect=true"
> >
> >
> >
> > How can i tell to OJb to auto reconnect?
> >
> >
> > - Original Message - 
> > From: "Noureddine BEKRAR" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > Sent: Friday, August 13, 2004 9:57 AM
> > Subject: org.apache.ojb.broker.PersistenceBrokerSQLException
> >
> >
> > Hi all,
> >
> > I have a SQL probleme, it seems like the connection died after some
time, it
> > happen only for the OJB connection, because I have another connection
that
> > use classic java connection managed with a connection pool, this kind of
> > connection dont throw any exception at the same time the ojb connection
> > throws that exception.
> >
> > Did anyone had the same problem?
> >
> >
> >
> >
> >
> > org.apache.ojb.broker.PersistenceBrokerSQLException:
java.sql.SQLException:
> > Communication link failure: java.io.EOFException, underlying cause: null
> >
> > ** BEGIN NESTED EXCEPTION **
> >
> > java.io.EOFException
> >
> > STACKTRACE:
> >
> > java.io.EOFException
> >
> > at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1388)
> >
> > at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1532)
> >
> > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1923)
> >
> > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
> >
> > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
> >
> > at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
> >
> > at
> >
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1555)
> >
> > at
> >
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(JdbcAcces
> > sImpl.java:557)
> >
> > at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrok
> > erImpl.java:1232)
> >
> > at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(Persi
> > stenceBrokerImpl.java:1355)
> >
> > at
> >
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Persist
> > enceBrokerImpl.java:1334)
> >
> > at
> >
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(D
> > elegatingPersistenceBroker.java:306)
> >
> > at
> >
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(D
> > elegatingPersistenceBroker.java:306)
> >
> > at
> >
jouve.extradim.backoffice.entity.dao.ProjectDAO.retrieve(ProjectDAO.java:37)
> >
> > 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:324)
> >
> > at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
> >
> > at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.jav

Re: org.apache.ojb.broker.PersistenceBrokerSQLException

2004-08-13 Thread Noureddine BEKRAR
I reproduced the exeption by stopping and restarting the sql server.

the probleme is that OJB dont auto-Reconnect in spite of putting in my
repository.xml in the connection declaration
dbalias="//localhost/MyDB?autoReconnect=true"



How can i tell to OJb to auto reconnect?


- Original Message - 
From: "Noureddine BEKRAR" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 9:57 AM
Subject: org.apache.ojb.broker.PersistenceBrokerSQLException


Hi all,

I have a SQL probleme, it seems like the connection died after some time, it
happen only for the OJB connection, because I have another connection that
use classic java connection managed with a connection pool, this kind of
connection dont throw any exception at the same time the ojb connection
throws that exception.

Did anyone had the same problem?





org.apache.ojb.broker.PersistenceBrokerSQLException: java.sql.SQLException:
Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException

at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1388)

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1532)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1923)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)

at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1555)

at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(JdbcAcces
sImpl.java:557)

at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrok
erImpl.java:1232)

at
org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(Persi
stenceBrokerImpl.java:1355)

at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Persist
enceBrokerImpl.java:1334)

at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(D
elegatingPersistenceBroker.java:306)

at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(D
elegatingPersistenceBroker.java:306)

at
jouve.extradim.backoffice.entity.dao.ProjectDAO.retrieve(ProjectDAO.java:37)

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:324)

at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)

at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)

at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
nuationInterpreter.java:1134)

at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
nuationInterpreter.java:190)

at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
nuationInterpreter.java:138)

at
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(Interprete
dFunctionImpl.java:121)

at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)

at
org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:159
1)

at
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.h
andleContinuation(FOM_JavaScriptInterpreter.java:788)

at
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(C
allFunctionNode.java:120)

at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo
keNodes(AbstractParentProcessingNode.java:72)

at
org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke(SelectN
ode.java:97)

at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo
keNodes(AbstractParentProcessingNode.java:49)

at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invok
e(PreparableMatchNode.java:130)

at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo
keNodes(AbstractParentProcessingNode.java:72)

at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Pipel
ineNode.java:126)

at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo
keNodes(AbstractParentProcessingNode.java:72)

at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Pipe
linesNode.java:101)

at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess
or.java:336)

at
org.apache.cocoon.components.treeprocessor.TreeProcessor.buildPipeline(TreeP
rocessor.java:295)

at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNod
e.java:94)

at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo
keNodes(AbstractParentProcessingNode.java:49)

at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode

org.apache.ojb.broker.PersistenceBrokerSQLException

2004-08-13 Thread Noureddine BEKRAR
Hi all,

I have a SQL probleme, it seems like the connection died after some time, it happen 
only for the OJB connection, because I have another connection that use classic java 
connection managed with a connection pool, this kind of connection dont throw any 
exception at the same time the ojb connection throws that exception.

Did anyone had the same problem?





org.apache.ojb.broker.PersistenceBrokerSQLException: java.sql.SQLException: 
Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION ** 

java.io.EOFException

STACKTRACE:

java.io.EOFException

at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1388)

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1532)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1923)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)

at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1555)

at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(JdbcAccessImpl.java:557)

at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1232)

at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1355)

at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBrokerImpl.java:1334)

at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(DelegatingPersistenceBroker.java:306)

at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByIdentity(DelegatingPersistenceBroker.java:306)

at jouve.extradim.backoffice.entity.dao.ProjectDAO.retrieve(ProjectDAO.java:37)

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:324)

at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)

at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)

at 
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134)

at 
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)

at 
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)

at 
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)

at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)

at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1591)

at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:788)

at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:120)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)

at 
org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke(SelectNode.java:97)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)

at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)

at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)

at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)

at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)

at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.buildPipeline(TreeProcessor.java:295)

at 
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:94)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)

at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)

at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)

at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)

at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)

at 
org.apache.cocoon.components.treeprocessor.TreePro

Re: 1:n mapping

2004-08-05 Thread Noureddine BEKRAR
Hi Kumar,

You can insert the parent and the child together  by setting the
auto-update="true" in the repository_user.xmland if you want to do insert
separately parent and childs you put it to false 







- Original Message - 
From: "Kumar Chandran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 04, 2004 12:56 AM
Subject: 1:n mapping


> Hi,
>
> Is it possible to insert both parent and children (1:n) at the same time
or
> do we have to insert each child record individually after inserting the
> parent record.  If this can be done some help is appreciated in this
regard
> as to how to configure it in repository_user.xml and how to use odmg api
to
> do this.
>
> Thanks,
>
> Kumar Chandran
>
> This electronic message contains information from CTIS, Inc., which may be
> company sensitive, proprietary, privileged or otherwise protected from
> disclosure. The information is intended to be used solely by the
recipients
> named above. If you are not an intended recipient, be aware that any
> review,disclosure, copying, distribution or use of this transmission or
its
> contents is prohibited. If you have received this transmission in error,
> please notify us immediately at [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Repository.xml question

2004-07-30 Thread Noureddine BEKRAR
I want  to give more information about  my problem:
when i create a new ProjectVersion , i put in it a Version, the id of the
ProjectVersion is right but the id of the version is 0, how can i do to put
by an automatic way the id of the ProjectVersion  in the Version.



- Original Message - 
From: "Noureddine BEKRAR" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 30, 2004 12:06 PM
Subject: Repository.xml question


Hi all;

I want to put by an automatic way the generated "idProjectVersion" on the
projectversions table as id of the versions related to the projectVersion.

Is it possible only by changing the repository.xml or should i change the
structure of the Database?

Thank you in advance.





that is the repository.xml part

























































that is tables


CREATE TABLE projectversions (
  idProjectVersion int(10) NOT NULL auto_increment,
  idProject int(10) NOT NULL default '0',
  current enum('Y','N') NOT NULL default 'N',
  PRIMARY KEY  (idProjectVersion,idProject)
) TYPE=MyISAM;


CREATE TABLE `projectversiondesc` (
  `id` int(10) NOT NULL default '0',
  `lang` enum('fr','en') NOT NULL default 'fr',
  `description` varchar(30) NOT NULL default '',
  `status` enum('A','I') NOT NULL default 'A',
  PRIMARY KEY  (`id`,`lang`)
) TYPE=MyISAM;


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Repository.xml question

2004-07-30 Thread Noureddine BEKRAR
Hi all;

I want to put by an automatic way the generated "idProjectVersion" on the 
projectversions table as id of the versions related to the projectVersion.

Is it possible only by changing the repository.xml or should i change the structure of 
the Database?

Thank you in advance.





that is the repository.xml part













 



















 













 



 





that is tables

 
CREATE TABLE projectversions (
  idProjectVersion int(10) NOT NULL auto_increment,
  idProject int(10) NOT NULL default '0',
  current enum('Y','N') NOT NULL default 'N',
  PRIMARY KEY  (idProjectVersion,idProject)
) TYPE=MyISAM;

 
CREATE TABLE `projectversiondesc` (
  `id` int(10) NOT NULL default '0',
  `lang` enum('fr','en') NOT NULL default 'fr',
  `description` varchar(30) NOT NULL default '',
  `status` enum('A','I') NOT NULL default 'A',
  PRIMARY KEY  (`id`,`lang`)
) TYPE=MyISAM;