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 have some questions regarding java in the database. From what I have read the efficiency of the java store procedures seem to have been deteriorated in SQL Anywhere 12, but I am wondering if I could use it anyway in SQL Anywhere 16. I am thinking of using java stored procedures in scheduled jobs in the database, so a scheduled job could "call" a java procedure...does anyone have any experience with this?

Then I wonder if it is possible for a java store procedure to call a ordinary procedure (watcom , t-sql procedure) in the database? Or can just a ordinary procedure call a java procedure?

asked 03 Jan '14, 04:21

M%20G's gravatar image

M G
629253044
accept rate: 42%


Regarding your comment on deteriorated performance of java store procedures (SP) in SQL Anywhere 12, I cannot comment on this except to say that I know of no change that would have made a difference to Java SP performance.

From within a Java SP you can call a SQL SP using normal JDBC calls back into the database. There is several topics on Java SPs in the documentation: for example, start by reading here and here and here.

HTH

permanent link

answered 03 Jan '14, 08:54

Mark%20Culp's gravatar image

Mark Culp
25.0k10142298
accept rate: 41%

Replies hidden

Well, that FAQ deals with a rather simple Java stored function that has been called multiple times within one SQL statement where the cost of an in-process call (as of v9 and below) is apparently cheaper than a call of a JVM in a separate process (one per database server, as of v10 and above).

If you do not call your stored procedure very frequently, or if it does a not-so-cheap task itself, I guess you won't notice any performance penalty.

(03 Jan '14, 09:59) Volker Barth

Yes, as Volker has pointed out (and also Glenn in his answer to that question), the in-process Java SPs was removed in v10 and changed to be an external process. Clearly the cost of doing a out-of-process call is more expensive than an in-process call so if you are doing lots of calls (relative to the amount of actual computation) then you will see an overall performance difference.

You need to consider your situation and weigh the costs and benefits between using Java SPs vs SQL SPs.

(03 Jan '14, 10:06) Mark Culp

Thanks for your replies

(03 Jan '14, 10:15) M G
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:

×261
×78
×34

question asked: 03 Jan '14, 04:21

question was seen: 2,941 times

last updated: 03 Jan '14, 10:15