5 Replies Latest reply on May 17, 2013 5:13 PM by jlakumb

    Java call the pi-api with JNI

    david@realiv

      Hi,

       

        I  came across a problem when I call the pi-api encapsulated by JNI with Java.But the one function returned 2 as calling  the other function.It seems that

       

      the java-api  encapsulated by JNI can't be call simultaneously. How handle this?

       

      sorry for my bad English. 

        • Re: Java call the pi-api with JNI
          hanyong

          Hello,

           

          PI API is something that we do not support in terms of development anymore. The reason for this is brought up in several other older threads like this one

           

          Have you considered using PI JDBC Driver for getting data from the PI System?

            • Re: Java call the pi-api with JNI
              david@realiv

              Thank you for your reply

               

              Is the performance of reading or writing lower  with  PI  JDBC Driver ?

              • Re: Java call the pi-api with JNI
                david@realiv

                Thank you for your reply

                 

                Is the performance of reading or writing lower  with  PI  JDBC Driver ?

                  • Re: Java call the pi-api with JNI

                    Hello Quan,

                     

                    There are several layers between PI JDBC and the PI System. PI JDBC is using PI Data Access Server that itself uses PI OLEDB (Classic) Provider and PI OLEDB Enterprise. PI OLEDB (Classic) Provider is using PI SDK for PI Server access. PI OLEDB Enterprise is using AF SDK to access PI AF.

                     

                    This said performance with PI JDBC is less good than through PI API but as mentioned by Han Yong, custom usage of PI API isn't supported anymore.

                      • Re: Java call the pi-api with JNI
                        jlakumb

                        Just to add more info on the technical issue, PI API is single-threaded and not thread-safe.  This means that calling PI API from a multithreaded application requires thread synchronization.  There are other reasons (technical and commercial) for not recommending the use of PI API...

                         

                        To flip the question around, if you can provide some info regarding your performance, scalability and other requirements, then perhaps we can recommend which PI Data Access product(s) will best meet your needs.  For example, what is the number of events/second you need to read/write?  What operations do you need to do on this data (e.g. read, update, append, delete)?  How many simultaneous operations/users?  It looks like you are writing Java application - what OS are you targeting (Windows, Unix, Linux)?

                         

                        If you can share some additional details on your use case, then hopefully we can try to steer you in the right direction.