Re: Newbie web services with WO question
Re: Newbie web services with WO question
- Subject: Re: Newbie web services with WO question
- From: Chuck Hill <email@hidden>
- Date: Thu, 25 May 2006 12:46:37 -0700
On May 25, 2006, at 12:30 PM, Luigi Giannini wrote:
Yes I have a EO_PK_TABLE.
What is the function of this table?
It is what EOF uses to generate primary key values when the database
does not provide usable, native support.
Where I can read about it from a more technical point of view?
If you search on Apple's site, you can find some mention of it.
Usually all you have to do is to not delete it. :-)
I have modelled the primary key for PazientiAnagrafica entity with
following attributes:
- "Allows null" set to no
- "Class property" set to no
- "Locking" set to yes
- "External Type" set to int
- "Width" set to 4
Width is for strings, leave this blank.
- "Value class java" set to number
- "Value Type" set to i
for "External Type" I try different values with no success within some
(but not all) of these:
- uniqueidentifier
- tinyint identity
- smallint identity
- numeric() identity
- decimal() identity
- bigint identity
It is difficult to use identity columns with EOF. You should avoid
them. Just make the column int or bigint or something like that and
EOF will make sure the PK gets generated.
And I not find nothing about the right choose about "External Type"
setting when the fields in DB is the primary key.
Numeric, int, bigint should all be fine.
Moreover I want
specify that the attributes in MSSQL table for this field are normal:
Data type=int ; Lenght=4 ; Allows null=no.
Is clear also for a newbie like me that the error depends by a JDBC
problem but, without the someone else help, I have no chance.
In the technical specifications of official Apple WebObjects web site
you can read that Microsoft SQL Server 2000 8.00.194 is supported.
Where one newbie WOdeveloper can find jdbc for this RDBMS?
I search in the web and find JTDS jdbc that seem (to me) a valid,
mature and fast jdbc driver for MS-sql-srv.
May be that the jdbc driver generate the problem but if so, please,
It may be that driver. Can you post the entire stack trace?
someone show me the right jdbc to use without surprise ... or may be
that a newbie like me makes (or forget to make) something! Any ideas?
Chuck
2006/5/25, Chuck Hill <email@hidden>:
On May 24, 2006, at 2:41 PM, Luigi Giannini wrote:
> Hello everyones,
> these are my first steps in WO then please patient ...
>
> I try to write a simple web service connected to MS SQL srv with
> WebServicesAssistant
> Create the EOmodel named ObjectMed using JDBC and jtds 1.2
> Create Xcode WO project with WebServicesDirect assistant
> Create a WebService (named anagrafica) in WebServicesAssistant
> Create an operation (named cerca) that search in the DB table named
> PazientiAnagrafica
> Testing the operation cerca is OK
> Create an operation (named nuovoPaziente) that insert a new
record (
> ... ops object) but I have only this frustrating message:
>
> Exception:
> com.webobjects.foundation.NSForwardException
> [org.apache.axis.AxisFault] java.lang.IllegalArgumentException:
> java.lang.IllegalStateException: Adaptor
> com.webobjects.jdbcadaptor.JDBCAdaptor@f98f80 failed to provide new
> primary keys for entity 'PazientiAnagrafica': Exception trying to
> invoke operation: nuovoPaziente
>
> What is wrong?
That looks like a JDBC error, not a WebServices one. How have you
modelled the primary key for this PazientiAnagrafica entity? I have
not used MS SQL server, you might need an EO_PK_TABLE? Do you see
one in the database?
Personally, I would get a very simple web app to be able to do this
(insert into the database) and then move it to web services.
Chuck
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/
practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming in late 2006 - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden