Re: no state snapshot available on embedded mapping

2008-07-16 Thread Marc Logemann
Ok, will get it from there. Thanks for your efforts. I will report  
back then.


--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 16.07.2008 um 01:02 schrieb Pinaki Poddar:



The fix is on the trunk i.e. 1.2.0-SNAPSHOT.

--
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p530026.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.





Re: no state snapshot available on embedded mapping

2008-07-15 Thread Marc Logemann

Hi,

the strtegy is:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
String oid;

I will check it with both strategies (app vs. datastore) and comment  
on it


--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 14.07.2008 um 20:15 schrieb Pinaki Poddar:



What is the identity strategy used by the Order.class? While  
reproducing the
error, that factor *seems* to be crucial than whether there is a  
embedded
field. Can you verify if there is a change in behavior if  
Order.class uses

datastore vs application identity?


Marc Logemann-3 wrote:


and yes, for the record: i changed to build time enhancement and now
embedded entities work. Still interessted in the why answer.

--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 14.07.2008 um 16:22 schrieb Pinaki Poddar:



Hi,
 Are you using runtime enhancement with Java 5?
 If yes, the immediate workaround is to enhance the persistent
classes at
build-time.

--
View this message in context:
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527331.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.







--
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527706.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.





Re: no state snapshot available on embedded mapping

2008-07-15 Thread Pinaki Poddar

hi,
  a fix for openjpa-659 has been added. but have tested it only against JSE
environment. If possible, you can apply the change in your environment to
let us know if that changes anything.



Marc Logemann-3 wrote:
 
 Hi,
 
 the strtegy is:
 
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  String oid;
 
 I will check it with both strategies (app vs. datastore) and comment  
 on it
 
 --
 Marc Logemann
 blog http://logemannreloaded.blogspot.com
 privat http://www.logemann.org
 
 
 
 Am 14.07.2008 um 20:15 schrieb Pinaki Poddar:
 

 What is the identity strategy used by the Order.class? While  
 reproducing the
 error, that factor *seems* to be crucial than whether there is a  
 embedded
 field. Can you verify if there is a change in behavior if  
 Order.class uses
 datastore vs application identity?


 Marc Logemann-3 wrote:

 and yes, for the record: i changed to build time enhancement and now
 embedded entities work. Still interessted in the why answer.

 --
 Marc Logemann
 blog http://logemannreloaded.blogspot.com
 privat http://www.logemann.org



 Am 14.07.2008 um 16:22 schrieb Pinaki Poddar:


 Hi,
  Are you using runtime enhancement with Java 5?
  If yes, the immediate workaround is to enhance the persistent
 classes at
 build-time.

 -- 
 View this message in context:
 http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527331.html
 Sent from the OpenJPA Users mailing list archive at Nabble.com.





 -- 
 View this message in context:
 http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527706.html
 Sent from the OpenJPA Users mailing list archive at Nabble.com.

 
 
 

-- 
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p529502.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.



Re: no state snapshot available on embedded mapping

2008-07-15 Thread Marc Logemann
i will test it tomorrow with the 1.1.0 nightly build. There the fix is  
applied isnt it?


--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 15.07.2008 um 20:22 schrieb Pinaki Poddar:



hi,
 a fix for openjpa-659 has been added. but have tested it only  
against JSE
environment. If possible, you can apply the change in your  
environment to

let us know if that changes anything.



Marc Logemann-3 wrote:


Hi,

the strtegy is:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
String oid;

I will check it with both strategies (app vs. datastore) and comment
on it

--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 14.07.2008 um 20:15 schrieb Pinaki Poddar:



What is the identity strategy used by the Order.class? While
reproducing the
error, that factor *seems* to be crucial than whether there is a
embedded
field. Can you verify if there is a change in behavior if
Order.class uses
datastore vs application identity?


Marc Logemann-3 wrote:


and yes, for the record: i changed to build time enhancement and  
now

embedded entities work. Still interessted in the why answer.

--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 14.07.2008 um 16:22 schrieb Pinaki Poddar:



Hi,
Are you using runtime enhancement with Java 5?
If yes, the immediate workaround is to enhance the persistent
classes at
build-time.

--
View this message in context:
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527331.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.







--
View this message in context:
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527706.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.







--
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p529502.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.





Re: no state snapshot available on embedded mapping

2008-07-15 Thread Pinaki Poddar

The fix is on the trunk i.e. 1.2.0-SNAPSHOT.

-- 
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p530026.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.



Re: no state snapshot available on embedded mapping

2008-07-14 Thread Craig L Russell

Hi Marc,

On Jul 14, 2008, at 8:37 AM, Marc Logemann wrote:

and yes, for the record: i changed to build time enhancement and now  
embedded entities work. Still interessted in the why answer.


