[Design of JBossCache] - Re: Gravitation and POJO Cache
by bstansberry@jboss.com
Not every call; just gets.
The thing that makes autoDataGravitation=true really unworkable is that it causes a gravitation attempt any time a non-existent node is detected, whether for a read or a write. So, add a new attribute to your session == do a gravitation check, since the put creates a new node. Very non-performant. Having autoDataGravitation=false allows the app to decide when it's making a call that should result in gravitation.
Let me describe a bit about how FIELD session repl works. This seems kind of kludgy now, but anyway, here it is.
You have a node at /JSESSION/hostname/contextPath/sessionId that stores the session metadata in a couple key/value pairs. Plain cache functionality; not PojoCache.
Underneath that there is a child node for each session attribute. Those are stored/retrieved using the PojoCache API.
When a request first comes in, the session manager sets the forceDataGravitation option and does a plain cache get on /JSESSION/hostname/contextPath/sessionId. That will bring over the whole data structure, since the gravitation bring over the whole subtree under the requested Fqn. That call is the only time data gravitation is allowed. It doesn't bring the relevant _JBossInternal_, the location of which is in a separate subtree at /JSESSION/hostname/contextPath/_JBossInternal_.
Where this breaks is when PojoCache needs to traverse a PojoReference to get to the _JBossInternal_ region.
Yeah, I guess in 2.0 there are more of those calls now, since everything is now stored in _JBossInternal_.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056711#4056711
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056711
18 years, 9 months
[Design of Persistence on JBoss] - cannot instatiate abstract class
by jflf83
Hello, I have problems when a I try to list the elements of an abstract class. the exceptions is:
Caused by: javax.ejb.EJBTransactionRolledbackException: javax.persistence.Persis
tenceException: org.hibernate.InstantiationException: Cannot instantiate abstrac
t class or interface: X
this problem happens with some elements of X, not with all elements
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class X
{
public static final String SEM_ELEMENTO = " - ";
private long id;
private Date dataMovimentacao;
private Date dataMovimentacaoSistema;
private double quantidade;
private long numeroMovimento;
private String loginUsuario;
private LinhaDeEstoque linhaDeEstoque = null;
public X()
{
}
public X(double consumoFinanceiro, Setor setor)
{
}
public Date getDataMovimentacaoSistema()
{
return dataMovimentacaoSistema;
}
public void setDataMovimentacaoSistema(Date dataMovimentacaoSistema)
{
this.dataMovimentacaoSistema = dataMovimentacaoSistema;
}
public String getLoginUsuario()
{
return loginUsuario;
}
public void setLoginUsuario(String loginUsuario)
{
this.loginUsuario = loginUsuario;
}
public long getNumeroMovimento()
{
return numeroMovimento;
}
public void setNumeroMovimento(long numeroMovimento)
{
this.numeroMovimento = numeroMovimento;
}
public Date getDataMovimentacao() {
return dataMovimentacao;
}
public void setDataMovimentacao(Date dataEntrada) {
this.dataMovimentacao = dataEntrada;
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
public void setId(long id)
{
this.id = id;
}
public double getQuantidade()
{
return quantidade;
}
public void setQuantidade(double quantidade)
{
this.quantidade = quantidade;
}
@ManyToOne
public LinhaDeEstoque getLinhaDeEstoque()
{
return linhaDeEstoque;
}
public void setLinhaDeEstoque(LinhaDeEstoque linhaDeEstoque)
{
this.linhaDeEstoque = linhaDeEstoque;
}
@Transient
public abstract String getTipoMovimentacao();
@Transient
public abstract String getValorMovimentacao();
@Transient
public abstract String getNumeroNotaFiscal();
@Transient
public abstract double getValorEntrada();
@Transient
public abstract Object getSetor();
@Transient
public abstract double getConsumoFinanceiro();
}
this is the code of my classes
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
@Entity
public abstract class Y extends X{
public Y()
{
super();
}
public Y(double consumoFinanceiro, Setor setor)
{
super(consumoFinanceiro, setor);
}
}
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@Entity
public class Z extends X
{
public static final String ENTRADA = "Entrada";
private String numeroNotaFiscal;
private Fornecedor fornecedor;
private double valorEntrada;
private String codigoFornecedor;
public double getValorEntrada() {
return valorEntrada;
}
public void setValorEntrada(double valorEntrada) {
this.valorEntrada = valorEntrada;
}
@Override
public String getNumeroNotaFiscal()
{
return numeroNotaFiscal;
}
public void setNumeroNotaFiscal(String numeroNotaFiscal)
{
this.numeroNotaFiscal = numeroNotaFiscal;
}
public void setFornecedor(Fornecedor fornecedor)
{
this.fornecedor = fornecedor;
}
@ManyToOne
public Fornecedor getFornecedor()
{
return fornecedor;
}
public String getCodigoFornecedor() {
return codigoFornecedor;
}
public void setCodigoFornecedor(String codigoFornecedor) {
this.codigoFornecedor = codigoFornecedor;
}
@Override
@Transient
public String getTipoMovimentacao()
{
return ENTRADA;
}
@Override
@Transient
public String getValorMovimentacao()
{
return SEM_ELEMENTO;
}
@Override
@Transient
public Object getSetor()
{
return " - ";
}
@Override
@Transient
public double getConsumoFinanceiro() {
// TODO Auto-generated method stub
return 0;
}
}
Someone can help me?
Thank you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056606#4056606
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056606
18 years, 9 months
[Design of Persistence on JBoss] - cannot instatiate abstract class
by jflf83
Hello, I have problems when a I try to list the elements of an abstract class. the exceptions is:
Caused by: javax.ejb.EJBTransactionRolledbackException: javax.persistence.Persis
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
@Entity
public abstract class Y extends X{
public Saida()
{
super();
}
public Saida(double consumoFinanceiro, Setor setor)
{
super(consumoFinanceiro, setor);
}
}
package br.gov.gemog.siest.core.entity;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@Entity
public class Z extends X
{
public static final String ENTRADA = "Entrada";
private String numeroNotaFiscal;
private Fornecedor fornecedor;
private double valorEntrada;
private String codigoFornecedor;
public double getValorEntrada() {
return valorEntrada;
}
public void setValorEntrada(double valorEntrada) {
this.valorEntrada = valorEntrada;
}
@Override
public String getNumeroNotaFiscal()
{
return numeroNotaFiscal;
}
public void setNumeroNotaFiscal(String numeroNotaFiscal)
{
this.numeroNotaFiscal = numeroNotaFiscal;
}
public void setFornecedor(Fornecedor fornecedor)
{
this.fornecedor = fornecedor;
}
@ManyToOne
public Fornecedor getFornecedor()
{
return fornecedor;
}
public String getCodigoFornecedor() {
return codigoFornecedor;
}
public void setCodigoFornecedor(String codigoFornecedor) {
this.codigoFornecedor = codigoFornecedor;
}
@Override
@Transient
public String getTipoMovimentacao()
{
return ENTRADA;
}
@Override
@Transient
public String getValorMovimentacao()
{
return SEM_ELEMENTO;
}
@Override
@Transient
public Object getSetor()
{
return " - ";
}
@Override
@Transient
public double getConsumoFinanceiro() {
// TODO Auto-generated method stub
return 0;
}
}
Someone can help me?
Thank you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056601#4056601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056601
18 years, 9 months
[Design of JBoss Web Services] - JBWS-1678
by maeste
Hi folks,
I'm looking at JBWS-1678,to implement redirect the message dump logging of sunri to jboss standard logging. I'm trying to use a specific logName, so we can intercept this kind of log with a specific log4j category.
The problem is that sunri use brutal System.out calls to log the soap message.
I think we have more than one way to implement this feature:
| Redirect all System.out to log4jPlugin of a logger named something like "SUNRI DUMP". This redirect would take place in RequestHandlerImpl, just before delegate to sunri, and original System.out replaced at the end of delegation. Of course this approach have a lot of problem since it redirect ALL System.out, also ones eventually placed in webservice implementation class.
|
|
| | Copy some classes from SUNRI in wsf.stack.sunri and redefine method dump(). The problem here is that these class (2/3) aren't extendable since they are final. But they are an important peace of the core of sunri containing a large part of the logic of http interface. I think it could be a problem to have to maintain this classes every time sunri release updates. These classes is at least ServletConnectionImpl, ServletAdapter, and (maybe I have to check better) HttpAdapter.
| |
|
| | Decorate the dump method (in HttpAdapter) with aop. Since it have to be decorated runtime, using sunri as jar lib, it could become a performance problem.
| |
|
| Sincerely no one of these solution seems good to us. Alternative ideas?
|
| Thanks for your time
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056582#4056582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056582
18 years, 9 months