[JBoss Messaging] - Re: Poss solution frequent deadlocks on SQLServer
by timfox
"JeremyStone" wrote : However the problem with this is that messages seem to be getting acknowleged in spite of failure (setRollbackOnly called) and no redelivery is occurring.
|
| Looking at the JBoss Messaging source, SessionAspect.handlePostDeliver() calls isXAAndConsideredNonTransacted() which returns true because the SessionState's treatAsNonTransactedWhenNotEnlisted is set to true.
|
| Is the solution to somehow to set treatAsNonTransactedWhenNotEnlisted to false? What does an MDB container do here?
Yes, this is probably because Spring isn't enlisting the session in the JTA transaction until after it has received the message from JBM using a message listener.
Either that or there is a small period of time between Spring delisting the session from the JTA tx before commit and enlisting it in the next one, when a message can be received but the session is not enlisted. The session is therefore not transacted at that point so acts as auto_ack and acks immediately.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104470#4104470
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104470
18 years, 8 months
[JBossWS] - Re: webParameter is null
by georges.goebel
Hi,
I have found one solution get it working. I have to use the annotation @SOAPBinding(style = SOAPBinding.Style.RPC)
| @Stateless(name = "Facade")
| @Local(Facade.class)
| @Remote(Facade.class)
| @WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public class FacadeImpl implements Facade {
| @WebMethod
| public NiveauService[] getLastDataNiveauService(String e1, String e2) throws WebPchException {
| System.out.println(e1);
| System.out.println(e2);
| }
|
| }
|
But I read everywhere that RPV is "BAD" and "Document" should be used instead. But when I use Document I have the previous error.
Can somebody tell me if it is worth to implement a RPC solution, or how can I get it working with "Document" ?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104458#4104458
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104458
18 years, 8 months
[EJB 3.0] - Getter for LAZY property gets called on every commit
by markus.doering
Hello,
First of all, i'm working with JBoss 4.2.0 GA and MySQL 5.
I have the following code for my EntityBeans:
EntityBean1
@Entity
| public class EntityBean1 {
| private long id;
|
| private byte[] data;
|
| private boolean active;
|
| private EntityBean2 relation;
|
| @Id
| @GeneratedValue(strategy=GenerationType.AUTO)
| public long getId() {return this.id;}
|
| public void setId(long id) {this.id = id;}
|
| public boolean isActive() {return this.active;}
|
| public boolean setActive(boolean active) {this.active = active;}
|
| @Lob
| @Column(columnDefinition = "LONGBLOB")
| @Basic(fetch = FetchType.LAZY)
| public byte[] getData() {
| log.debug("getData called");
| return this.data;
| }
|
| public void setData(byte[] data) { this.data = data;}
|
| @ManyToOne
| public EntityBean2 getRelation() {return this.relation;}
|
| public void setRelation(EntityBean2 relation) {this.relation = relation;}
| }
EntityBean2
@Entity
| public class EntityBean2 {
| private long id;
|
| private List<EntityBean1> relation;
|
| @Id
| @GeneratedValue(strategy=GenerationType.AUTO)
| public long getId() {return this.id;}
|
| public void setId(long id) {this.id = id;}
|
| @OneToMany(mappedBy = "relation", cascade = cascadeType.ALL)
| public List<EntityBean1> getRelation() {return this.relation;}
|
| public void setRelation(List<EntityBean1> relation) {this.relation = relation;}
| }
SomeStatelessSessionBean
@Stateless
| public class SomeStatelessSessionBean implements SomeStatelessSessionLocal {
|
| public List<EntityBean1> doSomething() {
| log.debug("doSomething started");
| List<EntityBean1> out = new ArrayList<EntityBean1>();
| EntityBean2 bean2 = someFinder();
| for(EntityBean1 bean1 = bean2.getRelation()) {
| if(bean1.isActive()) {
| out.add(bean1);
| }
| }
| log.debug("doSomething ended");
| return out;
| }
| }
What i do is calling the doSomething() methode from somehwere with a log.debug("start"); before and a log.debug("end"); directly after the methode call.
What i get is the following log:
| XXX DEBUG start
| XXX DEBUG doSomething started
| XXX DEBUG doSomething ended
| XXX DEBUG getData called
| XXX DEBUG getData called
| XXX DEBUG getData called
| XXX DEBUG getData called
| XXX DEBUG getData called
| XXX DEBUG end
|
What does this means?
As far as i can see, when the transaction from doSomething() is commited, the getData() methode of the EntityBean1 get called. This should NOT be the case, because it is set to LAZY and i NEVER use the byte[] in this case.
My problem is that the byte[] might be large, and at some point, i get an OOMException: heapSize. I've done a HeapDump and saw LOTS of byte[] in the memory, that's how i found this strange behavier. I also checkt if the getData() get's called by the equals() or hashCode() methode of EntityBean1, but this is not the case.
Is this a bug in EJB3 (hibernate?) or is something "wrong" with my code? Or is it working as designed and there are no "real" lazy byte[] propertys?
Thanks for help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104457#4104457
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104457
18 years, 8 months
[JBoss Messaging] - Re: Poss solution frequent deadlocks on SQLServer
by JeremyStone
No problem - hope it helps.
I have seen the JBMSpringJMSTemplateNotes wiki and we are only sending messages using the JCA factory so I think that's ok.
However we also use Spring to receive messages. (We were originally using their DefaultMessageListenerContainer but turned out to be SLOW -- as I notice you've mentioned on previous occassions). So we started using their SimpleMessageListenerContainer which registers a MessageListener on a MessageConsumer. However the problem with this is that messages seem to be getting acknowleged in spite of failure (setRollbackOnly called) and no redelivery is occurring.
Looking at the JBoss Messaging source, SessionAspect.handlePostDeliver() calls isXAAndConsideredNonTransacted() which returns true because the SessionState's treatAsNonTransactedWhenNotEnlisted is set to true.
Is the solution to somehow to set treatAsNonTransactedWhenNotEnlisted to false? What does an MDB container do here?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104445#4104445
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104445
18 years, 8 months