[h2] notify client of table changes (replacing polling)
Hello, given an H2 client and an H2 server (connected via TCP), is there a way to notify the client of table changes, rather than polling the table using SELECTs periodically? (Unfortunately, CREATE TRIGGER only works on the server.) Thanks in advance. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/652dfd41-8d55-4a1a-81f6-2b0bef64535d%40googlegroups.com.
[h2] notify client of table changes (replacing polling)
Hello, given an H2 server and an H2 client (connected via TCP), is there a way to notify the client of table changes, rather than polling the table using SELECTs periodically? (Unfortunately, CREATE TRIGGER only works on the server.) Thanks in advance. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/039aa218-fd92-4426-8533-a32dd695049c%40googlegroups.com.
Re: [h2] Declaring Functions as Source Code
Hi, sorry, I have tested a little bit and have the wrong stack trace posted. here is the right for my first example: DROP ALIAS TEST_INDEX IF EXISTS; Änderungen: 0 (1 ms) CREATE ALIAS TEST_INDEX AS $$ import org.h2.index.Index; @CODE String TEST_INDEX(Index idx,String test) { return test; } $$; Syntax Fehler in SQL Befehl org\h2\dynamic\TEST_INDEX.java:3: error: package org.h2.index does not exist import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:6: error: cannot find symbol String TEST_INDEX(Index idx,String test) ^ symbol: class Index location: class TEST_INDEX 2 errors Syntax error in SQL statement org\h2\dynamic\TEST_INDEX.java:3: error: package org.h2.index does not exist import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:6: error: cannot find symbol String TEST_INDEX(Index idx,String test) ^ symbol: class Index location: class TEST_INDEX 2 errors ; SQL statement: CREATE ALIAS TEST_INDEX AS $$ import org.h2.index.Index; @CODE String TEST_INDEX(Index idx,String test) { return test; } $$ [42000-174] 42000/42000 (Hilfe) Here is the exception from the example of noel: CREATE ALIAS TEST_INDEX AS $$ String TEST_INDEX(org.h2.index.Index idx, String test) { return test; } $$; Syntax Fehler in SQL Befehl org\h2\dynamic\TEST_INDEX.java:7: error: package org.h2.index does not exist String TEST_INDEX(org.h2.index.Index idx, String test) ^ 1 error Syntax error in SQL statement org\h2\dynamic\TEST_INDEX.java:7: error: package org.h2.index does not exist String TEST_INDEX(org.h2.index.Index idx, String test) ^ 1 error ; SQL statement: CREATE ALIAS TEST_INDEX AS $$ String TEST_INDEX(org.h2.index.Index idx, String test) { return test; } $$ [42000-174]http://192.168.86.36:8082/query.do?jsessionid=685158453303ee8da5d7b54dd6318d11#42000/42000 (Hilfe)http://h2database.com/javadoc/org/h2/constant/ErrorCode.html#c42000 2014-04-03 18:25 GMT+02:00 Thomas Mueller thomas.tom.muel...@gmail.com: Hi, See also the documentation at http://h2database.com/html/features.html#user_defined_functions Your example statement works for me, and it doesn't match the statement in your exception message... Regards, Thomas On Thu, Apr 3, 2014 at 1:55 PM, Noel Grandin noelgran...@gmail.comwrote: Do this: CREATE ALIAS TEST_INDEX AS $$ String TEST_INDEX(org.h2.index.Index idx, String test) { return test; } $$; On 2014-04-03 13:26, hans.java1...@gmail.com wrote: CREATE ALIAS TEST_INDEX AS $$ import org.h2.index.Index; @CODE String TEST_INDEX(Index idx,String test) { return test; } $$; -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
[h2] Declaring Functions as Source Code
Hi, i try to declare a function as Source Code with a reference to the org.h2.index.Index. Here is the example sql statement: DROP ALIAS TEST_INDEX IF EXISTS; CREATE ALIAS TEST_INDEX AS $$ import org.h2.index.Index; @CODE String TEST_INDEX(Index idx,String test) { return test; } $$; If the statement is executed this error occurs: Syntax Fehler in SQL Befehl org\h2\dynamic\TEST_INDEX.java:5: error: illegal start of type public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: ';' expected public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: illegal start of type public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: ';' expected public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: identifier expected public static import org.h2.index.Index; ^ 5 errors Syntax error in SQL statement org\h2\dynamic\TEST_INDEX.java:5: error: illegal start of type public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: ';' expected public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: illegal start of type public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: ';' expected public static import org.h2.index.Index; ^ org\h2\dynamic\TEST_INDEX.java:5: error: identifier expected public static import org.h2.index.Index; ^ 5 errors ; SQL statement: CREATE ALIAS TEST_INDEX AS $$ @CODE import org.h2.index.Index; String TEST_INDEX( Index idx, String test ) throws SQLException { return test; } $$ [42000-170] 42000/42000 (Hilfe) The problem is the reference to the org.h2.index.Index,how can I resolve this problem? Thanks in advance, Hans -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
[h2] Is H2 the best solution for linguistic data?
Dear all, I'm a user of CafeTran (www.CafeTran.com) which uses H2 as a database engine (http://cafetran.wikidot.com/working-with-external-databases). I'm completely unexperienced with this feature of CafeTran. Before I start learning it, I'd like to ask a question here. In another user group (http://groups.yahoo.com/neo/groups/help_/conversations/messages/40917) I found this quote: WFS integrates its own database engine. Most other solutions rely on standard database systems, like Oracle™, Lucene, or SQL engines. A standard database system (DBMS) may sound reassuring to executives who don't grasp the nature of linguistic databases. But there are major drawbacks. The first is that DBMSes are built for standard chores like business management. They are not optimized for linguistic purposes. A standard database system is fine for storing TMs, but its results are poor when it comes to exploiting them full-speed in real production. A TM engine, when looking for a match in a large TM, needs to access then score thousands of candidate TUs before making its final choice – all in well under a second. No wonder search engines (Google, Bing), faced with a similar task of detecting fuzzy correspondances in large masses of text, use their own proprietary database and indexing scheme. My question would be: is H2 the best solution to store Translation Memories with millions of segments? Translation Memories are a special kind of XML files where every segment (e.g. a sentence) in a source language is assigned to a segment in a target language: http://en.wikipedia.org/wiki/Translation_Memory_eXchange Thanks for your help! Hans -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.