??xml version="1.0" encoding="utf-8" standalone="yes"?>香蕉久久a毛片,色婷婷综合缴情免费观看,久久久www免费人成黑人精品 http://www.aygfsteel.com/jinfeng_wang/category/55151.htmlG-G-S,D-D-U!zh-cnThu, 29 Dec 2016 16:42:24 GMTThu, 29 Dec 2016 16:42:24 GMT60Sharding-JDBC 柔性事?/title><link>http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/29/432214.html</link><dc:creator>jinfeng_wang</dc:creator><author>jinfeng_wang</author><pubDate>Thu, 29 Dec 2016 06:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/29/432214.html</guid><wfw:comment>http://www.aygfsteel.com/jinfeng_wang/comments/432214.html</wfw:comment><comments>http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/29/432214.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jinfeng_wang/comments/commentRss/432214.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jinfeng_wang/services/trackbacks/432214.html</trackback:ping><description><![CDATA[<div>跨数据库的事务,只能在业务上保证?br />不能保证的是Q?个SQL能够在同一旉成功?br />业务上的先期(g)查、校验、分布式锁的设计Q再加上一部分的措施(不停重试、先划一部分蛋糕再恢复)是必要考虑的问题和Ҏ(gu)?br /><br /><br /><br />http://dangdangdotcom.github.io/sharding-jdbc/post/soft_transaction/<br /><div>http://dangdangdotcom.github.io/sharding-jdbc/post/transaction/</div><br /><h1>最大努力送达?/h1><h2>概念</h2><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;">在分布式数据库的场景下,怿对于该数据库的操作最l一定可以成功,所以通过最大努力反复尝试送达操作?/p><h2>架构?/h2><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;"><img src="http://dangdangdotcom.github.io/sharding-jdbc/img/architecture-soft-transaction-bed.png" alt="最大努力送达型事? style="box-sizing: border-box; border: 0px; vertical-align: middle;" /></p><h2>适用场景</h2><ul style="box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 1.6em; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; background-color: #f8f8f8;"><li style="box-sizing: border-box;">Ҏ(gu)主键删除数据?/li><li style="box-sizing: border-box;">更新记录怹状态,如更新通知送达状态?/li></ul><h2>使用限制</h2><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;">使用最大努力送达型柔性事务的<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">SQL</code>需要满_{性?/p><ul style="box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 1.6em; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; background-color: #f8f8f8;"><li style="box-sizing: border-box;">INSERT语句要求必须包含主键Q且不能是自增主键?/li><li style="box-sizing: border-box;">UPDATE语句要求q等Q不能是<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">UPDATE xxx SET x=x+1</code></li><li style="box-sizing: border-box;">DELETE语句无要求?/li></ul><h2>开发指?/h2><ul style="box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 1.6em; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; background-color: #f8f8f8;"><li style="box-sizing: border-box;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Sharding-JDBC-transaction</code>完全Z<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">java</code>开发,直接提供<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">jar</code>包,可直接用maven导入坐标卛_使用?/li><li style="box-sizing: border-box;">Z保证事务不丢失,<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Sharding-JDBC-transaction</code>需要提供数据库存储事务日志Q配|方法可参见事务理器配|项?/li><li style="box-sizing: border-box;">׃柔性事务采用异步尝试,需要部|独立的作业?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Zookeeper</code>?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Sharding-JDBC-transaction</code>采用<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">elastic-job</code>实现?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Sharding-JDBC-transaction-async-job</code>Q通过单配|即可启动高可用作业异步送达柔性事务,启动脚本?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">start.sh</code>?/li><li style="box-sizing: border-box;">Z便于开发,<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Sharding-JDBC-transaction</code>提供了基于内存的事务日志存储器和内嵌异步作业?/li></ul><h2>开发示?/h2><pre language-java"="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: 13px; padding: 1em; margin-top: 0.5em; margin-bottom: 0.5em; line-height: 1.5; word-break: normal; word-wrap: normal; border: 1px solid #cccccc; border-radius: 4px; text-shadow: #ffffff 0px 1px; direction: ltr; tab-size: 4; background: #f5f2f0;"><code language-java"="" style="box-sizing: border-box; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: inherit; padding: 0px; border-radius: 0px; text-shadow: #ffffff 0px 1px; direction: ltr; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; background: 0px 0px;"> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">// 1. 配置SoftTransactionConfiguration</span> SoftTransactionConfiguration transactionConfig <span operator"="" style="box-sizing: border-box; color: #a67f59; background: rgba(255, 255, 255, 0.498039);">=</span> <span keyword"="" style="box-sizing: border-box; color: #0077aa;">new</span> <span id="wmqeeuq" class-name"="" style="box-sizing: border-box;">SoftTransactionConfiguration</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span>dataSource<span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> transactionConfig<span punctuation"="" style="box-sizing: border-box; color: #999999;">.</span><span function"="" style="box-sizing: border-box; color: #dd4a68;">setXXX</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">// 2. 初始化SoftTransactionManager</span> SoftTransactionManager transactionManager <span operator"="" style="box-sizing: border-box; color: #a67f59; background: rgba(255, 255, 255, 0.498039);">=</span> <span keyword"="" style="box-sizing: border-box; color: #0077aa;">new</span> <span id="wmqeeuq" class-name"="" style="box-sizing: border-box;">SoftTransactionManager</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span>transactionConfig<span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> transactionManager<span punctuation"="" style="box-sizing: border-box; color: #999999;">.</span><span function"="" style="box-sizing: border-box; color: #dd4a68;">init</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">// 3. 获取BEDSoftTransaction</span> BEDSoftTransaction transaction <span operator"="" style="box-sizing: border-box; color: #a67f59; background: rgba(255, 255, 255, 0.498039);">=</span> <span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span>BEDSoftTransaction<span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span> transactionManager<span punctuation"="" style="box-sizing: border-box; color: #999999;">.</span><span function"="" style="box-sizing: border-box; color: #dd4a68;">getTransaction</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span>SoftTransactionType<span punctuation"="" style="box-sizing: border-box; color: #999999;">.</span>BestEffortsDelivery<span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">// 4. 开启事?/span> transaction<span punctuation"="" style="box-sizing: border-box; color: #999999;">.</span><span function"="" style="box-sizing: border-box; color: #dd4a68;">begin</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span>connection<span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">// 5. 执行JDBC</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">/* codes here */</span> <span operator"="" style="box-sizing: border-box; color: #a67f59; background: rgba(255, 255, 255, 0.498039);">*</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">// 6.关闭事务</span> transaction<span punctuation"="" style="box-sizing: border-box; color: #999999;">.</span><span function"="" style="box-sizing: border-box; color: #dd4a68;">end</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">(</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">)</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">;</span> </code></pre><h2>事务理器配|项</h2><h3><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 21.6px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">SoftTransactionConfiguration</code>配置</h3><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;">用于配置事务理器?/p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; display: block; width: 872.5px; overflow: auto; word-break: keep-all; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;"><thead style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">名称</em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">cd</em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">必填</em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">默认?/em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">说明</em></th></tr></thead><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">shardingDataSource</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">ShardingDataSource</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">?/code></td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;"></td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">事务理器管理的数据?/td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">syncMaxDeliveryTryTimes</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">int</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">3</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">同步的事务送达的最大尝试次?/td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">storageType</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">enum</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">RDB</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">事务日志存储cd。可选? RDB,MEMORY。用RDBcd自动徏?/td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">transactionLogDataSource</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">DataSource</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">null</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">存储事务日志的数据源Q如果storageType为RDB则必?/td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">bestEffortsDeliveryJobConfiguration</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">NestedBestEffortsDeliveryJobConfiguration</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">null</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">最大努力送达型内嵌异步作业配|对象。如需使用Q请参?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">NestedBestEffortsDeliveryJobConfiguration</code>配置</td></tr></tbody></table><h3><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 21.6px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">NestedBestEffortsDeliveryJobConfiguration</code>配置 (仅开发环?</h3><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;">用于配置内嵌的异步作业,仅用于开发环境。生产环境应使用独立部v的作业版本?/p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; display: block; width: 872.5px; overflow: auto; word-break: keep-all; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;"><thead style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">名称</em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">cd</em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">必填</em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">默认?/em></th><th style="box-sizing: border-box; padding: 0.5rem 1rem; border: 1px solid #e9ebec;"><em style="box-sizing: border-box;">说明</em></th></tr></thead><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">zookeeperPort</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">int</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">4181</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">内嵌的注册中心端口号</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">zookeeperDataDir</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">String</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">target/test_zk_data/nano/</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">内嵌的注册中心的数据存放目录</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">asyncMaxDeliveryTryTimes</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">int</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">3</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">异步的事务送达的最大尝试次?/td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">asyncMaxDeliveryTryDelayMillis</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">long</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">?/td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">60000</td><td style="box-sizing: border-box; padding: 0.5rem 1rem; border-style: solid; border-color: #e9ebec;">执行异步送达事务的gq毫U数Q早于此间隔旉的入库事务才?x)被异步作业执?/td></tr></tbody></table><h2>独立部v作业指南</h2><ul style="box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 1.6em; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; background-color: #f8f8f8;"><li style="box-sizing: border-box;">部v用于存储事务日志的数据库?/li><li style="box-sizing: border-box;">部v用于异步作业使用?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Zookeeper</code>?/li><li style="box-sizing: border-box;">配置<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">yaml</code>文g,参照CZ?/li><li style="box-sizing: border-box;">下蝲q解压文?code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">sharding-jdbc-transaction-async-job-$VERSION.tar</code>Q通过<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">start.sh</code>脚本启动异步作业?/li></ul><h2>异步作业yaml文g配置</h2><pre language-yaml"="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: 13px; padding: 1em; margin-top: 0.5em; margin-bottom: 0.5em; line-height: 1.5; word-break: normal; word-wrap: normal; border: 1px solid #cccccc; border-radius: 4px; text-shadow: #ffffff 0px 1px; direction: ltr; tab-size: 4; background: #f5f2f0;"><code language-yaml"="" style="box-sizing: border-box; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: inherit; padding: 0px; border-radius: 0px; text-shadow: #ffffff 0px 1px; direction: ltr; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; background: 0px 0px;"><span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#目标数据库的数据?</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">targetDataSource</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">ds_0</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span tag"="" style="box-sizing: border-box; color: #990055;">!!org.apache.commons.dbcp.BasicDataSource</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">driverClassName</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> com.mysql.jdbc.Driver <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">url</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> jdbc<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>mysql<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>//localhost<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>3306/ds_0 <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">username</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> root <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">password</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">ds_1</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span tag"="" style="box-sizing: border-box; color: #990055;">!!org.apache.commons.dbcp.BasicDataSource</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">driverClassName</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> com.mysql.jdbc.Driver <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">url</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> jdbc<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>mysql<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>//localhost<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>3306/ds_1 <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">username</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> root <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">password</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#事务日志的数据源.</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">transactionLogDataSource</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">ds_trans</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span tag"="" style="box-sizing: border-box; color: #990055;">!!org.apache.commons.dbcp.BasicDataSource</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">driverClassName</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> com.mysql.jdbc.Driver <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">url</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> jdbc<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>mysql<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>//localhost<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span>3306/trans_log <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">username</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> root <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">password</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#注册中心配置</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">zkConfig</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#注册中心的连接地址</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">connectionString</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> localhost<span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span><span number"="" style="box-sizing: border-box; color: #990055;">2181</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#作业的命名空?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">namespace</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> Best<span punctuation"="" style="box-sizing: border-box; color: #999999;">-</span>Efforts<span punctuation"="" style="box-sizing: border-box; color: #999999;">-</span>Delivery<span punctuation"="" style="box-sizing: border-box; color: #999999;">-</span>Job <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#注册中心的等待重试的间隔旉的初始?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">baseSleepTimeMilliseconds</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span number"="" style="box-sizing: border-box; color: #990055;">1000</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#注册中心的等待重试的间隔旉的最大?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">maxSleepTimeMilliseconds</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span number"="" style="box-sizing: border-box; color: #990055;">3000</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#注册中心的最大重试次?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">maxRetries</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span number"="" style="box-sizing: border-box; color: #990055;">3</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#作业配置</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">jobConfig</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#作业名称</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">name</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> bestEffortsDeliveryJob <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#触发作业的cron表达?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">cron</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> 0/5 * * * * <span punctuation"="" style="box-sizing: border-box; color: #999999;">?</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#每次作业获取的事务日志最大数?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">transactionLogFetchDataCount</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span number"="" style="box-sizing: border-box; color: #990055;">100</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#事务送达的最大尝试次?</span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">maxDeliveryTryTimes</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span number"="" style="box-sizing: border-box; color: #990055;">3</span> <span comment"="" spellcheck="true" style="box-sizing: border-box; color: #708090;">#执行送达事务的gq毫U数,早于此间隔时间的入库事务才会(x)被作业执?/span> <span key="" atrule"="" style="box-sizing: border-box; color: #0077aa;">maxDeliveryTryDelayMillis</span><span punctuation"="" style="box-sizing: border-box; color: #999999;">:</span> <span number"="" style="box-sizing: border-box; color: #990055;">60000</span> </code></pre><div><code language-yaml"="" style="box-sizing: border-box; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: inherit; padding: 0px; border-radius: 0px; text-shadow: #ffffff 0px 1px; direction: ltr; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;"><span number"="" style="box-sizing: border-box; color: #990055;"><br /><br /><h1>事务支持说明</h1><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Sharding-JDBC</code>׃性能斚w的考量Q决定不支持<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">Z致?/code>分布式事务。我们已明确规划U\图,未来?x)支持最l一致性的柔性事务?/p><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;">目前<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">最大努力送达?/code>柔性事务已开发完成?/p><p style="box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 19.2px; background-color: #f8f8f8;">如果不用柔性事务,也会(x)自动包含<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14.4px; padding: 2px 4px; color: #c7254e; border-radius: 4px; background-color: #f9f2f4;">弱XA</code>事务支持Q有以下几点说明Q?/p><ul style="box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 1.6em; color: #333333; font-family: -apple-system-headline, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; background-color: #f8f8f8;"><li style="box-sizing: border-box;"><p style="box-sizing: border-box; margin: 0px 0px 10px;">完全支持非跨库事务,例如Q仅分表Q或分库但是路由的结果在单库中?/p></li><li style="box-sizing: border-box;"><p style="box-sizing: border-box; margin: 0px 0px 10px;">完全支持因逻辑异常D的跨库事务。例如:(x)同一事务中,跨两个库更新。更新完毕后Q抛出空指针Q则两个库的内容都能回滚?/p></li><li style="box-sizing: border-box;"><p style="box-sizing: border-box; margin: 0px 0px 10px;">不支持因|络、硬件异常导致的跨库事务。例如:(x)同一事务中,跨两个库更新Q更新完毕后、未提交之前Q第一个库LQ则只有W二个库数据提交?/p></li></ul></span></code></div></div><img src ="http://www.aygfsteel.com/jinfeng_wang/aggbug/432214.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jinfeng_wang/" target="_blank">jinfeng_wang</a> 2016-12-29 14:49 <a href="http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/29/432214.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring XML 文g中自定义标签http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432208.htmljinfeng_wangjinfeng_wangWed, 28 Dec 2016 11:01:00 GMThttp://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432208.htmlhttp://www.aygfsteel.com/jinfeng_wang/comments/432208.htmlhttp://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432208.html#Feedback0http://www.aygfsteel.com/jinfeng_wang/comments/commentRss/432208.htmlhttp://www.aygfsteel.com/jinfeng_wang/services/trackbacks/432208.html阅读全文

