0

I am working on JDBCRowLoader.. I followed all the instructions, running below attach_loader.

call sys.attach_loader('app', 'cust', 'com.mohan.coe.JDBCRowLoader', '|url=jdbc:oracle:thin:@pivhdsne:1521/xe|query-string=select * from system.cust where id=111|user=SYSTEM|password=abcdef|min-connections=5|max-connections=100');

It is printing oracle connection details in the gemfire xd server log and connection is not being established to oracle. The above statement is executing successfully.

By the way, I am using sqlf interface. Only issue is connection is not being established to oracle. JDBCRowLoader initialization is finished successfully.

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

1

Can you post a snippet of the gemfirexd system log where it prints it couldn't connect to oracle?

Check if you are able to connect directly from a client program using the same connection properties.

  • after your reply, I realized couple of points to check. Please give me some time sir, I will update you. Thanks a lot for your reply. – Madhu Mohan Kommu Apr 23 '15 at 05:23
  • Oracle is running. I copied JDBCRowLoader program from below url and made it as a jar, started with sqlf server start classpath. see the url I followed.https://github.com/scottfrederick/jdbc-rowloader. This is my attach_loader --> call sys.attach_loader('app', 'cust', 'com.vmware.sqlfire.loader.JDBCRowLoader', '|url=jdbc:oracle:thin:@pivhdsne:1521/xe|query-string=select *from system.cust where id=111|user=SYSTEM|password=abcdef|min-connections=5|max-connections=100'); and here is my server logs. same as earlier. – Madhu Mohan Kommu Apr 23 '15 at 16:51
  • .[info 2015/04/23 12:25:22.092 EDT tid=0x3f] JDBCRowLoader initialized.[info 2015/04/23 12:25:22.093 EDT tid=0x3f] user: SYSTEM [info 2015/04/23 12:25:22.093 EDT tid=0x3f] password: xxxxxx [info 2015/04/23 12:25:22.093 EDT tid=0x3f] url: jdbc:oracle:thin:@pivhdsne:1521/xe [info 2015/04/23 12:25:22.093 EDT tid=0x3f] min-connections: 5 [info 2015/04/23 12:25:22.093 EDT tid=0x3f] max-connections: 100 – Madhu Mohan Kommu Apr 23 '15 at 16:56
  • [info 2015/04/23 12:25:22.093 EDT tid=0x3f] query-string: select *from system.cust where id=111 ..JDBCRowLoader program, has 2 methods one is init() and getRow(). It is calling upto init() and getRow() is being called. Please help me. Thank You. – Madhu Mohan Kommu Apr 23 '15 at 17:04
  • init() is being called and getRow() is not being called, where all connection establishment and query starts. That's why it is printing up to only query-string. I am not able to find the reason. Please help me in this. – Madhu Mohan Kommu Apr 23 '15 at 17:25
  • 1
    From the logs the row loader seems initialized alright. I am hoping you understand that the row loader will be invoked only when there is a miss in GemFireXD. The data won't be loaded on its own just by attaching the row loader to the table. Are you firing any queries on GemFireXD the results of which you expect to be loaded from your oracle database? Fire queries and see if you get something in the logs. You can also add your own logs (see example use in the JDBCRowLoader class). – Sunil Jigyasu Apr 24 '15 at 07:56
  • Thanks for your reply. Please correct me if I am wrong. I have created customer table in Oracle and GemFire XD as well. inserted sample data into the customer table in oracle and Gemfire xd. I mean in both DB's. Now, I executed a rowloader attach command with where clause id=111, I have updated a first name in Oracle database with where clause id=111 and I am expecting, updated row should automatically fetch from oracle and update in gemfire xd table first name with where cluase id=111. – Madhu Mohan Kommu Apr 24 '15 at 08:52
  • After it printing query-stiring in server logs, have waited so much time for getRow() invocation. But getRow() method not being called.Please help me in this.Thank You. – Madhu Mohan Kommu Apr 24 '15 at 08:53
  • 2
    That's a wrong expectation. Adding a row to Oracle table will not automatically load it into GemFireXD. You need to query GemFireXD table - if it misses the row it will load from Oracle through your RowLoader. – Sunil Jigyasu Apr 24 '15 at 09:12
  • Thanks a lot for clarifying my understanding. I will try and update you. It is really helpful. Iwill follow the same instructions and will query gemfire xd table from sqlf inetrface after attaching table and updating a row in oracle.. By the way, can you please confirm, in gemfire xd product example programs, there are so many programs, I feel there is no dependency to run rowloader. just JDBCRowLoader program is enough right. Please confirm this. Thank you man. – Madhu Mohan Kommu Apr 24 '15 at 09:16
  • 1
    No, for the row loader example there is no dependency except for the JDK libs and the external Oracle driver that you are using. – Sunil Jigyasu Apr 24 '15 at 09:40
  • Thanks a lot man. It is working. It is giving "No suitable driver found" exception. But, I know where is the problem. Its invoked getRow() and works good here after. will confirm everything soon. Thanks a lot boss. – Madhu Mohan Kommu Apr 24 '15 at 13:25
  • successfully trigged and loaded data from oracle to gemfire xd.I have updated a row in oracle and again query the same.insert into coe values('Mohan','Bangalore'); as per this query it is able to fetch Bangalore for where name='Mohan'; But, update coe set place='Hyderabad' where name='Mohan'; commit;now value for Mohan is Hyderabad. Again query from gemfire xd with where name='Mohan'. Rowloader is not able to fetch new value from oracle. Is this correct behavior or limitation of RowLoader or am I missing some thing? Please help me. Thank You. – Madhu Mohan Kommu Apr 25 '15 at 11:28
  • @Suyodha, I think you should post your code, commenting would not help to resolve the issue. – Avinash Apr 27 '15 at 11:57