Re: Re: Transaction question

2004-03-31 Thread Leandro Augusto de Almeida
Hi Armin,

I put the broker.beginTransaction() and broker.commitTransaction() only for test, 
because I was getting the same exception on broker.close() and now on broker.commit() 
(because commit closes the con...).
Using the old datasource (not XA) this works fine. The bean that calls this method is 
configured bm-tx.

PersistenceBroker broker = null;

try
{
  if (log.isInfoEnabled()) {
log.info("Iniciando DAO - " + this.className + ".findAllParametro()");
  }

  broker = PersistenceBrokerFactory.defaultPersistenceBroker();

  broker.beginTransaction();

  QueryByCriteria query = new QueryByCriteria(ParametroVO.class, null);
  Vector parametros = (Vector) broker.getCollectionByQuery(query);

  if (log.isInfoEnabled()) {
log.info("Finalizando DAO - " + this.className + ".findAllParametro()");
  }

  broker.commitTransaction();

  return parametros;
} catch (PBFactoryException pbfe) {
  ResourceException re = new ResourceException("Erro ao procurar parâmetros: erro 
ao buscar o PersistenceBroker.", pbfe);
.

finally {broker.close();}

--- Mensagem Original ---
> Hi Leandro,
> 
> could you post a snip of the source code?
> 
> regards,
> Armin
> 
> Leandro Augusto de Almeida wrote:
> 
> > Hi Armin,
> > 
> > I was using a DataSource (in Websphere) from 
> the Jdbc Provider 
> oracle.jdbc.pool.OracleConnectionPoolDataSource 
> and using the PB-tx-demarcation 
> (broker.beginTransaction().). When I changed 
> the datasource to 
> oracle.jdbc.xa.client.OracleXADataSource the 
> application shows this exception when commit is 
> called : 
> > 
> > 46563 ERROR 
> accesslayer.ConnectionFactoryAbstractImpl - 
> Closing connection failed
> > 
> com.ibm.ejs.cm.exception.WorkRolledbackException: 
> Outstanding work on this connection which was 
> not comitted or rolledback by the user has been 
> rolledback.
> > at 
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction(DelegatingPersistenceBroker.java:145)
> 
> > at 
> br.com.equifax.dataqa.procir.persistencia.dao.OjbParametroDAO.findAllParametro(OjbParametroDAO.java:258)
> 
> > 
> > Do you know what I am doing wrong ?
> > 
> > --- Mensagem Original ---
> > 
> >>Hi Leandro,
> >>
> >>Leandro Augusto de Almeida wrote:
> >>
> >>
> >>>Is it possible to use PB-tx-demarcation on a 
> 
> >>
> >>session bean with bm-tx and getting a 
> connection 
> >>from a DataSource from my AppServer? Is it 
> >>right? What is the correct connection factory 
> to 
> >>use?
> >>
> >>>Or I must use the user (JTA) tx-demarcation 
> >>
> >>with the ConnectionFactoryManagedImpl and 
> choose 
> >>between cm-tx or bm-tx?
> >>
> >>yep, in managed environments you have always 
> to 
> >>use JTA (except you 
> >>don't want to use distributed tx at all and 
> set 
> >>tx-demarcation to 
> >>'none'). All settings described here
> >>
> >>
> 
> >>http://db.apache.org/ojb/deployment.html#Deployment%20in%20EJB%20based%20applications
> 
> >>
> >>
> >>regards,
> >>Armin
> >>
> >>
> >>>Thanks,
> >>>
> >>>Leandro.
> >>>
> >>>
> >>
> 
> >>-
> 
> >>
> >>
> >>>To unsubscribe, e-mail: 
> >>
> >>[EMAIL PROTECTED]
> >>
> >>>For additional commands, e-mail: 
> >>
> >>[EMAIL PROTECTED]
> >>
> >>>
> >>>
> >>
> 
> >>-
> 
> >>
> >>To unsubscribe, e-mail: 
> >>[EMAIL PROTECTED]
> >>For additional commands, e-mail: 
> >>[EMAIL PROTECTED]
> >>
> >>
> > 
> > 
> > 
> -
> 
> > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> 
> -
> 
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> 
>

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



Re: Re: Transaction question

2004-03-31 Thread Leandro Augusto de Almeida
Hi Armin,

I was using a DataSource (in Websphere) from the Jdbc Provider 
oracle.jdbc.pool.OracleConnectionPoolDataSource and using the PB-tx-demarcation 
(broker.beginTransaction().). When I changed the datasource to 
oracle.jdbc.xa.client.OracleXADataSource the application shows this exception when 
commit is called : 

46563 ERROR accesslayer.ConnectionFactoryAbstractImpl - Closing connection failed
com.ibm.ejs.cm.exception.WorkRolledbackException: Outstanding work on this connection 
which was not comitted or rolledback by the user has been rolledback.
at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.commitTransaction(DelegatingPersistenceBroker.java:145)
at 
br.com.equifax.dataqa.procir.persistencia.dao.OjbParametroDAO.findAllParametro(OjbParametroDAO.java:258)

Do you know what I am doing wrong ?

--- Mensagem Original ---
> Hi Leandro,
> 
> Leandro Augusto de Almeida wrote:
> 
> > Is it possible to use PB-tx-demarcation on a 
> session bean with bm-tx and getting a connection 
> from a DataSource from my AppServer? Is it 
> right? What is the correct connection factory to 
> use?
> > Or I must use the user (JTA) tx-demarcation 
> with the ConnectionFactoryManagedImpl and choose 
> between cm-tx or bm-tx?
> > 
> 
> yep, in managed environments you have always to 
> use JTA (except you 
> don't want to use distributed tx at all and set 
> tx-demarcation to 
> 'none'). All settings described here
> 
> 
> http://db.apache.org/ojb/deployment.html#Deployment%20in%20EJB%20based%20applications
> 
> 
> regards,
> Armin
> 
> > Thanks,
> > 
> > Leandro.
> > 
> > 
> -
> 
> > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> 
> -
> 
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> 
> 

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



Transaction question

2004-03-30 Thread Leandro Augusto de Almeida
Is it possible to use PB-tx-demarcation on a session bean with bm-tx and getting a 
connection from a DataSource from my AppServer? Is it right? What is the correct 
connection factory to use?
Or I must use the user (JTA) tx-demarcation with the ConnectionFactoryManagedImpl and 
choose between cm-tx or bm-tx?

Thanks,

Leandro.

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



Memory and ObjectCachePerBrokerImpl

2003-09-12 Thread Leandro Augusto de Almeida
Hi,
 
I'm having some problems with ObjectCachePerBrokerImpl, since I changed the class 
cache implementation from ObjectCacheEmptyImpl to ObjectCachePerBrokerImpl, my 
application don´t stop to consume more memory, and never free any memory. I'm working 
with one PersistenceBroker per Thread, but when I close the pb the memory isn´t 
released (when I was using ObjectCacheEmptyImpl any memory was allocated by the cache 
but I need to improve the performance and the cache is helpping me a lot).
Thanks in advance,
 
Leandro.
 
PS: sorry for my English.


Problems with 1:n mappings

2003-07-26 Thread Leandro Augusto de Almeida
I'm having problems using 1:n mapping bi-directional relationship with
more than one element inverse foreignkey.
It seems that the order of elements in the repository is changing the
behavior of the broker.
EX:   
 
 
 
  
 
If I change the order of inverse-foreignkey it results in different
cases: 1. Runtime Error (null reference), 2. Wrong data retrieve, 3. The
right data.
 
My question: Is the order really important? Am I doing something wrong?
 
Thanks,
 
Leandro Augusto de Almeida.