Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I succeed in deploy workflow package into simulator. But, on the simaulator, I tried to insert a request record into a table in db, It does not exist in the table.

Is there any option in connection string like autocommit=true ?

So I traced it with starting a asa via "-zr all".

+1,<,8,EXEC_ANY_IMM,set chained off set quoted_identifier on set textsize 2147483647
=,W,8,105,Procedure has completed
=,>.,8
+6,<,8,EXEC_ANY_IMM,set chained on
=,>.,8
+2,<,8,PREPARE,INSERT INTO sampledb.dba.TravelRequest (trvl_Date, trvl_Loc, est_Cost, purpose, trvl_Status, st_Cmmnt) VALUES (?, ?, ?, ?, ?, ? )  SELECT * FROM sampledb.dba.TravelRequest WHERE trvl_Id=@@IDENTITY
+1,>,8,PREPARE,65536
=,<,8,EXEC_ANY_IMM,dbo.sp_sql_type_name
+35,W,8,100,Row not found
=,W,8,105,Procedure has completed
=,>.,8
+1,<,8,EXEC_ANY_IMM,select property('ProductName')
=,W,8,100,Row not found
=,W,8,105,Procedure has completed
+1,>.,8
+1,<,8,EXEC_ANY_IMM,rollback

Could you know why the insert statement was rollbacked ?

Thanks in advance,

asked 05 Feb '12, 20:54

ooops's gravatar image

ooops
91558
accept rate: 0%

edited 05 Feb '12, 21:13

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297

What API are you using to access the database? And (as usual), what version (and EBF) of SQL Anywhere are you using?

(06 Feb '12, 02:27) Volker Barth

This output looks like you are using jConnect to connect to the database ('EXEC_ANY_IMM' preceeds all statements and you are automatically executing 'sp_tsql_environment' upon start-up) - is that correct?

Is there any option in connection string like autocommit=true ?

For jConnect, you need to use the connection-level method from the JDBC API specification: Connection.setAutoCommit(). For other APIs, see this documentation section.


=,<,8,EXEC_ANY_IMM,dbo.sp_sql_type_name
+35,W,8,100,Row not found

"sp_sql_type_name" is a jConnect metadata stored procedure call (and this information is being requested from your Java program, via a JDBC "metadata" call).

If you are required to return this type of data (database metadata) to your Java application, you are required to install the jConnect metadata system objects on to your database first.

e.g. Using "ALTER DATABASE":

ALTER DATABASE UPGRADE JCONNECT ON;
permanent link

answered 06 Feb '12, 12:28

Jeff%20Albion's gravatar image

Jeff Albion
10.8k171175
accept rate: 25%

edited 06 Feb '12, 14:00

1

@Jeff: Thanks for telling so much more than just "Yes, I could know":)

(06 Feb '12, 12:48) Volker Barth

Can you provide the original statement? From the log above your insert statement looks to me as if you try to insert based on a select. The statement

SELECT * FROM sampledb.dba.TravelRequest WHERE trvl_Id=@@IDENTITY

will only provide you a result after the insert, because @@IDENTITY returns the id of the last inserted autoincrement field.

permanent link

answered 06 Feb '12, 02:59

Martin's gravatar image

Martin
9.0k130169257
accept rate: 14%

...or after a previous INSERT?

(06 Feb '12, 04:22) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×59

question asked: 05 Feb '12, 20:54

question was seen: 2,650 times

last updated: 06 Feb '12, 14:00