Re: Process suspend when get Hana connection in open method of sink function

2021-08-19 Thread Chesnay Schepler
If the Hana driver cannot be loaded then the most likely reason is that 
the dependency is not actually on the classpath.

Please double-check that your user jar bundles the dependency.

On 18/08/2021 15:05, Chenzhiyuan(HR) wrote:


Dear all:

I have a problem when I want to sink data to Hana database.

Process is suspended when get Hana connection in the open method of 
sink function as below.


My flink version is 1.10.

public class HrrmPayValueSumToHana extends 
RichSinkFunction  {


@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
connection = HrrmUtils./getHanaConnection/();    // process is 
suspended here

}

@Override public void invoke() {
  …….
}
@Override public void close() throws Exception {
  ……….
}

}

public static Connection getHanaConnection() { Connection con = null; 
try { Class./forName/(HrrmConstants./HANA_DRIVER_CLASS/); con = 
DriverManager./getConnection/(HrrmConstants./HANA_SOURCE_DRIVER_URL/, 
    HrrmConstants./HANA_SOURCE_USER/, 
HrrmConstants./HANA_SOURCE_PASSWORD/);    } catch (Exception e) { /LOG/.error("---hana get connection has exception , msg = ", e); 
    } return con; }


Hana driver dependency as below:

     com.sap.cloud.db.jdbc     
ngdbc     2.3.62 






Re: Process suspend when get Hana connection in open method of sink function

2021-08-19 Thread Chesnay Schepler
If the Hana driver cannot be loaded then the most likely reason is that 
the dependency is not actually on the classpath.

Please double-check that your user jar bundles the dependency.

On 18/08/2021 15:05, Chenzhiyuan(HR) wrote:


Dear all:

I have a problem when I want to sink data to Hana database.

Process is suspended when get Hana connection in the open method of 
sink function as below.


My flink version is 1.10.

public class HrrmPayValueSumToHana extends 
RichSinkFunction  {


@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
connection = HrrmUtils./getHanaConnection/();    // process is 
suspended here

}

@Override public void invoke() {
  …….
}
@Override public void close() throws Exception {
  ……….
}

}

public static Connection getHanaConnection() { Connection con = null; 
try { Class./forName/(HrrmConstants./HANA_DRIVER_CLASS/); con = 
DriverManager./getConnection/(HrrmConstants./HANA_SOURCE_DRIVER_URL/, 
    HrrmConstants./HANA_SOURCE_USER/, 
HrrmConstants./HANA_SOURCE_PASSWORD/);    } catch (Exception e) { /LOG/.error("---hana get connection has exception , msg = ", e); 
    } return con; }


Hana driver dependency as below:

     com.sap.cloud.db.jdbc     
ngdbc     2.3.62 






Process suspend when get Hana connection in open method of sink function

2021-08-18 Thread Chenzhiyuan(HR)
Dear all:
I have a problem when I want to sink data to Hana database.
Process is suspended when get Hana connection in the open method of sink 
function as below.
My flink version is 1.10.


public class HrrmPayValueSumToHana extends 
RichSinkFunction  {


@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
connection = HrrmUtils.getHanaConnection();// process is suspended here
}



@Override
public void invoke() {

   ...

}



@Override
public void close() throws Exception {

   ..

}
}



public static Connection getHanaConnection() {
Connection con = null;
try {
Class.forName(HrrmConstants.HANA_DRIVER_CLASS);
con = DriverManager.getConnection(HrrmConstants.HANA_SOURCE_DRIVER_URL,
HrrmConstants.HANA_SOURCE_USER, HrrmConstants.HANA_SOURCE_PASSWORD);
} catch (Exception e) {
LOG.error("---hana get connection has exception , msg = ", e);
}
return con;
}


Hana driver dependency as below:



com.sap.cloud.db.jdbc
ngdbc
2.3.62






Process suspend when get Hana connection in open method of sink function

2021-08-18 Thread Chenzhiyuan(HR)
Dear all:
I have a problem when I want to sink data to Hana database.
Process is suspended when get Hana connection in the open method of sink 
function as below.
My flink version is 1.10.


public class HrrmPayValueSumToHana extends 
RichSinkFunction  {


@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
connection = HrrmUtils.getHanaConnection();// process is suspended here
}



@Override
public void invoke() {

   ...

}



@Override
public void close() throws Exception {

   ..

}
}



public static Connection getHanaConnection() {
Connection con = null;
try {
Class.forName(HrrmConstants.HANA_DRIVER_CLASS);
con = DriverManager.getConnection(HrrmConstants.HANA_SOURCE_DRIVER_URL,
HrrmConstants.HANA_SOURCE_USER, HrrmConstants.HANA_SOURCE_PASSWORD);
} catch (Exception e) {
LOG.error("---hana get connection has exception , msg = ", e);
}
return con;
}


Hana driver dependency as below:



com.sap.cloud.db.jdbc
ngdbc
2.3.62