withTransaction(true) issue

40 views
Skip to first unread message

Sven Haiges

unread,
Apr 4, 2013, 7:44:36 AM4/4/13
to gae...@googlegroups.com
Hi all, 

I am trying to perform a cross-group transaction, according to the tutorial that's a call with true as the first parameter to withTransaction:

//true signals cross-group transaction
datastore.withTransaction(true) { 

//delete sessions
def sessionKeys = datastore.execute {
select keys 
from 'session'
}
log.info "Will attempt to delete ${sessionKeys.size()} sessions."
datastore.delete(sessionKeys)
log.info "DONE"

//delete participants
def participantKeys = datastore.execute {
select keys 
from 'participant'
}
log.info "Will attempt to delete ${participantKeys.size()} participants."
datastore.delete(participantKeys)
log.info "DONE"

//delete event
log.info "Will attempt to delete the default event"
getEvent(params.id).delete()
log.info "DONE"
}

Unfortunately I get this error:

groovy.lang.MissingMethodException: No signature of method: com.google.appengine.api.datastore.DatastoreServiceImpl.withTransaction() is applicable for argument types: (java.lang.Boolean, events$_delete_closure1) values: [true, events$_delete_closure1@15ca4d6b]

So it seems the implementation is simply missing. I am running with gaelyk 1.2, the current final out there. 

Any ideas what could be wrong?

Thx
Sven

Guillaume Laforge

unread,
Apr 4, 2013, 8:08:26 AM4/4/13
to gae...@googlegroups.com
Hi Sven,

Groovy's error message here is actually right, as it's not finding that method.
It seems we added withTransaction(true) {} after 1.2, last december, so it's going to be available in Gaelyk 2.0.
But the documentation seems to reference some 2.0 elements (I thought it didn't and it's a mistake), and we also uploaded a 2.0-SNAPSHOT version of the JavaDoc as well, so it's a bit confusing for our users I reckon :-(
So, for now, either use a 2.0-SNAPSHOT, or be patient for a few more days as the Gaelyk 2.0 release is imminent.

Guillaume


--
--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Gaelyk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaelyk+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware

Sven Haiges

unread,
Apr 16, 2013, 4:47:55 AM4/16/13
to gae...@googlegroups.com
Wow, thx for the good news. Go go go Gaelyk2!
Reply all
Reply to author
Forward
0 new messages