Yeah, me too.

The difference might be due to something in your classes being  
enhanced differently using one enhancement technique versus another.


Could you please file a JIRA with the relevant detail?

Thanks,

Craig



--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 14.07.2008 um 16:22 schrieb Pinaki Poddar:



Hi,
 Are you using runtime enhancement with Java 5?
 If yes, the immediate workaround is to enhance the persistent  
classes at

build-time.

--
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527331.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.





Craig L Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!



smime.p7s
Description: S/MIME cryptographic signature


Re: no state snapshot available on embedded mapping

2008-07-14 Thread Pinaki Poddar

Hi,
  I am not familiar enough with runtime enhancement, so please accept my
explanation with certain degree of disbelief.

   OpenJPA tracks the dirty fields of managed instances and traditional
(i.e. build-time) enhancement ensures that at bytecode level on field
mutators. Runtime enhancement is also able to track dirty fields
when
a) Java 6 is the runtime
b) Java 5 and entity using property access and are loaded from database
(not for new instances)

   In Java 5, the entities with field access are not tracked and hence
during commit session, OpenJPA resorts to state comparison for such cases. 
This checking is skipped on certain cases, as described below: 
private boolean needsDirtyCheck() {
if (isIntercepting())
return false;
if (isDeleted())
return false;
if (isNew()  !isFlushed())
return false;
+if (!isTransactional())
+return false;
return true;
}

Including non-transactional entities to skip dirty check resolves the
issue you have encountered. Exclusion of nontransactional entities form
dirty checking sounds logical to me but due to my limited understanding of
runtime enhancement I am not able to confirm.

 
 * pFields are tracked for all classes that are run through the
OpenJPA
 * enhancer prior to or during deployment, and all classes (enhanced or
 * unenhanced) in a Java 6 environment or newer./p
 *
 * pIn a Java 5 VM or older:
 * br- instances of unenhanced classes that use
 * property access and obey the property access limitations are tracked
 * when the instances are loaded from the database by OpenJPA, and are
 * not tracked when the instances are created by application code.
 * br- instances of unenhanced classes that use field access are
 * never tracked./p

  Change tracking of classes  

Marc Logemann-3 wrote:
 
 Hi,
 
 yes, i am using a spring-tomcat-weaver.jar in Tomcat6 (with Java5) to  
 achieve JPA runtime enhancement via Spring.
 
 What do you mean with workaround? Should this work normally ? I was  
 quite happy with runtime enhancement, would be sad to leave that  
 path
 
 thx for infos
 
 --
 Marc Logemann
 blog http://logemannreloaded.blogspot.com
 privat http://www.logemann.org
 
 
 
 Am 14.07.2008 um 16:22 schrieb Pinaki Poddar:
 

 Hi,
   Are you using runtime enhancement with Java 5?
   If yes, the immediate workaround is to enhance the persistent  
 classes at
 build-time.

 -- 
 View this message in context:
 http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527331.html
 Sent from the OpenJPA Users mailing list archive at Nabble.com.

 
 
 

-- 
View this message in context: 
http://n2.nabble.com/no-state-snapshot-available-on-embedded-mapping-tp526616p527542.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.



Re: no state snapshot available on embedded mapping

2008-07-14 Thread Marc Logemann

here we go:

https://issues.apache.org/jira/browse/OPENJPA-659


--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org



Am 14.07.2008 um 18:24 schrieb Craig L Russell:


Could you please file a JIRA with the relevant detail?

Thanks,

Craig




no state snapshot available on embedded mapping

2008-07-13 Thread Marc Logemann

Hi,

i am getting this exception:

org.springframework.orm.jpa.JpaSystemException: No state snapshot is  
available for instance of type de.logentis.bwh.model.Payment, but  
this instance uses state-comparison for dirty detection.; nested  
exception is openjpa-1.1.0-r422266:657916 fatal general error  
org.apache.openjpa.persistence.PersistenceException...


Here are the relevant pieces of the casses:

@Entity
@Table(name = orders)
@VersionColumn(name = _version)
public class Order {
...
@Embedded
Payment payment;
}

@Embeddable
public class Payment {

@Basic
@Enumerated(EnumType.STRING)
@Column(name = paymenttype)
PaymentType type;

@Column(name = currency)
String currency;

@Column(name = pricing)
String pricing;

@Column(name = cost)
int cost;
}

The point is, persisting is no problem at all, the exception will be  
thrown by issueing:


Query query = getEntityManager().createQuery(select o FROM Order o);
 query.getResultList();

What have i made wrong here? Looked in the docs and everything seems  
like expected


--
Marc Logemann
blog http://logemannreloaded.blogspot.com
privat http://www.logemann.org