[jboss-user] [JBoss Seam] - Re: DocumentStore usage change - Urgent!!!

2008-02-08 Thread zerok
nickarls wrote : UIDocument.PDF?

nickarls,

Ty for your answer, but I have already tried to use UIDocument.PDF and it 
raises an exception during execution.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4127827#4127827

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4127827
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - DocumentStore usage change - Urgent!!!

2008-02-08 Thread zerok
Hi folks,

We are using Seam 2.0.1.CR1.
We have to generate PDFs and put it into DocumentStore for latter use.
I've found this bunch of code:

String id = DocumentStore.instance().newId();
DocumentData data = new DocumentData(manual.pdf,DocumentData.DocType.PDF, 
manualBytes);
DocumentStore.instance().saveData(id, data);
return DocumentStore.instance().preferredUrlForContent(manual.pdf, 
DocumentData.DocType.PDF, id);

The problem is that DocumentData doen not have DocType inner class anymore and 
the actual inner class doesn't have a replacement constant for PDF's Doctype. 
So the code doesn't work anymore!

Does anyone can provide an alternative to the code above for 2.0.1.CR1?

any help you can give will be much appreciated!


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4127800#4127800

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4127800
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Problem with Threads and Transactional context

2007-07-18 Thread zerok
Thank you very much Bill.

I'll try it right away!

But first Let me see if I understood you right. I'll keep my Stateless Bean,but 
I'll add this SessionContext to keep the bean alive when the threads stop 
running so I can use the Stateless Bean entityManager or I should use 
SessionContext to make the persistence somehow?
You please excuse my newbie questions. 
If I do have to use the SessionContext for persistence, could you, please, tell 
me how?

Ty very much again and God blesses you and your family.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4065387#4065387

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065387
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Problem with Threads and Transactional context

2007-07-17 Thread zerok
Dear waynebaylor,

Ty very much for your answer. Although, I'm not trying to persist anything 
inside my threads. What I'm doing inside my threads in to use the 
genericDAOBean to perform some searchs.
About the thread spawning, can you or anyone suggest a better way to do it?

Ty again.

Roberto Cavalcante

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4064988#4064988

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4064988
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Asynchronous Problem

2007-07-16 Thread zerok
Hi,

I'm using threads inside a stateless bean and I cannot persist anything without 
having that annoying message that states I can only use transaction manager 
inside a transactional context.
I've tried to make a busy-wait on my stateless bean so I can assure my bean 
will be alive until the very moment my thread needs the entityManager but when 
the execution reaches the entityManeger.merge( object ) an exception is risen.
The story:

I have a jboss-4.0.5.GA with an upgrade on my original Javassist. Now I have 
javassist-3.4 due to issues with threads.
My application needs to perform a fork in execution flow split in three parts. 
Both of them are created as threads and are observed in normal-fashion-way 
observer pattern, where the Stateless Bean is the observer.
I have a hunch that my bean life-cycle ends before my first thread finishes, so 
the entityManager looses it transactional context.
Can anybody point a blueprint for creating a structure to support such a 
business demand?

Here some parts of my code so you can place yourself. This code comes with only 
one thread. The original one has three, all like this one.

@TransactionManagement(TransactionManagementType.CONTAINER)
public @Stateless(name = TempoRealRN) class TempoRealRNBean extends 
IntegratorCommonBehavior implements TempoRealRN, Observer {

@EJB(beanName = GenericoDAO)
GenericoDAO genericoDAO;

@PersistenceContext private EntityManager entityManager;

private static final Log log = LogFactory.getLog(TempoRealRNBean.class);

...
public void processar(CommonController controladorComum) throws 
IntegratorException {

super.setEntityManager(this.entityManager);

tCorFrente = new ThreadCorFrente(controladorComum,  this, log, 
dto, nomeThreadFrente, grupoFrente);
tCorFrente.addObserver(this);
tCorFrente.start();
}// ends of: public void processar(...) 

/*
* receives notification from thread state change and executes the proper action 
to acomplish bussiness rule goals.
*
*/
public void update(Object o) {

   //perform some state tests

   //then try to persist.
   //at this point an exception is risen
   this.entityManager.merge( object );
}



}//ends public void update(Object o) 

}//ends class

The exception risen is: 
--
17:01:47,480 ERROR [STDERR] Caused by: 
javax.persistence.TransactionRequiredException: EntityManager must be access 
within a transaction
17:01:47,480 ERROR [STDERR] at 
org.jboss.ejb3.entity.ManagedEntityManagerFactory.verifyInTx(ManagedEntityManagerFactory.java:150)
17:01:47,480 ERROR [STDERR] at 
org.jboss.ejb3.entity.TransactionScopedEntityManager.merge(TransactionScopedEntityManager.java:180)
17:01:47,480 ERROR [STDERR] at 
wm.integrator.negocio.temporeal.impl.TempoRealRNBean.persistirFrente(TempoRealRNBean.java:485)

It would be great if some good soul could enlight me regarding on how to use 
the proper pattern for observing threads and how I can make this persistence 
work.
Thank you all just for being patient enough to read this extensive post.
I apologize myself for any English grammar misuse or misspell as English is not 
my 1st language. I'm from Brazil.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4064742#4064742

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4064742
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Problem with Threads and Transactional context

2007-07-16 Thread zerok
Hi guys!

I've done the same post on Seam's, because I thought that would be a good place 
to put the question together with others posts with similar problem. As it is 
indeed an EJB3 related problem, I make the same post here too. So please don't 
be mad with me because this problem is taking away my sleep and may cost my job.

Here is the post:
-
I'm using threads inside a stateless bean and I cannot persist anything without 
having that annoying message that states I can only use transaction manager 
inside a transactional context.
I've tried to make a busy-wait on my stateless bean so I can assure my bean 
will be alive until the very moment my thread needs the entityManager but when 
the execution reaches the entityManeger.merge( object ) an exception is risen.
The story:

I have a jboss-4.0.5.GA with an upgrade on my original Javassist. Now I have 
javassist-3.4 due to issues with threads.
My application needs to perform a fork in execution flow split in three parts. 
Both of them are created as threads and are observed in normal-fashion-way 
observer pattern, where the Stateless Bean is the observer.
I have a hunch that my bean life-cycle ends before my first thread finishes, so 
the entityManager looses it transactional context.
Can anybody point a blueprint for creating a structure to support such a 
business demand?

Here some parts of my code so you can place yourself. This code comes with only 
one thread. The original one has three, all like this one.

@TransactionManagement(TransactionManagementType.CONTAINER)
public @Stateless(name = TempoRealRN) class TempoRealRNBean extends 
IntegratorCommonBehavior implements TempoRealRN, Observer {

@EJB(beanName = GenericoDAO)
GenericoDAO genericoDAO;

@PersistenceContext private EntityManager entityManager;

private static final Log log = LogFactory.getLog(TempoRealRNBean.class);

...
public void processar(CommonController controladorComum) throws 
IntegratorException {

super.setEntityManager(this.entityManager);

tCorFrente = new ThreadCorFrente(controladorComum, this, log, dto, 
nomeThreadFrente, grupoFrente);
tCorFrente.addObserver(this);
tCorFrente.start();
}// ends of: public void processar(...) 

/*
* receives notification from thread state change and executes the proper action 
to acomplish bussiness rule goals.
*
*/
public void update(Object o) {

//perform some state tests

//then try to persist.
//at this point an exception is risen
this.entityManager.merge( object );

}//ends public void update(Object o)

}//ends class

The exception risen is:
--
17:01:47,480 ERROR [STDERR] Caused by: 
javax.persistence.TransactionRequiredException: EntityManager must be access 
within a transaction
17:01:47,480 ERROR [STDERR] at 
org.jboss.ejb3.entity.ManagedEntityManagerFactory.verifyInTx(ManagedEntityManagerFactory.java:150)
17:01:47,480 ERROR [STDERR] at 
org.jboss.ejb3.entity.TransactionScopedEntityManager.merge(TransactionScopedEntityManager.java:180)
17:01:47,480 ERROR [STDERR] at 
wm.integrator.negocio.temporeal.impl.TempoRealRNBean.persistirFrente(TempoRealRNBean.java:485)

It would be great if some good soul could enlight me regarding on how to use 
the proper pattern for observing threads and how I can make this persistence 
work.
Thank you all just for being patient enough to read this extensive post.
I apologize myself for any English grammar misuse or misspell as English is not 
my 1st language. I'm from Brazil.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4064753#4064753

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4064753
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user