i have a project using Springboot and MyBatis to write API like this
@Mapper
public interface ExportJobDetailRepository {
List<RegularExportDetail> getExportJobDetailById(@Param("id") String id);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace="com.toshiba.mwcloud.gs.dbaas.repository.ExportJobDetailRepository">
<resultMap id="BaseResultMap"
type="com.toshiba.mwcloud.gs.dbaas.griddbdto.RegularExportDetail">
<id column="id" property="id" />
<result column="export_job_id" property="regularExportId" />
<result column="containers" property="containers" />
<result column="time_column" property="timeColumn" />
<result column="row_filter" property="rowFilter" />
<result column="export_method" property="exportMethod" />
</resultMap>
<select id="getExportJobDetailById" resultMap="BaseResultMap">
SELECT * FROM
export_job_detail
where export_job_id = #{id}
order by containers desc
</select>
</mapper>
I need to write a function that can set timeout for API, and Kill the query processing if reach timeout. What should i do for this problem ? Thanks a lot