[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-07-21 Thread [EMAIL PROTECTED]
Should I inject the EntityManager with @In or use
  | 
  | EntityManager entityManager=(EntityManager) Component.getInstance 
("entityManager");

They are exactly the same.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066440#4066440

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066440
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-07-20 Thread hstang
"[EMAIL PROTECTED]" wrote : I have the same issue . Should I inject the 
EntityManager with @In or use
  | 
  |  EntityManager entityManager=(EntityManager) Component.getInstance 
("entityManager"); 
  | 
  | Which also works for me.  What is the side effect of using both approaches 
? 
  | 

The EM you receive from @PersistenceContext is container-managed whereas the EM 
from Component.getInstance() is Seam-managed scoped to the conversation 
context.  


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066315#4066315

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066315
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-07-20 Thread [EMAIL PROTECTED]
I have the same issue . Should I inject the EntityManager with @In or use

 EntityManager entityManager=(EntityManager) Component.getInstance 
("entityManager"); 

Which also works for me.  What is the side effect of using both approaches ? 


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066306#4066306

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066306
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread jamathison
Got it. I thought @PersistenceContext and @In were equivalent if I declared the 
SMPC in components.xml. I've got it wrong all over my code

thanks Pete & Felix for your help
- Al

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059331#4059331

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059331
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread jamathison
Felix,
I posted before seeing your reply. I'm confused. What's not SMPC about it? I'll 
 go look at the docs again
thanks,
al

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059329#4059329

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059329
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread jamathison
I found that if instead of using the injected entityManager, I use the one 
returned by:

(EntityManager) Component.getInstance ("entityManager");

then it works for some reason... 
- Al


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059328#4059328

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059328
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread fhh

  |@PersistenceContext(type=PersistenceContextType.EXTENDED)
  |private EntityManager entityManager;
  | 

Doesn't look very Seam managed to me.

Regards

Felix

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059326#4059326

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059326
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread jamathison
Hi Pete,
Thanks for the quick reply. I am using SMPCs, and  I made all the config 
changes specified in the  Seam 2.0 Migration Guide in Fisheye. 

Aren't all requests wrapped in a temporary conversation? At any rate, I am 
inside a long running conversation. Originally, I was making the 
itemTextDAO.getTutorialCategories call from inside a SFSB with 
ScopeType.CONVERSATION and outjecting it. Then I made it a member (with a 
get/set) of that same SFSB instead of outjecting. All with the same outcome. 

Here's the entity query in a conversation scoped SFSB:


  | @Stateful
  | @Name("tutorialEditAction")
  | @Scope(ScopeType.CONVERSATION)
  | public class EditActionBean implements EditAction, Serializable {
  | 
  | @PersistenceContext(type=PersistenceContextType.EXTENDED)
  | private EntityManager entityManager;
  | 
  | @Logger
  | private Log log;
  | 
  | private List tutorialCategories;
  | 
  | 
  | @Create @Begin(join=true)
  | public String create() {
  | return "created";
  | }
  | 
  | @Begin(join=true)
  | public String begin() {
  | log.info ("Inside tutorialEditAction.begin");
  | return "begin";
  | }
  | 
  | public List getTutorialCategories() {
  | log.info ("Begin tutorialEditAction.getTutorialCategories()");
  | if (this.tutorialCategories == null) {
  | try {
  | Query query = entityManager.createQuery (
  | "select it from ItemText it 
where it.itemCode.itemCodeType.name=:name and it.locale=:locale order by 
it.text asc");
  | query.setParameter ("name", 
ItemCodeType.ItemCodeTypeEnum.TUTORIAL_CATEGORY);
  | query.setParameter ("locale", 
Locale.US.toString());
  | this.tutorialCategories = (List) 
query.getResultList();
  | 
  | } catch (NoResultException ex) {
  | this.tutorialCategories = new 
ArrayList(0);
  | }
  | 
  | }
  | log.info ("End tutorialEditAction.getTutorialCategories()");
  | return this.tutorialCategories;
  | }
  | public String getCategory() {
  | return "Application";
  | }
  | public void setCategory(String value) {
  | }
  | @End
  | public String save() {
  | log.info("Inside tutorialEditAction.save()");
  | return "saved";
  | }
  | 
  | @Destroy @Remove
  | public void destroy() {}
  | 
  | }
  | 
  | 
And my xhtml fragment:

  | http://www.w3.org/1999/xhtml";
  | xmlns:s="http://jboss.com/products/seam/taglib";
  | xmlns:f="http://java.sun.com/jsf/core";
  | xmlns:h="http://java.sun.com/jsf/html";
  | xmlns:ui="http://java.sun.com/jsf/facelets";>
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
components.xml:

  | 
  | http://jboss.com/products/seam/components";
  | xmlns:core="http://jboss.com/products/seam/core";
  | xmlns:drools="http://jboss.com/products/seam/drools";
  | xmlns:jms="http://jboss.com/products/seam/jms";
  | 
xmlns:persistence="http://jboss.com/products/seam/persistence";
  | xmlns:security="http://jboss.com/products/seam/security";
  | xmlns:web="http://jboss.com/products/seam/web";
  | xmlns:theme="http://jboss.com/products/seam/theme";
  | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  | xsi:schemaLocation=
  | "http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.0.xsd
  |  http://jboss.com/products/seam/drools  
http://jboss.com/products/seam/drools-2.0.xsd
  |  http://jboss.com/products/seam/jms 
http://jboss.com/products/seam/jms-2.0.xsd
  |  http://jboss.com/products/seam/persistence 
http://jboss.com/products/seam/persistence-2.0.xsd
  |  http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-2.0.xsd
  |  http://jboss.com/products/seam/web 
http://jboss.com/products/seam/web-2.0.xsd
  |  http://jboss.com/products/seam/theme   
http://jboss.com/products/seam/theme-2.0.xsd
  |  http://jboss.com/products/seam/components  
http://jboss.com/products/seam/components-2.0.xsd";>
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 

[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread [EMAIL PROTECTED]
Use an SMPC and make sure you are in a conversation.  If you are stateless this 
is fine.  It's when you are in session scope its harder.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059274#4059274

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059274
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-29 Thread jamathison
I'm getting this one too, in code that worked in 1.2.1.GA. (I already voted in 
Jira). I'm trying to upgrade to Seam 2.0.BETA1 and AS 4.2.GA.

I removed all outjection, and stripped it down to the following simple usecase: 
I have a stateless session bean that returns a list of entities, which are then 
immediately used to populate a selectOneMenu. 

Bean:

  | @Stateless
  | @Name("itemTextDAO")
  | public class ItemTextDAOBean implements ItemTextDAO {
  | 
  | @PersistenceContext
  | EntityManager entityManager;
  | 
  | public List getTutorialCategories () {
  |Query query = entityManager.createQuery  (
  | "select it from ItemText it where 
it.itemCode.itemCodeType.name=:name ");
  | query.setParameter ("name", "TUTORIAL_CATEGORY");
  | return (List) query.getResultList();
  | }
  | }
  | 
  | 

html:

  | 
  | 
  | 
  | 
  | 
  | 
  | 

I then get the same exception /stacktrace that Felix did.

Any ideas for a workaround would be greatly appreciated, or else I'll have to 
give up on upgrading for now...

thanks,
Al

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059269#4059269

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059269
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-28 Thread [EMAIL PROTECTED]
http://jira.jboss.com/jira/browse/JBSEAM-1487

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058615#4058615

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058615
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-27 Thread jazir1979
Also, I have a quick question-  would it be as simple as changing the 
PersistenceProvider.instance().getId() to do the same thing as the default 
getId() implementation (Entity.forClass( bean.getClass() ).getIdentifier(bean)) 
rather than delegating to Hibernate?

Or will I run into further TransientObjectExceptions later on?


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058540#4058540

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058540
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-27 Thread jazir1979
This a big step backwards in my opinion.  I have a similar situation to the 
above, although my factories were for application scope, not even at the user 
session level.

Now to populate these select boxes I will have to hit the DB over and over.  I 
guess the "widest" scope I can cache these now will be at the conversation 
level.  I'll give that a go.  

Did Felix create a JIRA, or would you like me to?

thanks,
Daniel.

"petemuir" wrote : Yeah, the way I reimplemented it requires that the entities 
you feed to the entityconverter are managed.  I updated the docs to reflect 
this.  File a JIRA issue and I'll see if I can work around this (won't be for 
1.3 though)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058535#4058535

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058535
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not

2007-06-17 Thread petemuir
Yeah, the way I reimplemented it requires that the entities you feed to the 
entityconverter are managed.  I updated the docs to reflect this.  File a JIRA 
issue and I'll see if I can work around this (won't be for 1.3 though)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055052#4055052

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055052
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user