Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug with added padding and not reseting the header on a timeout.
- Loading branch information
1 parent
5d2bf5e
commit a401ef8
Showing
7 changed files
with
74 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
src/main/java/net/openhft/chronicle/queue/JDBCResult.java
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
src/main/java/net/openhft/chronicle/queue/JDBCStatement.java
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package net.openhft.chronicle.queue; | ||
|
||
import net.openhft.chronicle.wire.Marshallable; | ||
|
||
/** | ||
* Created by peter on 06/04/16. | ||
*/ | ||
public interface JDBCStatement { | ||
void executeQuery(String query, Class<? extends Marshallable> resultType, Object... args); | ||
void executeQuery(String query, Object... args); | ||
|
||
void executeUpdate(String query, Object... args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/test/java/net/openhft/chronicle/queue/CountingJDBCResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.openhft.chronicle.queue; | ||
|
||
import net.openhft.chronicle.core.Jvm; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicLong; | ||
|
||
/** | ||
* Created by Peter on 18/06/2016. | ||
*/ | ||
class CountingJDBCResult implements JDBCResult { | ||
private final AtomicLong queries; | ||
private final AtomicLong updates; | ||
|
||
public CountingJDBCResult(AtomicLong queries, AtomicLong updates) { | ||
this.queries = queries; | ||
this.updates = updates; | ||
} | ||
|
||
@Override | ||
public void queryResult(List<String> columns, List<List<Object>> rows, String query, Object... args) { | ||
System.out.println("query " + query + " returned " + columns); | ||
for (List<Object> row : rows) { | ||
System.out.println("\t" + row); | ||
} | ||
queries.incrementAndGet(); | ||
} | ||
|
||
@Override | ||
public void queryThrown(Throwable t, String query, Object... args) { | ||
throw Jvm.rethrow(t); | ||
} | ||
|
||
@Override | ||
public void updateResult(long count, String update, Object... args) { | ||
updates.incrementAndGet(); | ||
} | ||
|
||
@Override | ||
public void updateThrown(Throwable t, String update, Object... args) { | ||
throw Jvm.rethrow(t); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters