Skip to content

Instantly share code, notes, and snippets.

@masazdream
Created July 3, 2014 10:34
Show Gist options
  • Select an option

  • Save masazdream/8b1504fb8cae9b59e10e to your computer and use it in GitHub Desktop.

Select an option

Save masazdream/8b1504fb8cae9b59e10e to your computer and use it in GitHub Desktop.
@Path("/communication")
public class HelloSCRYServer {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayHello() {
String result = null;
LocalTransaction tx = AppConfig.getLocalTransaction();
try {
tx.begin();
MCategoryDao dao = new MCategoryDaoImpl();
MCategory mcategory = dao.selectById(1);
result = mcategory.getCategoryCode();
tx.commit();
} finally {
// トランザクション
tx.rollback();
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment