Package org.hibernate.search

Examples of org.hibernate.search.FullTextSession.doWork()


  @Test
  public void testBatchSize() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    final int loop = 14;
    s.doWork( new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        for ( int i = 0; i < loop; i++ ) {
          Statement statmt = connection.createStatement();
            statmt.executeUpdate( "insert into Domain(id, name) values( + "
View Full Code Here


    tx.commit();
    s.close();

    s = Search.getFullTextSession( openSession() );
    s.getTransaction().begin();
    s.doWork( new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        Statement stmt = connection.createStatement();
        stmt.executeUpdate( "update Email set body='Meet the guys who write the software'" );
        stmt.close();
View Full Code Here

        Statement stmt = connection.createStatement();
        stmt.executeUpdate( "update Email set body='Meet the guys who write the software'" );
        stmt.close();
      }
    } );
    s.doWork( new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        //insert an object never indexed
        Statement stmt = connection.createStatement();
        stmt.executeUpdate( "insert into Email(id, title, body, header) values( + "
View Full Code Here

  @Test
  public void testManualIndexFlush() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    final int loop = 14;
    s.doWork( new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        for ( int i = 0; i < loop; i++ ) {
          Statement statmt = connection.createStatement();
          statmt.executeUpdate( "insert into Domain(id, name) values( + "
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.