Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Flex+dataservice+Hibernate

Avatar

Level 1
i got this error when i try to add a second item using
dataservice and

hibernate.



[RPC Fault faultString="Item with id 'markingHibernate:::0'
already

exists. Error on destination 'markingHibernate'"

faultCode="Local.Call.Failed" faultDetail="null"]



here is my code :



public function markOffer(offreId:int,userId:int):void{

var param:Array = new Array();

param.push(offreId);

param.push(userId);


//resCheck.addEventListener(CollectionEvent.COLLECTION_CHANGE,checkMarking);

var token:AsyncToken =
markingHibernateService.fill(resCheck,"flex:hql","from Marking m
where m.offre = ? and m.users = ?",param);

token.action = "mark";

token.taille = resCheck.length;

}

public function checkMarking(event:CollectionEvent):void{

taille = event.target.length;

}

private function resultHandler(event:ResultEvent):void{

if(event.token.action == "mark"){

if(event.token.taille != 0){

Alert.show("you already marked this offer , plz choose
another one","Info");

}else{

var myMarking:Marking = new Marking();

myMarking.users = usertest;

myMarking.offre = dgOfferRes.selectedItem as Offre;

myMarking.marked = "y";

myMarking.reserved = "";

markingHibernateService.createItem(myMarking);

Alert.show("success marking","Info");

}





i hope u can help me.
0 Replies