jinfeng_wang 2016-12-28 19:01 发表评论
]]>
Sharding-JDBC的分库分表能?/title><link>http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432207.html</link><dc:creator>jinfeng_wang</dc:creator><author>jinfeng_wang</author><pubDate>Wed, 28 Dec 2016 10:57:00 GMT</pubDate><guid>http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432207.html</guid><wfw:comment>http://www.aygfsteel.com/jinfeng_wang/comments/432207.html</wfw:comment><comments>http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432207.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jinfeng_wang/comments/commentRss/432207.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jinfeng_wang/services/trackbacks/432207.html</trackback:ping><description><![CDATA[     摘要: 代码Qsharding-jdbc-config-common 目录面(f)的问题:(x) select * from a, b where a.user_id =b.user_id  在分库分表的情况下,如何军_一个正的JDBC DataSourceQ一个正的Table Namehttp://dangdangdotcom.github.io/sharding-jdbc/post/user_gu...  <a href='http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432207.html'>阅读全文</a><img src ="http://www.aygfsteel.com/jinfeng_wang/aggbug/432207.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jinfeng_wang/" target="_blank">jinfeng_wang</a> 2016-12-28 18:57 <a href="http://www.aygfsteel.com/jinfeng_wang/archive/2016/12/28/432207.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƾ</a>| <a href="http://" target="_blank">ٸ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͭϿ</a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ຣʡ</a>| <a href="http://" target="_blank">«</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">᰸</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ȫ</a>| <a href="http://" target="_blank">пǰ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">찲</a>| <a href="http://" target="_blank">ҵ</a>| <a href="http://" target="_blank">Ƕ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʤ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ȫ</a>| <a href="http://" target="_blank">ƺ</a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ũ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>