Re: Query at the time of inserting data using Apache Cayenne

2015-09-13 Thread Andrus Adamchik
I second that. Here is the class: https://github.com/apache/cayenne/blob/master/cayenne-server/src/main/java/org/apache/cayenne/configuration/web/StatelessContextRequestHandler.java#L52 Andrus > On Sep 12, 2015, at 8:52 AM, John Huss wrote: > > You can just copy StatelessContextRequestHandler.

Re: Query at the time of inserting data using Apache Cayenne

2015-09-12 Thread John Huss
You can just copy StatelessContextRequestHandler. It's small and simple. On Sat, Sep 12, 2015 at 7:48 AM Dipesh Jain wrote: > Thanks @Andrus for the help. I am using CayenneFilter session-scoped > context, > because of that I was having problem. I saw your solution but I am using > cayenne 3.1 an

Re: Query at the time of inserting data using Apache Cayenne

2015-09-12 Thread Dipesh Jain
Thanks @Andrus for the help. I am using CayenneFilter session-scoped context, because of that I was having problem. I saw your solution but I am using cayenne 3.1 and it does not have StatelessContextRequestHandler class. My entire project is based on Web Services so is there any other way I can us

Re: Query at the time of inserting data using Apache Cayenne

2015-09-11 Thread Andrus Adamchik
Ari's example was idiomatic Cayenne, even though it did not contain the solution. I.e. it is generally a good idea to create and register a new object in one place with context.newObject(..), before you start modifying object properties. Anyways... >> I have solved the problem by changing my p

Re: Query at the time of inserting data using Apache Cayenne

2015-09-11 Thread Dipesh Jain
I have tried to implement @Aristedes Maniatis answer but still result was same. I want to know why and how apache cayenne is doing this. I do not want the solution because I already have the answer. On Wed, Sep 9, 2015 at 9:41 PM, Dipesh Jain wrote: > I have written a code in java 8 to insert da

Re: Query at the time of inserting data using Apache Cayenne

2015-09-09 Thread Philip Copeland
Unsubscribe Sent from Outlook On Wed, Sep 9, 2015 at 9:27 AM -0700, "Dipesh Jain" mailto:dip...@ivgroup.in>> wrote: I have written a code in java 8 to insert data in sql server 2012 using apache cayenne 3.1. While executing code I got an exception : **org.apache.cayenne

Re: Query at the time of inserting data using Apache Cayenne

2015-09-09 Thread Aristedes Maniatis
On 10/09/2015 2:11am, Dipesh Jain wrote: > Person person = new Person(); > person.setFirstName("John"); > person.setLastName("Cross"); > ObjectContext context = BaseContext.getThreadObjectContext(); > context.registerNewObject(person); Try this instead DataContext context

Query at the time of inserting data using Apache Cayenne

2015-09-09 Thread Dipesh Jain
I have written a code in java 8 to insert data in sql server 2012 using apache cayenne 3.1. While executing code I got an exception : **org.apache.cayenne.CayenneRuntimeException: [v.3.1 Sep 20 2014 14:24:57] Commit Exception Caused by: java.sql.SQLException: Could not find stored procedure 'auto_p